From d2b7f37b86ccd7a0368ef947b186218d0758f9c0 Mon Sep 17 00:00:00 2001 From: jowj Date: Tue, 23 Apr 2019 14:32:05 -0500 Subject: [PATCH 1/3] Split out various functionalities to distinct files. --- applicationConfiguration/.emacs/jlj-misc.el | 49 +++++++++++++++ applicationConfiguration/.emacs/jlj-org.el | 62 +++++++++++++++++++ applicationConfiguration/.emacs/jlj-python.el | 22 +++++++ applicationConfiguration/.emacs/jlj-rust.el | 15 +++++ 4 files changed, 148 insertions(+) create mode 100644 applicationConfiguration/.emacs/jlj-misc.el create mode 100644 applicationConfiguration/.emacs/jlj-org.el create mode 100644 applicationConfiguration/.emacs/jlj-python.el create mode 100644 applicationConfiguration/.emacs/jlj-rust.el diff --git a/applicationConfiguration/.emacs/jlj-misc.el b/applicationConfiguration/.emacs/jlj-misc.el new file mode 100644 index 0000000..e8817b3 --- /dev/null +++ b/applicationConfiguration/.emacs/jlj-misc.el @@ -0,0 +1,49 @@ +;;;; global settings, emacs-wide stuff + +;; Set global vars +(setq inhibit-splash-screen t) ; Disable the splash screen (to enable it agin, replace the t with 0) +(when (version<= "26.0.50" emacs-version ) + (global-display-line-numbers-mode)); show line numbers; use this instead of linum if you can because FUCK linum sucks + +(global-visual-line-mode t) ; turn on word-wrap globally (probably a mistake, but wanted for org-mode) +(menu-bar-mode -1) ; disable visual menu on emacs +(tool-bar-mode -1) +(setq indent-tabs-mode nil) ; always use spaces, not tabs, when indenting +(setq case-fold-search t) ; ignore case when searching + +;; require final newlines in files when they are saved +(setq require-final-newline t) + +(when (eq system-type 'darwin) + (setq mac-command-modifier 'meta)) ; deal with mac command key problems: + +(setq backup-directory-alist `(("." . "~/Nextcloud/Documents/org/.saves"))) ; deal with bullshit files in every dir. +(set-frame-font "Consolas 12") ; set default font, versions of emacs may require set-default-font + +(setq user-init-file "~/Documents/projects/agares/applicationConfiguration/.emacs/init.el") ;set default init file to agares +(find-file "~/Nextcloud/Documents/org/personal.org") ;open primary org file on launch +(transient-mark-mode 1) ; Enable transient mark mode + +;; custom emacsland functions +(defun find-user-init-file () + "Edit the `user-init-file', in another window." + (interactive) + (find-file-other-window user-init-file)) +(global-set-key (kbd "C-c I") 'find-user-init-file) + +;; eshell configuration +;; ------------------------------------- +(setq eshell-prompt-function + (lambda () + (concat (format-time-string "%H:%M:%S" (current-time)) + (if (= (user-uid) 0) " ☭ " " ǰ ")))) + +;; Multiple Cursors +(require 'multiple-cursors) +(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) +(global-set-key (kbd "C->") 'mc/mark-next-like-this) +(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) +(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) + +;; shell confs +(exec-path-from-shell-copy-env "PATH") ; copy PATH from shell diff --git a/applicationConfiguration/.emacs/jlj-org.el b/applicationConfiguration/.emacs/jlj-org.el new file mode 100644 index 0000000..fc00f34 --- /dev/null +++ b/applicationConfiguration/.emacs/jlj-org.el @@ -0,0 +1,62 @@ +;;Org mode configuration + +(require 'org) ; Enable Org mode +(setq ispell-program-name "/usr/local/bin/ispell") ; set flyspell's spellchecker +(add-hook 'org-mode-hook 'turn-on-flyspell) ; enable flyspell-mode in all org-mode enabled files +(setq org-src-fontify-natively t + org-src-window-setup 'current-window + org-src-strip-leading-and-trailing-blank-lines t + org-src-preserve-indentation t + org-src-tab-acts-natively t + setq x-selection-timeout 10 ;; this fixes a freeze when org-capture is called. lol. + org-edit-src-content-indentation 0) + +(add-hook 'org-agenda-mode-hook + (lambda () + (visual-line-mode -1) + (toggle-truncate-lines 1))) + +;; org-agenda configs +(setq org-habit-show-habits-only-for-today nil) +(setq org-agenda-repeating-timestamp-show-all nil) +(setq org-deadline-warning-days 1) +(setq org-global-properties + '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) +(setq org-columns-default-format + '(("%25ITEM %TODO %3PRIORITY %TAGS"))) + +(setq org2blog/wp-blog-alist + '(("wordpress" + :url "https://web1/xmlrpc.php" + :username "josiah" + :default-title "published from org" + :default-categories ("org2blog" "emacs" "homelab") + :tags-as-categories nil))) + +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(org-level-1 ((t (:inherit outline-1 :height 1.3)))) + '(org-level-2 ((t (:inherit outline-2 :height 1.2)))) + '(org-level-3 ((t (:inherit outline-3 :height 1.1)))) + '(org-level-4 ((t (:inherit outline-4 :height 1.1)))) + '(org-level-5 ((t (:inherit outline-5 :height 1.1))))) + +;;;; custom org mode hotkeys +(global-set-key "\C-cl" 'org-store-link) +(global-set-key "\C-ca" 'org-agenda) +(global-set-key "\C-cc" 'org-capture) +(global-set-key "\C-cb" 'org-iswitchb) + +;;;; search across agenda files when refiling: +(setq org-refile-targets '((nil :maxlevel . 9) + (org-agenda-files :maxlevel . 9))) +(setq org-outline-path-complete-in-steps nil) ; Refile in a single go +(setq org-refile-use-outline-path t) ; Show full paths for refiling +(setq org-agenda-files '("~/Nextcloud/Documents/org/")) ; add files to agenda: + + +(setq org-directory "~/Nextcloud/Documents/org/") ; define generic org capture shit +(setq org-default-notes-file (concat org-directory "/refile-beorg.org")) diff --git a/applicationConfiguration/.emacs/jlj-python.el b/applicationConfiguration/.emacs/jlj-python.el new file mode 100644 index 0000000..3fa3086 --- /dev/null +++ b/applicationConfiguration/.emacs/jlj-python.el @@ -0,0 +1,22 @@ +;; PYTHON CONFIGURATION +;; -------------------------------------- + +;; enable org-mode babel python code blocks +(org-babel-do-load-languages + 'org-babel-load-languages + '((python . t) + (matlab . t))) + +(elpy-enable) +(setq python-shell-interpreter "python3" + python-shell-interpreter-args "-i") + +;; use flycheck not flymake with elpy +(require 'elpy) +(when (require 'flycheck nil t) + (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) + (add-hook 'elpy-mode-hook 'flycheck-mode)) + +;; enable autopep8 formatting on save +(require 'py-autopep8) +(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save) diff --git a/applicationConfiguration/.emacs/jlj-rust.el b/applicationConfiguration/.emacs/jlj-rust.el new file mode 100644 index 0000000..945fd16 --- /dev/null +++ b/applicationConfiguration/.emacs/jlj-rust.el @@ -0,0 +1,15 @@ +;; RUST CONFIGURATION +;; -------------------------------------- + +(add-hook 'rust-mode-hook 'cargo-minor-mode) +(add-hook 'flycheck-mode-hook #'flycheck-rust-setup) +(add-hook 'rust-mode-hook + (lambda () + (local-set-key (kbd "C-c ") #'rust-format-buffer))) + +(setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH +(setq racer-rust-src-path "~/gitshit/rust/src") ;; Rust source code PATH + +(add-hook 'rust-mode-hook #'racer-mode) +(add-hook 'racer-mode-hook #'eldoc-mode) +(add-hook 'racer-mode-hook #'company-mode) From 981b411ec8ca162b3a95d9ca989b77e2b4a5b203 Mon Sep 17 00:00:00 2001 From: jowj Date: Tue, 23 Apr 2019 14:32:22 -0500 Subject: [PATCH 2/3] Add calls to new split files from init.el --- applicationConfiguration/.emacs/init.el | 179 ++---------------------- 1 file changed, 10 insertions(+), 169 deletions(-) diff --git a/applicationConfiguration/.emacs/init.el b/applicationConfiguration/.emacs/init.el index 7d2d3f9..41e56ae 100644 --- a/applicationConfiguration/.emacs/init.el +++ b/applicationConfiguration/.emacs/init.el @@ -1,106 +1,13 @@ ;; -*- mode: elisp -*- -;; Set global vars -(setq inhibit-splash-screen t) ; Disable the splash screen (to enable it agin, replace the t with 0) -(when (version<= "26.0.50" emacs-version ) - (global-display-line-numbers-mode)); show line numbers; use this instead of linum if you can because FUCK linum sucks - -(global-visual-line-mode t) ; turn on word-wrap globally (probably a mistake, but wanted for org-mode) -(menu-bar-mode -1) ; disable visual menu on emacs -(tool-bar-mode -1) -(setq indent-tabs-mode nil) ; always use spaces, not tabs, when indenting -(setq case-fold-search t) ; ignore case when searching - -; require final newlines in files when they are saved -(setq require-final-newline t) - -(when (eq system-type 'darwin) - (setq mac-command-modifier 'meta)) ; deal with mac command key problems: - -(setq backup-directory-alist `(("." . "~/Nextcloud/Documents/org/.saves"))) ; deal with bullshit files in every dir. -(set-frame-font "Consolas 12") ; set default font, versions of emacs may require set-default-font - -(setq user-init-file "~/Documents/projects/agares/applicationConfiguration/.emacs/init.el") ;set default init file to agares -(find-file "~/Nextcloud/Documents/org/personal.org") ;open primary org file on launch -(transient-mark-mode 1) ; Enable transient mark mode - -;; custom emacsland functions -(defun find-user-init-file () - "Edit the `user-init-file', in another window." - (interactive) - (find-file-other-window user-init-file)) -(global-set-key (kbd "C-c I") 'find-user-init-file) - -;;Org mode configuration -(require 'org) ; Enable Org mode -(setq ispell-program-name "/usr/local/bin/ispell") ; set flyspell's spellchecker -(add-hook 'org-mode-hook 'turn-on-flyspell) ; enable flyspell-mode in all org-mode enabled files -(setq org-src-fontify-natively t - org-src-window-setup 'current-window - org-src-strip-leading-and-trailing-blank-lines t - org-src-preserve-indentation t - org-src-tab-acts-natively t - setq x-selection-timeout 10 ;; this fixes a freeze when org-capture is called. lol. - org-edit-src-content-indentation 0) - -(add-hook 'org-agenda-mode-hook - (lambda () - (visual-line-mode -1) - (toggle-truncate-lines 1))) - -;; org-agenda configs -(setq org-habit-show-habits-only-for-today nil) -(setq org-agenda-repeating-timestamp-show-all nil) -(setq org-deadline-warning-days 1) -(setq org-global-properties - '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) -(setq org-columns-default-format - '(("%25ITEM %TODO %3PRIORITY %TAGS"))) - -(setq org2blog/wp-blog-alist - '(("wordpress" - :url "https://web1/xmlrpc.php" - :username "josiah" - :default-title "published from org" - :default-categories ("org2blog" "emacs" "homelab") - :tags-as-categories nil))) - -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(org-level-1 ((t (:inherit outline-1 :height 1.3)))) - '(org-level-2 ((t (:inherit outline-2 :height 1.2)))) - '(org-level-3 ((t (:inherit outline-3 :height 1.1)))) - '(org-level-4 ((t (:inherit outline-4 :height 1.1)))) - '(org-level-5 ((t (:inherit outline-5 :height 1.1))))) - -;;;; custom org mode hotkeys -(global-set-key "\C-cl" 'org-store-link) -(global-set-key "\C-ca" 'org-agenda) -(global-set-key "\C-cc" 'org-capture) -(global-set-key "\C-cb" 'org-iswitchb) - -;;;; search across agenda files when refiling: -(setq org-refile-targets '((nil :maxlevel . 9) - (org-agenda-files :maxlevel . 9))) -(setq org-outline-path-complete-in-steps nil) ; Refile in a single go -(setq org-refile-use-outline-path t) ; Show full paths for refiling -(setq org-agenda-files '("~/Nextcloud/Documents/org/")) ; add files to agenda: - - -(setq org-directory "~/Nextcloud/Documents/org/") ; define generic org capture shit -(setq org-default-notes-file (concat org-directory "/refile-beorg.org")) - -;; packages - -;;;;list package targets +;;;; packages +;;list package targets (setq package-archives '(("melpa" . "http://melpa.milkbox.net/packages/") ("gnu" . "http://elpa.gnu.org/packages/") ("elpy" . "http://jorgenschaefer.github.io/packages/"))) -;;;;Refresh package contents + +;;Refresh package contents (unless package-archive-contents (package-refresh-contents)) @@ -131,21 +38,11 @@ (package-install package))) myPackages) -;; load custom themes - -;; ;;;; doom theme bullshit -;; (require 'doom-themes) - -;; ;; Global settings (defaults) -;; (setq doom-themes-enable-bold t ; if nil, bold is universally disabled -;; doom-themes-enable-italic t) ; if nil, italics is universally disabled - -;; ;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each -;; ;; theme may have their own settings. -;; (load-theme 'doom-one t) - -;; ;; Enable flashing mode-line on errors -;; (doom-themes-visual-bell-config) +(require + (jlj-misc.el) + (jlj-org.el) + (jlj-python.el) + (jlj-rust.el)) (custom-set-variables ;; custom-set-variables was added by Custom. @@ -166,62 +63,6 @@ '(package-selected-packages '(racer flycheck-rust rust-mode color-theme-sanityinc-tomorrow org2blog multiple-cursors flymake-python-pyflakes pdf-tools weechat jedi python-mode pylint py-autopep8 powershell outline-magic markdown-mode magit flycheck exec-path-from-shell elpygen elpy ein doom-themes csharp-mode))) - -;; eshell configuration -;; ------------------------------------- -(setq eshell-prompt-function - (lambda () - (concat (format-time-string "%H:%M:%S" (current-time)) - (if (= (user-uid) 0) " ☭ " " ǰ ")))) - -;; PYTHON CONFIGURATION -;; -------------------------------------- - -;; enable org-mode babel python code blocks -(org-babel-do-load-languages - 'org-babel-load-languages - '((python . t) - (matlab . t))) - -(elpy-enable) -(setq python-shell-interpreter "python3" - python-shell-interpreter-args "-i") - -;; use flycheck not flymake with elpy -(require 'elpy) -(when (require 'flycheck nil t) - (setq elpy-modules (delq 'elpy-module-flymake elpy-modules)) - (add-hook 'elpy-mode-hook 'flycheck-mode)) - -;; enable autopep8 formatting on save -(require 'py-autopep8) -(add-hook 'elpy-mode-hook 'py-autopep8-enable-on-save) - -;; Multiple Cursors -(require 'multiple-cursors) -(global-set-key (kbd "C-S-c C-S-c") 'mc/edit-lines) -(global-set-key (kbd "C->") 'mc/mark-next-like-this) -(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) -(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this) - -;; shell confs -(exec-path-from-shell-copy-env "PATH") ; copy PATH from shell - -;; run emacs as server (connect to it with `emacsclient`) +;;;; run emacs as server (connect to it with `emacsclient`) (server-start) -;; RUST CONFIGURATION -;; -------------------------------------- - -(add-hook 'rust-mode-hook 'cargo-minor-mode) -(add-hook 'flycheck-mode-hook #'flycheck-rust-setup) -(add-hook 'rust-mode-hook - (lambda () - (local-set-key (kbd "C-c ") #'rust-format-buffer))) - -(setq racer-cmd "~/.cargo/bin/racer") ;; Rustup binaries PATH -(setq racer-rust-src-path "~/gitshit/rust/src") ;; Rust source code PATH - -(add-hook 'rust-mode-hook #'racer-mode) -(add-hook 'racer-mode-hook #'eldoc-mode) -(add-hook 'racer-mode-hook #'company-mode) From b5b18d662191ce2aac2c55678e20ebb3d2a1ca79 Mon Sep 17 00:00:00 2001 From: jowj Date: Tue, 23 Apr 2019 15:58:57 -0500 Subject: [PATCH 3/3] Fix load path; remove setq from x-selection-timeout def. --- applicationConfiguration/.emacs/init.el | 9 ++++----- applicationConfiguration/.emacs/jlj-org.el | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/applicationConfiguration/.emacs/init.el b/applicationConfiguration/.emacs/init.el index 41e56ae..2777ef6 100644 --- a/applicationConfiguration/.emacs/init.el +++ b/applicationConfiguration/.emacs/init.el @@ -38,11 +38,10 @@ (package-install package))) myPackages) -(require - (jlj-misc.el) - (jlj-org.el) - (jlj-python.el) - (jlj-rust.el)) +(load "~/Documents/projects/agares/applicationConfiguration/.emacs/jlj-misc.el") +(load "~/Documents/projects/agares/applicationConfiguration/.emacs/jlj-org.el") +(load "~/Documents/projects/agares/applicationConfiguration/.emacs/jlj-python.el") +(load "~/Documents/projects/agares/applicationConfiguration/.emacs/jlj-rust.el") (custom-set-variables ;; custom-set-variables was added by Custom. diff --git a/applicationConfiguration/.emacs/jlj-org.el b/applicationConfiguration/.emacs/jlj-org.el index fc00f34..7990b65 100644 --- a/applicationConfiguration/.emacs/jlj-org.el +++ b/applicationConfiguration/.emacs/jlj-org.el @@ -8,7 +8,7 @@ org-src-strip-leading-and-trailing-blank-lines t org-src-preserve-indentation t org-src-tab-acts-natively t - setq x-selection-timeout 10 ;; this fixes a freeze when org-capture is called. lol. + x-selection-timeout 10 ;; this fixes a freeze when org-capture is called. lol. org-edit-src-content-indentation 0) (add-hook 'org-agenda-mode-hook