From e72ab96bd45528f1e37b9ba5606f3920a146abf7 Mon Sep 17 00:00:00 2001 From: Jack Foltz Date: Fri, 8 Feb 2019 20:27:15 -0500 Subject: [PATCH] Work on sandbox --- lain/.emacs.d/init.el | 17 - lain/.emacs.d/sandbox.org | 902 +++++++++++----------------------------------- 2 files changed, 216 insertions(+), 703 deletions(-) diff --git a/lain/.emacs.d/init.el b/lain/.emacs.d/init.el index 7a76739..b2a6314 100755 --- a/lain/.emacs.d/init.el +++ b/lain/.emacs.d/init.el @@ -1,22 +1,5 @@ - -;; Added by Package.el. This must come before configurations of -;; installed packages. Don't delete this line. If you don't want it, -;; just comment it out by adding a semicolon to the start of the line. -;; You may delete these explanatory comments. (package-initialize) (message "Initializing emacs...") (org-babel-load-file (expand-file-name "config.org" user-emacs-directory)) -(custom-set-variables - ;; custom-set-variables 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. - '(package-selected-packages (quote (evil org-bullets use-package)))) -(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. - ) diff --git a/lain/.emacs.d/sandbox.org b/lain/.emacs.d/sandbox.org index cba4b39..72ebb8f 100644 --- a/lain/.emacs.d/sandbox.org +++ b/lain/.emacs.d/sandbox.org @@ -13,7 +13,7 @@ (package-initialize) #+END_SRC ** use-package -[[https://github.com/jwiegley/use-package][use-package]] is a nifty macro that interfaces with ~Package.el~, keeping package-specific +[[https://github.com/jwiegley/use-package][use-package]] is a nifty macro that interfaces with =Package.el=, keeping package-specific configuration all in once place. It's pretty much the basis of this entire config. #+BEGIN_SRC emacs-lisp (unless (package-installed-p 'use-package) @@ -29,8 +29,8 @@ configuration all in once place. It's pretty much the basis of this entire confi (setq use-package-verbose t) #+END_SRC *** Custom Keywords -A few useful ~:keyword~ macros that extend the vanilla ~use-package~ functionality. -**** HelpersHH +A few useful =:keyword= macros that extend the vanilla =use-package= functionality. +**** Helpers Define some helpers for bootstrapping the custom keywords. #+BEGIN_SRC emacs-lisp (defun foltz-add-use-package-keyword (keyword deferring) @@ -92,144 +92,58 @@ Define some helpers for bootstrapping the custom keywords. (foltz-add-use-package-keyword :company nil) #+END_SRC -* Emacs -** Defaults -*** Customize -Make changes in ~M-x customize~ go somewhere other than being schlunked into =init.el=. -#+BEGIN_SRC emacs-lisp - (setq custom-file (concat user-emacs-directory "_customize.el")) - (load custom-file t) -#+END_SRC -*** Bell -Shut up, emacs. -#+BEGIN_SRC emacs-lisp - (setq ring-bell-function #'ignore) -#+END_SRC -*** Prompts -Make ~yes-or-no~ prompts ask for ~y-or-n~ instead. Saves loads of time™. -#+BEGIN_SRC emacs-lisp - (defalias 'yes-or-no-p #'y-or-n-p) -#+END_SRC -*** Backup Files -By default, emacs gunks up every folder with =file~= backups -and =#file#= lockfiles. Schlunk them all in =/tmp= instead. -#+BEGIN_SRC emacs-lisp - (setq backup-directory-alist - `((".*" . ,temporary-file-directory))) - (setq auto-save-file-name-transforms - `((".*" ,temporary-file-directory t))) -#+END_SRC -*** auth-source -GPG encrypt stored auth tokens from [[https://www.gnu.org/software/emacs/manual/html_mono/auth.html][auth-source]] instead of storing them in plaintext. -#+BEGIN_SRC emacs-lisp - (setq auth-sources '("~/.emacs.d/authinfo.gpg")) -#+END_SRC -** UI -*** Font -Engage a nice coding font. -#+BEGIN_SRC emacs-lisp - (add-to-list 'default-frame-alist '(font . "Fira Code 12")) - (set-face-attribute 'default t :font "Fira Code 12") -#+END_SRC -*** Menu Bar -Disable the useless cruft at the top of the screen. -#+BEGIN_SRC emacs-lisp - (menu-bar-mode -1) - (tool-bar-mode -1) - (scroll-bar-mode -1) -#+END_SRC -** Themes -*** pywal -Fancy dynamic color scheme generation from desktop wallpapers. -Requires additional setup on the machine itself. -#+BEGIN_SRC emacs-lisp - (defvar jf-theme-pywal-path "~/.cache/wal/colors.el" "Path to the colorscheme generated by pywal.") - - (defun jf-theme-pywal () - (load-file jf-theme-pywal-path)) - - (when (= 'jf-theme 'jf-theme-pywal) - (require 'filenotify) - (file-notify-add-watch jf-theme-pywal-path '(change) #'jf-theme-pywal)) -#+END_SRC -*** spacemacs -This theme is pretty fancy and has lots of supported modes. -#+BEGIN_SRC emacs-lisp - (unless (package-installed-p 'spacemacs-theme) - (package-install 'spacemacs-theme)) - - (defun jf-theme-spacemacs () - (load-theme 'spacemacs-dark)) -#+END_SRC -*** Helpers -#+BEGIN_SRC emacs-lisp - (defvar jf-theme #'jf-theme-pywal "Theme function to call.") - - (defun jf-apply-theme () - "Apply the current theme as set by jf-theme." - (funcall jf-theme)) - - (jf-apply-theme) -#+END_SRC * Keybinds -** General -[[https://github.com/noctuid/general.el][General]] is an excellent keybind manager that adds all kinds of -cool stuff like leader keys from Vim. -#+BEGIN_SRC emacs-lisp -(use-package general) -#+END_SRC ** which-key [[https://github.com/justbur/emacs-which-key][which-key]] displays a popup in the minibuffer that shows keybindings following incomplete commands. #+BEGIN_SRC emacs-lisp (use-package which-key - :diminish - :config - (which-key-mode)) + :diminish + :config + (which-key-mode)) +#+END_SRC +** General +[[https://github.com/noctuid/general.el][General]] is an excellent keybind manager that adds *tons* of useful macros. +#+BEGIN_SRC emacs-lisp + (use-package general) #+END_SRC ** Leaders -*** Helpers -Some helper functions to aid in defining leader keys and prefixes. +Create a leader key, =SPC=, like =\= in vim. +Different button presses after the leader bring you to different options. #+BEGIN_SRC emacs-lisp - (defvar jf-leader-keys - '(("b" . "buffers") - ("f" . "files") - ("g" . "git") - ("h" . "help") - ("o" . "org") - ("p" . "projects") - ("w" . "windows"))) - (general-create-definer jf-leader-def :keymaps 'override :states '(normal insert emacs) :prefix "SPC" - :non-normal-prefix "C-SPC") + :non-normal-prefix "M-SPC") - (dolist (def jf-leader-keys) - (let ((key (car def)) - (name (cdr def))) - (jf-leader-def key `('(:ignore t :wk ,(concat name "...")))) - (general-create-definer (intern (concat "jf-" name "-def")) - :keymaps 'override - :states '(normal insert emacs) - :prefix (concat "SPC " key) - :non-normal-prefix (concat "C-SPC " key) - :prefix-map (concat "jf-" key "-map")))) + (defmacro jf-create-definers (definitions) + "A wrapper for general-create-definer. + For every pair in DEFINITIONS, creates a leader + with name jf-NAME-def and keybind SPC KEY or M-SPC KEY in normal mode." + `(progn + ,@(mapcan + (lambda (def) + (let ((key (car def)) + (name (cdr def))) + `((general-create-definer ,(intern (concat "jf-" name "-def")) + :keymaps 'override + :states '(normal insert emacs) + :prefix ,(concat "SPC " key) + :non-normal-prefix ,(concat "M-SPC " key)) + (jf-leader-def ,key '(:ignore t :wk ,name))))) + definitions))) + + (jf-create-definers + (("b" . "buffers") + ("f" . "files") + ("g" . "git") + ("h" . "help") + ("o" . "org") + ("p" . "projects") + ("w" . "windows"))) #+END_SRC -*** Definitions -* Communication -* Web -* Tools -* Programming -** Checkers -** Completion -** Debugging -** Formatting -** Projects -** Tools -** Languages -* Vim +* Vim Emulation ** Evil [[https://github.com/emacs-evil/evil][Evil]] is pretty much the entirety of Vim in Emacs. #+BEGIN_SRC emacs-lisp @@ -289,24 +203,119 @@ doesn't cover properly by default. realgud which-key))) #+END_SRC -** Evil Leader -* --- Here Be Dragons --- -* Emacs Config -** Show matching parenthesis +** Evil Extensions +*** evil-surround +Use =S= and a delimiter to surround in visual mode. +#+BEGIN_SRC emacs-lisp +(use-package evil-surround + :after evil + :diminish + :config + (global-evil-surround-mode 1)) +#+END_SRC +* Emacs +** Defaults +*** Customize +Make changes in =M-x customize= go somewhere other than being schlunked into =init.el=. +#+BEGIN_SRC emacs-lisp + (setq custom-file (concat user-emacs-directory "_customize.el")) + (load custom-file t) +#+END_SRC +*** Bell +Shut up, emacs. +#+BEGIN_SRC emacs-lisp + (setq ring-bell-function #'ignore) +#+END_SRC +*** Prompts +Make =yes-or-no= prompts ask for =y-or-n= instead. Saves loads of time™. +#+BEGIN_SRC emacs-lisp + (defalias 'yes-or-no-p #'y-or-n-p) +#+END_SRC +*** Backup Files +By default, emacs gunks up every folder with =file~= backups +and =#file#= lockfiles. Schlunk them all in =/tmp= instead. +#+BEGIN_SRC emacs-lisp + (setq backup-directory-alist + `((".*" . ,temporary-file-directory))) + (setq auto-save-file-name-transforms + `((".*" ,temporary-file-directory t))) +#+END_SRC +*** Scrolling +#+BEGIN_SRC emacs-lisp +(setq scroll-conservatively 100) ;; don't scroll a metric boatload when bottom is hit +#+END_SRC + +*** auth-source +GPG encrypt stored auth tokens from [[https://www.gnu.org/software/emacs/manual/html_mono/auth.html][auth-source]] instead of storing them in plaintext. +#+BEGIN_SRC emacs-lisp + (setq auth-sources '("~/.emacs.d/authinfo.gpg")) +#+END_SRC +** UI +*** Font +Engage a nice coding font. +#+BEGIN_SRC emacs-lisp + (add-to-list 'default-frame-alist '(font . "Fira Code 12")) + (set-face-attribute 'default t :font "Fira Code 12") +#+END_SRC +*** Menu Bar +Disable the useless cruft at the top of the screen. +#+BEGIN_SRC emacs-lisp + (menu-bar-mode -1) + (tool-bar-mode -1) + (scroll-bar-mode -1) +#+END_SRC +*** Modeline +**** Diminish +Adds support for =:diminish= in use-package declarations, which hides a mode from the modeline. +#+BEGIN_SRC emacs-lisp +(use-package diminish) +#+END_SRC +**** Column Number +Show the column number in the modeline. +#+BEGIN_SRC emacs-lisp +(setq column-number-mode t) +#+END_SRC +*** Line Numbers +Use the default emacs relative line numbers, but switch to absolute lines when in insert mode. +#+BEGIN_SRC emacs-lisp + (use-package nlinum-relative + :config + (nlinum-relative-setup-evil) + :hook (prog-mode . nlinum-relative-mode)) +#+END_SRC + +*** Show Matching Parens Shows matching parenthesis #+BEGIN_SRC emacs-lisp (require 'paren) (setq show-paren-delay 0) (show-paren-mode) #+END_SRC - -** Show columns +** Themes +*** pywal +Fancy dynamic color scheme generation from desktop wallpapers. +Requires additional setup on the machine itself. #+BEGIN_SRC emacs-lisp -(setq column-number-mode t) + (defvar jf-theme-pywal-path "~/.cache/wal/colors.el" "Path to the colorscheme generated by pywal.") + + (defun jf-theme-pywal () + (load-file jf-theme-pywal-path)) + + (when (eq 'jf-theme 'jf-theme-pywal) + (require 'filenotify) + (file-notify-add-watch jf-theme-pywal-path '(change) #'jf-theme-pywal)) #+END_SRC - -** Transparency -Sets the window's transparency. +*** spacemacs +This theme is pretty fancy and has lots of supported modes. +#+BEGIN_SRC emacs-lisp + (unless (package-installed-p 'spacemacs-theme) + (package-install 'spacemacs-theme)) + + (defun jf-theme-spacemacs () + (load-theme 'spacemacs-dark)) +#+END_SRC +*** Transparency +Sets the window's transparency, to better admire choice wallpapers. The first number in the alpha section applies when the window is active, the second when it's inactive. #+BEGIN_SRC emacs-lisp @@ -314,466 +323,20 @@ active, the second when it's inactive. (add-to-list 'default-frame-alist '(alpha . 85)) #+END_SRC -** Scrolling +*** Helpers #+BEGIN_SRC emacs-lisp -(setq scroll-conservatively 100) ;; don't scroll a metric boatload when bottom is hit -#+END_SRC - -** Relative line numbers -Use the default emacs relative line numbers, but switch to absolute lines when in insert mode. -#+BEGIN_SRC emacs-lisp -(setq linum-format " %3d ") -(setq-default display-line-numbers 'relative - display-line-numbers-widen t - display-line-numbers-current-absolute t) - -(defun foltz-relative-numbers () - (setq-local display-line-numbers 'relative)) - -(defun foltz-absolute-numbers () - (setq-local display-line-numbers t)) - -(add-hook 'evil-insert-state-entry-hook #'foltz-absolute-numbers) -(add-hook 'evil-insert-state-exit-hook #'foltz-relative-numbers) - -(global-display-line-numbers-mode t) -#+END_SRC - -* General Packages Configuration -** Modeline cleanup -Adds support for =:diminish= in use-package declarations, -basically hides a mode from the modeline. -#+BEGIN_SRC emacs-lisp -(use-package diminish) -#+END_SRC - -** Keybind completion -Pops up a buffer that helps you navigate and complete commands -#+BEGIN_SRC emacs-lisp -(use-package which-key - :diminish - :config - (which-key-mode)) -#+END_SRC -** Keybind Manager -*** Leader definitions -Create a leader key, like the \ in vim. -In this case, =SPC= is used as a leader. Following the leader, -different buttons bring you to different options. -See [[https://github.com/noctuid/general.el#which-key-integration][here]] for which-key integration information - -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-leader-def - :keymaps 'override - :states 'normal - :prefix "SPC" - "m" '(:ignore t :which-key "major-mode...") - "o" '(:ignore t :which-key "org-mode...") - "p" '(:ignore t :which-key "projectile-mode...") - "g" '(:ignore t :which-key "git...") - "h" '(:ignore t :which-key "help...") - "b" '(:ignore t :which-key "buffer...") - "w" '(:ignore t :which-key "window...") - "f" '(:ignore t :which-key "file...")) -#+END_SRC - -**** m - major-modes -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-major-def - :states 'normal - :prefix "SPC m") -#+END_SRC - -**** o - org-mode -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-org-def - :keymaps 'override - :states -'normal - :prefix "SPC o") -#+END_SRC - -**** p - projectile-mode -Since we will be binding the entire projectile-mode -keymap to this, we don't actually need a definer. -**** g - git -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-git-def - :states 'normal - :keymaps 'override - :prefix "SPC g") -#+END_SRC - -**** h - help -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-help-def - :states 'normal - :keymaps 'override - :prefix "SPC h") - -(foltz-help-def - "?" 'help-for-help - "h" 'help-for-help - "k" 'describe-key - "m" 'describe-mode) -#+END_SRC - -**** b - buffer -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-buffer-def - :states 'normal - :keymaps 'override - :prefix "SPC b") - -(foltz-buffer-def - "i" 'ibuffer) -#+END_SRC - -**** w - window -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-window-def - :states 'normal - :keymaps 'override - :prefix "SPC w") - -(foltz-window-def - "o" 'delete-other-windows) -#+END_SRC - -**** f - file -#+BEGIN_SRC emacs-lisp -(general-create-definer foltz-file-def - :states 'normal - :keymaps 'override - :prefix "SPC f") - -(defun foltz-config-visit () - (interactive) - (find-file (concat user-emacs-directory "config.org"))) - -(defun foltz-config-reload () - (interactive) - (org-babel-load-file - (expand-file-name "config.org" user-emacs-directory))) - -(foltz-file-def - "w" 'save-buffer - "r" 'revert-buffer - "e" '(:ignore t :which-key "emacs files") - "e e" 'foltz-config-visit - "e r" 'foltz-config-reload) -#+END_SRC - -** Vim -Evil is pretty much the entirety of Vim in Emacs. -[[https://github.com/Somelauw/evil-org-mode][evil-org]] adds nice bindings to org-mode. - -#+BEGIN_SRC emacs-lisp - (use-package evil-leader - :after evil - :init - - :general - (:keymaps 'override - :states 'normal - "U" 'undo-tree-visualize) - (foltz-window-def - "-" 'foltz-window-split - "=" 'foltz-window-vsplit - "h" 'evil-window-left - "j" 'evil-window-down - "k" 'evil-window-up - "l" 'evil-window-right - "H" 'evil-window-far-left - "J" 'evil-window-move-very-bottom - "K" 'evil-window-move-very-top - "L" 'evil-window-far-right - "<" 'evil-window-decrease-width - ">" 'evil-window-increase-width - "^" 'evil-window-decrease-height - "%" 'evil-window-increase-height - "n" 'evil-window-new - "c" 'evil-window-delete - "w" 'evil-window-next - "W" 'evil-window-prev - "r" 'evil-window-rotate-downwards - "|" 'evil-window-set-width - "_" 'evil-window-set-height) - - :config - (global-evil-leader-mode)) - - (use-package evil-org - :after (evil org) - :hook (org-mode . evil-org-mode) - :config - (add-hook 'evil-org-mode (lambda () - (evil-org-set-key-theme - '(textobjects insert navigation - additional shift todo calendar))))) -#+END_SRC - -** Startup dashboard -Show a cool custom buffer on startup -#+BEGIN_SRC emacs-lisp -(use-package dashboard - :diminish page-break-lines-mode - - :config - (dashboard-setup-startup-hook) - (setq initial-buffer-choice (lambda () - (if (get-buffer "*scratch*") - (kill-buffer "*scratch*")) - (get-buffer "*dashboard*"))) - - :custom - (dashboard-startup-banner 'logo) - (dashboard-banner-logo-title "Welcome to Electronic Macs") - (dashboard-items - '((recents . 5) - (agenda) - (bookmarks . 5) - (registers . 5)))) -#+END_SRC - -** Folder tree -A cool toggleable directory structure sidebar -It also needs icon fonts, installed with =M-x all-the-icons-install-fonts= -#+BEGIN_SRC emacs-lisp -(use-package all-the-icons) -(use-package neotree - :after all-the-icons - :commands neotree-toggle - :general - (:keymaps 'neotree-mode-map - :states 'normal - "RET" 'neotree-enter - "TAB" 'neotree-quick-look - "q" 'neotree-hide - "g" 'neotree-refresh - "A" 'neotree-stretch-toggle - "H" 'neotree-hidden-file-toggle) - (foltz-leader-def - :states 'normal - "t" 'neotree-toggle) - :custom - (neo-theme (if (display-graphic-p) 'icons 'arrow))) -#+END_SRC -** Organization -*** Capture Templates -All of my capture templates, from tasks to bookmarks. -**** Refile Targets -Goodize the refiling targets to allow moving to subtrees -#+BEGIN_SRC emacs-lisp -(defun foltz-org-capture-refile () - (interactive) - (setq-local org-refile-targets '((nil :maxlevel . 5))) - (setq-local org-refile-use-outline-path t) - (org-refile)) -#+END_SRC - -**** Tasks -#+BEGIN_SRC emacs-lisp -(setq foltz-org-capture-task-templates - '(("t" "Todo") - ("tg" "General" entry - (file+headline "notes.org" "Todo") - "** TODO %^{todo}\nNotes: %?\n") - ("tt" "General (Date)" entry - (file+olp+datetree "notes.org") - "*** TODO %^{todo}\nDue: %^t\nNotes: %?\n") - ("tT" "General (Date+Time)" entry - (file+olp+datetree "notes.org") - "*** TODO %^{todo}\nDue: %^T\nNotes: %?\n") - ("ts" "School (Date)" entry - (file+olp+datetree "notes.org") - "*** TODO %^{todo}\nDue: %^t\nClass: %^{class}\nNotes: %?\n") - ("tS" "School (Date+Time)" entry - (file+olp+datetree "notes.org") - "*** TODO %^{todo}\nDue: %^T\nClass: %^{class}\nNotes: %?\n"))) -#+END_SRC - -**** Bookmarks -#+BEGIN_SRC emacs-lisp -(setq foltz-org-capture-bookmark-templates - '(("b" "Bookmark" entry - (file+headline "links.org" "Unsorted Links") - "** [[%^{link}][%^{name}]]\nCreated: %U\nAbout: %^{description}%?\n"))) -#+END_SRC - -**** Personal -#+BEGIN_SRC emacs-lisp -(setq foltz-org-capture-personal-templates - '(("j" "Journal") - ("jj" "Journal Entry" entry - (file+olp+datetree "journal.org") - "**** Today's Events\n%?") - ("jt" "Thoughts" entry - (file+headline "notes.org" "Thoughts") - "** %^{summary}\n%U\n%?") - ("jd" "Dream Journal Entry" entry - (file+olp+datetree "dreams.org") - "**** Dream\n%?"))) -#+END_SRC - -**** Protocol -#+BEGIN_SRC emacs-lisp -(setq foltz-org-capture-protocol-templates - '(("w" "Website" entry - (file+headline "sites.org" "Unsorted Sites") - "** [[%:link][%:description%?]]\nCreated: %U\nAbout: %^{description}%?\n%:initial"))) -#+END_SRC - -**** All -Tie it all together. -#+BEGIN_SRC emacs-lisp -(setq foltz-org-capture-templates - (append - foltz-org-capture-task-templates - foltz-org-capture-personal-templates - foltz-org-capture-bookmark-templates - foltz-org-capture-protocol-templates)) -#+END_SRC - -*** Structure Templates -Defines expansions with =<= followed by a string in org-mode. -**** Source Blocks -#+BEGIN_SRC emacs-lisp -(setq foltz-org-source-structure-templates '( - ("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC"))) -#+END_SRC - -**** All -Tie it all together. -#+BEGIN_SRC emacs-lisp -(setq foltz-org-structure-templates - (append - foltz-org-source-structure-templates)) -#+END_SRC - -*** Org-mode -Keep org-mode up to date straight from the cow's utters. -If the manual is not on your computer, it's [[https://orgmode.org/manual/][here]]. -#+BEGIN_SRC emacs-lisp -(use-package org - :pin org - :mode ("\\.org\\'" . org-mode) - :hook ((org-mode . org-indent-mode) - (org-capture-mode . evil-insert-state)) - - :general - (foltz-major-def - :keymaps 'org-mode-map - "e" 'org-export-dispatch - "a" 'org-attach) - (foltz-org-def - "a" 'org-agenda - "c" 'org-capture - "l" 'org-store-link - "b" 'org-switchb - "r" 'foltz-org-capture-refile) - - :custom - (org-directory "~/Documents/org") - (org-agenda-files '("~/Documents/org/")) - (org-default-notes-file "notes.org") - (org-agenda-include-diary t) - (org-src-window-setup 'current-window "Edit source code in the current window") - (org-src-fontify-natively t "Highlight syntax in source blocks") - (org-latex-to-pdf-process '("latexmk -f pdf %f") "Use pdflatex for export") - (org-capture-templates foltz-org-capture-templates) - (org-structure-template-alist (append org-structure-template-alist foltz-org-structure-templates))) -#+END_SRC - -*** Pretty org-mode bullets -Make bullets look choice -#+BEGIN_SRC emacs-lisp -(use-package org-bullets - :hook (org-mode . org-bullets-mode)) -#+END_SRC - -** Fuzzy Matching -Ivy, swiper, and counsel all provide fuzzy-matching on different -emacs operations. -#+BEGIN_SRC emacs-lisp -(use-package ivy - :init - ; Define some functions to bind to - (defun foltz-kill-curr-buffer () - (interactive) - (kill-buffer (current-buffer))) - (defun foltz-kill-all-buffers () - (interactive) - (mapc 'kill-buffer (buffer-list))) - - :general - (foltz-buffer-def - "b" 'ivy-switch-buffer - "v" 'ivy-push-view - "V" 'ivy-pop-view - "c" 'foltz-kill-curr-buffer - "C" 'foltz-kill-all-buffers) - (:keymaps 'org-capture-mode-map - :states 'normal - "C-c C-w" 'foltz-org-capture-refile) - - :custom - (ivy-use-virtual-buffers t) - (ivy-count-format "%d/%d")) - -(use-package swiper - :after evil - :general - (:keymaps 'override - :states 'normal - "/" 'swiper - "n" 'evil-search-previous - "N" 'evil-search-next)) - -(use-package counsel - :general - ("M-x" 'counsel-M-x) - (foltz-leader-def - :states 'normal - "x" 'counsel-M-x) - (foltz-file-def - "f" 'counsel-find-file) - (foltz-help-def - "k" 'counsel-descbinds - "f" 'counsel-describe-function - "v" 'counsel-describe-variable - "l" 'counsel-find-library - "a" 'counsel-apropos - "s" 'counsel-info-lookup-symbol - "u" 'counsel-unicode-char)) -#+END_SRC - -** Avy -Hotkeys for jumping to characters with =f= -#+BEGIN_SRC emacs-lisp -(use-package avy - :general - (:keymaps 'override - :states 'normal - "C-f" 'avy-goto-char-in-line - "C-F" 'avy-goto-char)) -#+END_SRC -** Discord Rich Presence -#+BEGIN_SRC emacs-lisp -(use-package elcord - :commands elcord-mode - :general - (foltz-major-def - :keymaps 'prog-mode-map - "d" #'elcord-mode)) -#+END_SRC -* Programming Packages Configuration -** General Configuration -Everything the light touches is prog-mode's kingdom. -#+BEGIN_SRC emacs-lisp -; Default to 4 space indent -(add-hook 'prog-mode-hook #'foltz-indent-4-spaces) + (defvar jf-theme #'jf-theme-pywal "Theme function to call.") + + (defun jf-apply-theme () + "Apply the current theme as set by jf-theme." + (funcall jf-theme)) + + (jf-apply-theme) #+END_SRC +* Communication +* Web +* Tools +* Programming ** Formatting *** Indentation Set some *sane* defaults @@ -792,7 +355,7 @@ Define some *useful* helper functions (defun foltz-indent-tabs () (interactive) (setq tab-width foltz-tab-width) - (local-set-key (kbd "TAB") 'tab'to-tab-stop) + (local-set-key (kbd "") 'tab'to-tab-stop) (setq indent-tabs-mode t)) (defun foltz-indent-spaces (num-spaces) @@ -817,25 +380,6 @@ Define some *useful* helper functions (add-hook 'prog-mode-hook #'whitespace-mode) #+END_SRC -*** Company -company auto-completes stuff in the buffer, -company-quickhelp shows documentation popups -when idling on a completion candidate. -#+BEGIN_SRC emacs-lisp -(use-package company - :defer t - :hook ((prog-mode cdlatex-mode) . company-mode) - :general - (:keymaps 'company-active-map - "C-SPC" 'company-abort) - :custom - (company-maximum-prefix-length 2) - (company-idle-delay 0.2 "Decrease idle delay")) - -(use-package company-quickhelp - :after company - :hook (company-mode . company-quickhelp-mode)) -#+END_SRC *** Smart Parentheses smartparens handles parens for languages that aren't lispy, and paredit handles the rest. @@ -869,15 +413,6 @@ current major mode when entering any prog-mode. (add-hook 'prog-mode-hook #'foltz-paren-mode) #+END_SRC -*** evil-surround -Use =S= and a delimiter to surround in visual mode. -#+BEGIN_SRC emacs-lisp -(use-package evil-surround - :after evil - :diminish - :config - (global-evil-surround-mode 1)) -#+END_SRC *** ws-butler Unobtrusively cleans up whitespace before EOLs as you edit, stopping the noisy commits generated @@ -886,7 +421,6 @@ from blanket trimming entire files. (use-package ws-butler :hook (prog-mode . ws-butler-mode)) #+END_SRC -** Prettification *** pretty-mode [[https://github.com/pretty-mode/pretty-mode][Redisplay parts of the Emacs buffer as pretty symbols.]] #+BEGIN_SRC emacs-lisp @@ -921,7 +455,58 @@ Built into emacs since 24.1 ("False" . #x1d53d))))) #+END_SRC -** Debugging and Disassembly +*** Column 80 Highlight +Add a hotkey for highlighting column 80 +and activate it in =prog-mode= +#+BEGIN_SRC emacs-lisp +(use-package fill-column-indicator + :init + (setq fci-rule-use-dashes t) + (setq fci-rule-column 80) + :general) +#+END_SRC + +** Checkers +*** Flycheck +Flycheck does syntax highlighting in a few languages +#+BEGIN_SRC emacs-lisp +(use-package flycheck + :hook (prog-mode . flycheck-mode)) +#+END_SRC +** Completion +*** Company +company auto-completes stuff in the buffer, +company-quickhelp shows documentation popups +when idling on a completion candidate. +#+BEGIN_SRC emacs-lisp +(use-package company + :defer t + :hook ((prog-mode cdlatex-mode) . company-mode) + :general + (:keymaps 'company-active-map + "C-SPC" 'company-abort) + :custom + (company-maximum-prefix-length 2) + (company-idle-delay 0.2 "Decrease idle delay")) + +(use-package company-quickhelp + :after company + :hook (company-mode . company-quickhelp-mode)) +#+END_SRC +** Snippets +Yasnippet adds support for custom snippets +#+BEGIN_SRC emacs-lisp +(use-package yasnippet + :commands yas-minor-mode + :hook (prog-mode . yas-minor-mode) + :custom + (yas-snippet-dirs + '("~/.emacs.d/snippets" + "~/.emacs.d/elpa/yasnippet-snippets-0.6/snippets"))) +;;;(use-package yasnippet-snippets) +#+END_SRC + +** Debugging *** Realgud [[https://github.com/realgud/realgud][Realgud]] is a modular frontend for many debuggers #+BEGIN_SRC emacs-lisp @@ -938,53 +523,13 @@ Built into emacs since 24.1 (use-package rmsbolt :commands rmsbolt-mode) #+END_SRC -** Syntax checking -*** Flycheck -Flycheck does syntax highlighting in a few languages -#+BEGIN_SRC emacs-lisp -(use-package flycheck - :hook (prog-mode . flycheck-mode)) -#+END_SRC - -*** Column 80 Highlight -Add a hotkey for highlighting column 80 -and activate it in =prog-mode= -#+BEGIN_SRC emacs-lisp -(use-package fill-column-indicator - :init - (setq fci-rule-use-dashes t) - (setq fci-rule-column 80) - :general - (foltz-major-def - :keymaps 'prog-mode-map - "l" 'fci-mode - "f" 'toggle-truncate-lines)) -#+END_SRC - -** Snippets -Yasnippet adds support for custom snippets -#+BEGIN_SRC emacs-lisp -(use-package yasnippet - :commands yas-minor-mode - :hook (prog-mode . yas-minor-mode) - :custom - (yas-snippet-dirs - '("~/.emacs.d/snippets" - "~/.emacs.d/elpa/yasnippet-snippets-0.6/snippets"))) -;;;(use-package yasnippet-snippets) -#+END_SRC - ** Git *** magit It's magic git! Keybinds [[https://github.com/emacs-evil/evil-magit][here]] #+BEGIN_SRC emacs-lisp (use-package magit - :general - (foltz-git-def - "s" 'magit-status - "d" 'magit-diff - "g" 'magit-grep)) + :general) #+END_SRC It's *evil* magic git! #+BEGIN_SRC emacs-lisp @@ -1040,13 +585,11 @@ make shortcuts and file switching :general (:keymaps 'projectile-command-map "t" 'foltz-projectile-neotree) - (foltz-leader-def - :states 'normal - "p" '(:keymap projectile-command-map)) :custom (projectile-completion-system 'ivy) (projectile-project-search-path '("~/Documents/dev"))) #+END_SRC +** Tools ** Languages *** Fish Beter editing of scripts for the fish shell @@ -1123,9 +666,6 @@ company-auctex for completion. :defer t :ensure auctex :general - (foltz-major-def - :keymaps 'TeX-mode-map - "e" 'TeX-command-run-all) :custom (TeX-auto-save t)) @@ -1165,10 +705,7 @@ cdlatex adds better TeX-specific template expansions and other niceties. #+BEGIN_SRC emacs-lisp (use-package rust-mode :mode "\\.rs\\'" - :general - (foltz-major-def - :keymaps 'rust-mode-map - "TAB" 'rust-format-buffer)) + :general) (use-package flycheck-rust :hook (rust-mode . flycheck-rust-setup)) @@ -1182,12 +719,7 @@ cdlatex adds better TeX-specific template expansions and other niceties. (use-package cargo :hook (rust-mode . cargo-minor-mode) - :general - (foltz-major-def - :keymaps 'rust-mode-map - "b" 'cargo-process-build - "r" 'cargo-process-run - "t" 'cargo-process-test)) + :general) #+END_SRC *** C/C++ **** Irony @@ -1211,8 +743,6 @@ company-irony for company integration #+END_SRC **** Hotkeys #+BEGIN_SRC emacs-lisp -(foltz-major-def - :keymaps '(c++-mode-map c-mode-map) - "r" 'rmsbolt-mode - "c" 'rmsbolt-compile) #+END_SRC +* --- Here Be Dragons --- +* Emacs Config