General refactor, cleanup & commenting
This commit is contained in:
parent
8707a80c2b
commit
e265431507
12 changed files with 251 additions and 241 deletions
|
@ -17,7 +17,7 @@
|
||||||
(message "Column %d" (current-column)))
|
(message "Column %d" (current-column)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/what-bindings (key)
|
(defun doom-what-bindings (key)
|
||||||
(list
|
(list
|
||||||
(minor-mode-key-binding key)
|
(minor-mode-key-binding key)
|
||||||
(local-key-binding key)
|
(local-key-binding key)
|
||||||
|
|
|
@ -515,6 +515,7 @@ your emacs configuration (init.el and core/**/*.el)."
|
||||||
(defun doom/clean-cache ()
|
(defun doom/clean-cache ()
|
||||||
"Clear local cache (`doom-cache-dir'). You may need to restart Emacs for some
|
"Clear local cache (`doom-cache-dir'). You may need to restart Emacs for some
|
||||||
components to feel its effects."
|
components to feel its effects."
|
||||||
|
(interactive)
|
||||||
(delete-directory doom-cache-dir t)
|
(delete-directory doom-cache-dir t)
|
||||||
(make-directory doom-cache-dir t))
|
(make-directory doom-cache-dir t))
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,11 @@ limit to buffers in the current workspace."
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +ivy*counsel-ag-function (string base-cmd extra-ag-args)
|
(defun +ivy*counsel-ag-function (string base-cmd extra-ag-args)
|
||||||
"Advice to 1) get rid of the character limit from `counsel-ag-function' and 2)
|
"Advice to 1) get rid of the character limit from `counsel-ag-function' and 2)
|
||||||
disable ivy's over-zealous parentheses quoting behavior, both of which
|
disable ivy's over-zealous parentheses quoting behavior (if i want literal
|
||||||
interferes with my custom :[ar]g ex command `+ivy:file-search'."
|
parentheses, I'll escape them myself).
|
||||||
|
|
||||||
|
NOTE This may need to be updated frequently, to meet changes upstream (in
|
||||||
|
counsel-rg)."
|
||||||
(when (null extra-ag-args)
|
(when (null extra-ag-args)
|
||||||
(setq extra-ag-args ""))
|
(setq extra-ag-args ""))
|
||||||
(if (< (length string) 1) ;; #1
|
(if (< (length string) 1) ;; #1
|
||||||
|
|
|
@ -57,7 +57,10 @@ session)."
|
||||||
[remap projectile-switch-project] #'counsel-projectile-switch-project
|
[remap projectile-switch-project] #'counsel-projectile-switch-project
|
||||||
[remap projectile-find-file] #'counsel-projectile-find-file
|
[remap projectile-find-file] #'counsel-projectile-find-file
|
||||||
[remap imenu-anywhere] #'ivy-imenu-anywhere
|
[remap imenu-anywhere] #'ivy-imenu-anywhere
|
||||||
[remap execute-extended-command] #'counsel-M-x)
|
[remap execute-extended-command] #'counsel-M-x
|
||||||
|
[remap describe-function] #'counsel-describe-function
|
||||||
|
[remap describe-variable] #'counsel-describe-variable
|
||||||
|
[remap describe-face] #'counsel-describe-face)
|
||||||
|
|
||||||
(when (featurep! :feature workspaces)
|
(when (featurep! :feature workspaces)
|
||||||
(nconc ivy-sort-functions-alist
|
(nconc ivy-sort-functions-alist
|
||||||
|
|
|
@ -52,9 +52,9 @@
|
||||||
|
|
||||||
;; Set cursor colors later, presumably once theme is loaded
|
;; Set cursor colors later, presumably once theme is loaded
|
||||||
(defun +evil*init-cursors (&rest _)
|
(defun +evil*init-cursors (&rest _)
|
||||||
(setq evil-default-cursor (face-attribute 'cursor :background nil t)
|
(setq evil-default-cursor (face-background 'cursor nil t)
|
||||||
evil-normal-state-cursor 'box
|
evil-normal-state-cursor 'box
|
||||||
evil-emacs-state-cursor `(,(face-attribute 'warning :foreground nil nil) box)
|
evil-emacs-state-cursor `(,(face-foreground 'warning) box)
|
||||||
evil-insert-state-cursor 'bar
|
evil-insert-state-cursor 'bar
|
||||||
evil-visual-state-cursor 'hollow))
|
evil-visual-state-cursor 'hollow))
|
||||||
(advice-add #'load-theme :after #'+evil*init-cursors)
|
(advice-add #'load-theme :after #'+evil*init-cursors)
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
:config
|
:config
|
||||||
(set! :company-backend 'csharp-mode '(company-omnisharp))
|
(set! :company-backend 'csharp-mode '(company-omnisharp))
|
||||||
|
|
||||||
;; Map all refactor commands (see emr)
|
|
||||||
(map! :map omnisharp-mode-map
|
(map! :map omnisharp-mode-map
|
||||||
:m "gd" #'omnisharp-go-to-definition
|
:m "gd" #'omnisharp-go-to-definition
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@
|
||||||
org-adapt-indentation nil
|
org-adapt-indentation nil
|
||||||
org-cycle-separator-lines 1
|
org-cycle-separator-lines 1
|
||||||
org-cycle-include-plain-lists t
|
org-cycle-include-plain-lists t
|
||||||
org-ellipsis " "
|
;; org-ellipsis " "
|
||||||
org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭")
|
org-entities-user '(("flat" "\\flat" nil "" "" "266D" "♭")
|
||||||
("sharp" "\\sharp" nil "" "" "266F" "♯"))
|
("sharp" "\\sharp" nil "" "" "266F" "♯"))
|
||||||
org-fontify-done-headline t
|
org-fontify-done-headline t
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
;;; private/hlissner/+bindings.el
|
;;; private/hlissner/+bindings.el
|
||||||
|
|
||||||
;; I've switched these keys on my keyboard
|
;; I've swapped these keys on my keyboard
|
||||||
(setq x-super-keysym 'alt
|
(setq x-super-keysym 'alt
|
||||||
x-alt-keysym 'meta)
|
x-alt-keysym 'meta)
|
||||||
|
|
||||||
(defmacro find-file-in! (path &optional project-p)
|
(defmacro find-file-in! (path &optional project-p)
|
||||||
"Returns a interactive function for searching files"
|
"Returns an interactive function for searching files"
|
||||||
`(lambda () (interactive)
|
`(lambda () (interactive)
|
||||||
(let ((default-directory ,path))
|
(let ((default-directory ,path))
|
||||||
(call-interactively
|
(call-interactively
|
||||||
|
@ -13,42 +13,42 @@
|
||||||
(if project-p 'projectile-find-file) 'find-file)))))
|
(if project-p 'projectile-find-file) 'find-file)))))
|
||||||
|
|
||||||
(map!
|
(map!
|
||||||
[remap evil-jump-to-tag] 'projectile-find-tag
|
[remap evil-jump-to-tag] #'projectile-find-tag
|
||||||
[remap find-tag] 'projectile-find-tag)
|
[remap find-tag] #'projectile-find-tag)
|
||||||
|
|
||||||
(map!
|
(map!
|
||||||
;; Essential
|
;; Essential
|
||||||
"M-x" 'execute-extended-command
|
"M-x" #'execute-extended-command
|
||||||
"A-x" 'execute-extended-command
|
"A-x" #'execute-extended-command
|
||||||
"M-;" 'eval-expression
|
"M-;" #'eval-expression
|
||||||
"A-;" 'eval-expression
|
"A-;" #'eval-expression
|
||||||
;; Tools
|
;; Tools
|
||||||
[f9] 'doom/what-face
|
[f9] #'doom/what-face
|
||||||
[f10] 'doom/blink-cursor
|
[f10] #'doom/blink-cursor
|
||||||
"C-`" 'doom/popup-toggle
|
"C-`" #'doom/popup-toggle
|
||||||
;; Text-scaling
|
;; Text-scaling
|
||||||
"M-0" (λ! (text-scale-set 0))
|
"M-0" (λ! (text-scale-set 0))
|
||||||
"M-=" 'text-scale-increase
|
"M-=" #'text-scale-increase
|
||||||
"M--" 'text-scale-decrease
|
"M--" #'text-scale-decrease
|
||||||
;; Simple window navigation/manipulation
|
;; Simple window navigation/manipulation
|
||||||
"M-t" '+workspace/new
|
"M-t" #'+workspace/new
|
||||||
"M-T" '+workspace/display
|
"M-T" #'+workspace/display
|
||||||
"M-w" 'delete-window
|
"M-w" #'delete-window
|
||||||
"M-W" 'delete-frame
|
"M-W" #'delete-frame
|
||||||
"M-n" 'evil-buffer-new
|
"M-n" #'evil-buffer-new
|
||||||
"M-N" 'make-frame
|
"M-N" #'make-frame
|
||||||
"C-j" 'evil-window-down
|
"C-j" #'evil-window-down
|
||||||
"C-k" 'evil-window-up
|
"C-k" #'evil-window-up
|
||||||
"C-h" 'evil-window-left
|
"C-h" #'evil-window-left
|
||||||
"C-l" 'evil-window-right
|
"C-l" #'evil-window-right
|
||||||
;; Basic escape keys for emacs mode
|
;; Basic escape keys for emacs mode
|
||||||
:e "C-h" 'evil-window-left
|
:e "C-h" #'evil-window-left
|
||||||
:e "C-j" 'evil-window-down
|
:e "C-j" #'evil-window-down
|
||||||
:e "C-k" 'evil-window-up
|
:e "C-k" #'evil-window-up
|
||||||
:e "C-l" 'evil-window-right
|
:e "C-l" #'evil-window-right
|
||||||
;; Temporary escape into emacs mode
|
;; Temporary escape into emacs mode
|
||||||
:e [C-escape] 'evil-normal-state
|
:e [C-escape] #'evil-normal-state
|
||||||
:n [C-escape] 'evil-emacs-state
|
:n [C-escape] #'evil-emacs-state
|
||||||
;; Switching tabs (workspaces)
|
;; Switching tabs (workspaces)
|
||||||
"M-1" (λ! (+workspace/switch-to 0))
|
"M-1" (λ! (+workspace/switch-to 0))
|
||||||
"M-2" (λ! (+workspace/switch-to 1))
|
"M-2" (λ! (+workspace/switch-to 1))
|
||||||
|
@ -59,127 +59,128 @@
|
||||||
"M-7" (λ! (+workspace/switch-to 6))
|
"M-7" (λ! (+workspace/switch-to 6))
|
||||||
"M-8" (λ! (+workspace/switch-to 7))
|
"M-8" (λ! (+workspace/switch-to 7))
|
||||||
"M-9" (λ! (+workspace/switch-to 8))
|
"M-9" (λ! (+workspace/switch-to 8))
|
||||||
"M-0" '+workspace/switch-to-last
|
"M-0" #'+workspace/switch-to-last
|
||||||
|
|
||||||
"M-r" '+eval/buffer
|
"M-r" #'+eval/buffer
|
||||||
"M-b" '+eval/build
|
"M-b" #'+eval/build
|
||||||
|
|
||||||
[M-backspace] 'doom/backward-kill-to-bol-and-indent
|
[M-backspace] #'doom/backward-kill-to-bol-and-indent
|
||||||
"M-a" 'mark-whole-buffer
|
"M-a" #'mark-whole-buffer
|
||||||
"M-c" 'evil-yank
|
"M-c" #'evil-yank
|
||||||
"M-q" 'save-buffers-kill-emacs
|
"M-q" #'save-buffers-kill-emacs
|
||||||
"M-s" 'save-buffer
|
"M-s" #'save-buffer
|
||||||
"M-v" 'clipboard-yank
|
"M-v" #'clipboard-yank
|
||||||
"C-M-f" 'doom/toggle-fullscreen
|
"M-f" #'+ivy:swiper
|
||||||
:m "A-j" '+hlissner:multi-next-line
|
"C-M-f" #'doom/toggle-fullscreen
|
||||||
:m "A-k" '+hlissner:multi-previous-line
|
:m "A-j" #'+hlissner:multi-next-line
|
||||||
|
:m "A-k" #'+hlissner:multi-previous-line
|
||||||
|
|
||||||
;;; <leader> and <localleader>
|
;;; <leader> and <localleader>
|
||||||
:m ";" 'evil-ex
|
:m ";" 'evil-ex
|
||||||
(:leader
|
(:leader
|
||||||
;; common
|
;; common
|
||||||
:desc "Switch project buffer" :n "," 'persp-switch-to-buffer
|
:desc "Switch project buffer" :n "," #'persp-switch-to-buffer
|
||||||
:desc "Switch buffer" :n "<" 'switch-to-buffer
|
:desc "Switch buffer" :n "<" #'switch-to-buffer
|
||||||
:desc "Browse files" :n "." 'find-file
|
:desc "Browse files" :n "." #'find-file
|
||||||
:desc "Find file from here" :n ">" 'counsel-file-jump
|
:desc "Find file from here" :n ">" #'counsel-file-jump
|
||||||
:desc "Find file in project" :n "/" 'projectile-find-file
|
:desc "Find file in project" :n "/" #'projectile-find-file
|
||||||
:desc "Find in file (swiper)" :n "?" 'swiper
|
:desc "Find in file (swiper)" :n "?" #'swiper
|
||||||
:desc "Imenu" :n ";" 'imenu
|
:desc "Imenu" :n ";" #'imenu
|
||||||
:desc "Imenu across buffers" :n ":" 'imenu-anywhere
|
:desc "Imenu across buffers" :n ":" #'imenu-anywhere
|
||||||
:desc "Find other file" :n "a" 'projectile-find-other-file
|
:desc "Find other file" :n "a" #'projectile-find-other-file
|
||||||
:desc "Jump to bookmark" :n "b" 'bookmark-jump
|
:desc "Jump to bookmark" :n "b" #'bookmark-jump
|
||||||
:desc "Delete bookmark" :n "B" 'bookmark-delete
|
:desc "Delete bookmark" :n "B" #'bookmark-delete
|
||||||
:desc "List errors" :n "e" 'flycheck-list-errors
|
:desc "List errors" :n "e" #'flycheck-list-errors
|
||||||
:desc "View Emacs Log" :n "m" 'view-echo-area-messages
|
:desc "View Emacs Log" :n "m" #'view-echo-area-messages
|
||||||
:desc "Recent files" :n "r" 'recentf
|
:desc "Recent files" :n "r" #'recentf
|
||||||
:desc "Recent project files" :n "R" 'projectile-recentf
|
:desc "Recent project files" :n "R" #'projectile-recentf
|
||||||
:desc "Open file explorer" :n "n" '+evil/neotree
|
:desc "Open file explorer" :n "n" #'+evil/neotree
|
||||||
:desc "Insert from kill ring" :n "y" 'counsel-yank-pop
|
:desc "Insert from kill ring" :n "y" #'counsel-yank-pop
|
||||||
:desc "Switch project" :n "p" 'projectile-switch-project
|
:desc "Switch project" :n "p" #'projectile-switch-project
|
||||||
:desc "Find snippet for mode" :n "s" 'yas-visit-snippet-file
|
:desc "Find snippet for mode" :n "s" #'yas-visit-snippet-file
|
||||||
:desc "Find snippet" :n "S" '+hlissner/find-in-snippets
|
:desc "Find snippet" :n "S" #'+hlissner/find-in-snippets
|
||||||
:desc "Execute in Emacs mode" :n "\\" 'evil-execute-in-emacs-state
|
:desc "Execute in Emacs mode" :n "\\" #'evil-execute-in-emacs-state
|
||||||
:desc "Switch to Emacs mode" :n "|" 'evil-emacs-state
|
:desc "Switch to Emacs mode" :n "|" #'evil-emacs-state
|
||||||
;; Since I've remapped C-h...
|
;; Since I've remapped C-h...
|
||||||
:desc "Help" :n "h" 'help-command
|
:desc "Help" :n "h" #'help-command
|
||||||
|
|
||||||
(:desc "Session/Workspace"
|
(:desc "Session/Workspace"
|
||||||
:prefix "w"
|
:prefix "w"
|
||||||
:desc "Load last session" :n "l" (λ! (+workspace/load-session))
|
:desc "Load last session" :n "l" (λ! (+workspace/load-session))
|
||||||
:desc "Load session" :n "L" '+workspace/load-session
|
:desc "Load session" :n "L" #'+workspace/load-session
|
||||||
:desc "Save session" :n "s" '+workspace/save-session
|
:desc "Save session" :n "s" #'+workspace/save-session
|
||||||
:desc "Delete session" :n "X" '+workspace/kill-session
|
:desc "Delete session" :n "X" #'+workspace/kill-session
|
||||||
:desc "Load workspace" :n "L" '+workspace/load
|
:desc "Load workspace" :n "L" #'+workspace/load
|
||||||
:desc "Save workspace" :n "L" '+workspace/save
|
:desc "Save workspace" :n "L" #'+workspace/save
|
||||||
:desc "Delete workspace" :n "x" '+workspace/delete
|
:desc "Delete workspace" :n "x" #'+workspace/delete
|
||||||
:desc "Switch workspace" :n "." '+workspace/switch-to
|
:desc "Switch workspace" :n "." #'+workspace/switch-to
|
||||||
:desc "Kill all buffers" :n "x" 'doom/kill-all-buffers)
|
:desc "Kill all buffers" :n "x" #'doom/kill-all-buffers)
|
||||||
|
|
||||||
(:desc "Quit"
|
(:desc "Quit"
|
||||||
:prefix "q"
|
:prefix "q"
|
||||||
:desc "Quit" :n "q" 'evil-save-and-quit
|
:desc "Quit" :n "q" #'evil-save-and-quit
|
||||||
:desc "Quit (forget session)" :n "Q" '+workspace/kill-session-and-quit)
|
:desc "Quit (forget session)" :n "Q" #'+workspace/kill-session-and-quit)
|
||||||
|
|
||||||
(:desc "Toggle"
|
(:desc "Toggle"
|
||||||
:prefix "t"
|
:prefix "t"
|
||||||
:desc "Spell check" :n "s" 'flyspell-mode
|
:desc "Spell check" :n "s" #'flyspell-mode
|
||||||
:desc "Line numbers" :n "l" 'doom/toggle-line-numbers
|
:desc "Line numbers" :n "l" #'doom/toggle-line-numbers
|
||||||
:desc "Fullscreen" :n "f" 'doom/toggle-fullscreen
|
:desc "Fullscreen" :n "f" #'doom/toggle-fullscreen
|
||||||
:desc "Indent guides" :n "i" 'highlight-indentation-mode
|
:desc "Indent guides" :n "i" #'highlight-indentation-mode
|
||||||
:desc "Indent guides (column)" :n "I" 'highlight-indentation-current-column-mode
|
:desc "Indent guides (column)" :n "I" #'highlight-indentation-current-column-mode
|
||||||
:desc "Impatient mode" :n "h" '+present/impatient-mode
|
:desc "Impatient mode" :n "h" #'+present/impatient-mode
|
||||||
:desc "Big mode" :n "b" '+present/big-mode)
|
:desc "Big mode" :n "b" #'+present/big-mode)
|
||||||
|
|
||||||
(:desc "Tmux/Terminal"
|
(:desc "Tmux/Terminal"
|
||||||
:prefix "T"
|
:prefix "T"
|
||||||
:desc "cd to here" :n "." '+tmux/cd-to-here
|
:desc "cd to here" :n "." #'+tmux/cd-to-here
|
||||||
:desc "cd to project" :n "/" '+tmux/cd-to-project
|
:desc "cd to project" :n "/" #'+tmux/cd-to-project
|
||||||
;; TODO :desc "ssh into..." :n "/" '+tmux/ssh
|
;; TODO :desc "ssh into..." :n "/" '+tmux/ssh
|
||||||
:desc "send selection" :v "r" '+tmux/send-region)
|
:desc "send selection" :v "r" #'+tmux/send-region)
|
||||||
|
|
||||||
(:desc "SSH/FTP"
|
(:desc "SSH/FTP"
|
||||||
:prefix "u"
|
:prefix "u"
|
||||||
:desc "Upload local" :n "u" '+upload/local
|
:desc "Upload local" :n "u" #'+upload/local
|
||||||
:desc "Upload local (force)" :n "U" (λ! (+upload/local t))
|
:desc "Upload local (force)" :n "U" (λ! (+upload/local t))
|
||||||
:desc "Download remote" :n "d" '+upload/remote-download
|
:desc "Download remote" :n "d" #'+upload/remote-download
|
||||||
:desc "Diff local & remote" :n "D" '+upload/diff
|
:desc "Diff local & remote" :n "D" #'+upload/diff
|
||||||
:desc "Browse remote files" :n "." '+upload/browse
|
:desc "Browse remote files" :n "." #'+upload/browse
|
||||||
:desc "Detect remote changes" :n "." '+upload/check-remote)
|
:desc "Detect remote changes" :n "." #'+upload/check-remote)
|
||||||
|
|
||||||
(:desc "Open with"
|
(:desc "Open with"
|
||||||
:prefix "o"
|
:prefix "o"
|
||||||
:desc "Default browser" :n "b" 'browse-url-of-file
|
:desc "Default browser" :n "b" #'browse-url-of-file
|
||||||
(:when IS-MAC
|
(:when IS-MAC
|
||||||
:desc "Reveal in Finder" :n "o" '+macos/reveal
|
:desc "Reveal in Finder" :n "o" #'+macos/reveal
|
||||||
:desc "Reveal project in Finder" :n "O" '+macos/reveal-project
|
:desc "Reveal project in Finder" :n "O" #'+macos/reveal-project
|
||||||
:desc "Send to Transmit" :n "u" '+macos/send-to-transmit
|
:desc "Send to Transmit" :n "u" #'+macos/send-to-transmit
|
||||||
:desc "Send project to Transmit" :n "U" '+macos/send-project-to-transmit
|
:desc "Send project to Transmit" :n "U" #'+macos/send-project-to-transmit
|
||||||
:desc "Send to Launchbar" :n "l" '+macos/send-to-launchbar
|
:desc "Send to Launchbar" :n "l" #'+macos/send-to-launchbar
|
||||||
:desc "Send project to Launchbar" :n "L" '+macos/send-project-to-launchbar))
|
:desc "Send project to Launchbar" :n "L" #'+macos/send-project-to-launchbar))
|
||||||
|
|
||||||
(:desc "Code tools"
|
(:desc "Code tools"
|
||||||
:prefix "c"
|
:prefix "c"
|
||||||
:desc "Build" :n "b" '+eval/build
|
:desc "Build" :n "b" #'+eval/build
|
||||||
:desc "Open/Send to REPL" :nv "r" '+eval/repl
|
:desc "Open/Send to REPL" :nv "r" #'+eval/repl
|
||||||
:desc "Open debugger" :n "R" '+debug/open)
|
:desc "Open debugger" :n "R" #'+debug/open)
|
||||||
|
|
||||||
(:desc "Personal"
|
(:desc "Personal"
|
||||||
:prefix "SPC"
|
:prefix "SPC"
|
||||||
:desc "Browse emacs.d" :n "." '+hlissner/browse-emacsd
|
:desc "Browse emacs.d" :n "." #'+hlissner/browse-emacsd
|
||||||
:desc "Find file in emacs.d" :n "/" '+hlissner/find-in-emacsd
|
:desc "Find file in emacs.d" :n "/" #'+hlissner/find-in-emacsd
|
||||||
:desc "Browse dotfiles" :n ">" '+hlissner/browse-dotfiles
|
:desc "Browse dotfiles" :n ">" #'+hlissner/browse-dotfiles
|
||||||
:desc "Find file in dotfiles" :n "?" '+hlissner/find-in-dotfiles
|
:desc "Find file in dotfiles" :n "?" #'+hlissner/find-in-dotfiles
|
||||||
:desc "Reload theme" :n "R" 'doom/reset-theme
|
:desc "Reload theme" :n "R" #'doom/reset-theme
|
||||||
;; Org notes
|
;; Org notes
|
||||||
:desc "Browse notes" :n "n" '+hlissner/browse-notes
|
:desc "Browse notes" :n "n" #'+hlissner/browse-notes
|
||||||
:desc "Find file in notes" :n "N" '+hlissner/find-in-notes
|
:desc "Find file in notes" :n "N" #'+hlissner/find-in-notes
|
||||||
:desc "Browse project notes" :n "p" '+org/browse-notes-for-project
|
:desc "Browse project notes" :n "p" #'+org/browse-notes-for-project
|
||||||
:desc "Browse mode notes" :n "m" '+org/browse-notes-for-major-mode
|
:desc "Browse mode notes" :n "m" #'+org/browse-notes-for-major-mode
|
||||||
:desc "Org Capture" :n "SPC" '+org/capture
|
:desc "Org Capture" :n "SPC" #'+org/capture
|
||||||
;; applications
|
;; applications
|
||||||
:desc "APP: elfeed" :n "r" '=rss
|
:desc "APP: elfeed" :n "r" #'=rss
|
||||||
:desc "APP: email" :n "e" '=email
|
:desc "APP: email" :n "e" #'=email
|
||||||
:desc "APP: twitter" :n "t" '=twitter
|
:desc "APP: twitter" :n "t" #'=twitter
|
||||||
))
|
))
|
||||||
|
|
||||||
(:localleader
|
(:localleader
|
||||||
|
@ -194,113 +195,113 @@
|
||||||
;; Yank to EOL
|
;; Yank to EOL
|
||||||
:n "Y" "y$"
|
:n "Y" "y$"
|
||||||
;; Folding
|
;; Folding
|
||||||
:n "zr" '+evil:open-folds-recursively
|
:n "zr" #'+evil:open-folds-recursively
|
||||||
:n "zm" '+evil:close-folds-recursively
|
:n "zm" #'+evil:close-folds-recursively
|
||||||
:n "zx" 'doom/kill-this-buffer
|
:n "zx" #'doom/kill-this-buffer
|
||||||
;; Buffers
|
;; Buffers
|
||||||
:n "ZX" 'bury-buffer
|
:n "ZX" #'bury-buffer
|
||||||
:n "]b" 'doom/next-buffer
|
:n "]b" #'doom/next-buffer
|
||||||
:n "[b" 'doom/previous-buffer
|
:n "[b" #'doom/previous-buffer
|
||||||
;; Diffs
|
;; Diffs
|
||||||
:m "]d" 'git-gutter:next-hunk
|
:m "]d" #'git-gutter:next-hunk
|
||||||
:m "[d" 'git-gutter:previous-hunk
|
:m "[d" #'git-gutter:previous-hunk
|
||||||
:m "]e" 'next-error
|
:m "]e" #'next-error
|
||||||
:m "[e" 'previous-error
|
:m "[e" #'previous-error
|
||||||
;; Switch tabs
|
;; Switch tabs
|
||||||
:n "]w" '+workspace/switch-right
|
:n "]w" #'+workspace/switch-right
|
||||||
:n "[w" '+workspace/switch-left
|
:n "[w" #'+workspace/switch-left
|
||||||
:m "gt" '+workspace/switch-right
|
:m "gt" #'+workspace/switch-right
|
||||||
:m "gT" '+workspace/switch-left
|
:m "gT" #'+workspace/switch-left
|
||||||
;; Increment/decrement number under cursor
|
;; Increment/decrement number under cursor
|
||||||
:n "g=" 'evil-numbers/inc-at-pt
|
:n "g=" #'evil-numbers/inc-at-pt
|
||||||
:n "g-" 'evil-numbers/dec-at-pt
|
:n "g-" #'evil-numbers/dec-at-pt
|
||||||
;; Todos
|
;; Todos
|
||||||
:m "]t" 'hl-todo-next
|
:m "]t" #'hl-todo-next
|
||||||
:m "[t" 'hl-todo-previous
|
:m "[t" #'hl-todo-previous
|
||||||
;; Navigation
|
;; Navigation
|
||||||
:nv "K" 'smart-up
|
:nv "K" #'smart-up
|
||||||
:m "gd" '+jump/definition
|
:m "gd" #'+jump/definition
|
||||||
:m "gD" '+jump/references
|
:m "gD" #'+jump/references
|
||||||
:n "gf" 'find-file-at-point
|
:n "gf" #'find-file-at-point
|
||||||
:n "gp" '+evil/reselect-paste
|
:n "gp" #'+evil/reselect-paste
|
||||||
:n "gc" 'evil-commentary
|
:n "gc" #'evil-commentary
|
||||||
:n "gx" 'evil-exchange
|
:n "gx" #'evil-exchange
|
||||||
:n "gr" '+eval:region
|
:n "gr" #'+eval:region
|
||||||
:n "gR" '+eval/buffer
|
:n "gR" #'+eval/buffer
|
||||||
:v "gR" '+eval:replace-region
|
:v "gR" #'+eval:replace-region
|
||||||
:m "g]" 'smart-forward
|
:m "g]" #'smart-forward
|
||||||
:m "g[" 'smart-backward
|
:m "g[" #'smart-backward
|
||||||
:v "@" '+evil:macro-on-all-lines
|
:v "@" #'+evil:macro-on-all-lines
|
||||||
:n "g@" '+evil:macro-on-all-lines
|
:n "g@" #'+evil:macro-on-all-lines
|
||||||
;; Repeat in visual mode (buggy)
|
;; Repeat in visual mode (buggy)
|
||||||
:v "." 'evil-repeat
|
:v "." #'evil-repeat
|
||||||
:v "<" '+evil/visual-dedent ; vnoremap < <gv
|
:v "<" #'+evil/visual-dedent ; vnoremap < <gv
|
||||||
:v ">" '+evil/visual-indent ; vnoremap > >gv
|
:v ">" #'+evil/visual-indent ; vnoremap > >gv
|
||||||
;; undo/redo for regions (buggy)
|
;; undo/redo for regions (buggy)
|
||||||
:nv "u" 'undo-tree-undo
|
:nv "u" #'undo-tree-undo
|
||||||
:nv "C-r" 'undo-tree-redo
|
:nv "C-r" #'undo-tree-redo
|
||||||
;; paste from recent yank register (which isn't overwritten)
|
;; paste from recent yank register (which isn't overwritten)
|
||||||
:v "C-p" "\"0p"
|
:v "C-p" "\"0p"
|
||||||
|
|
||||||
(:map evil-window-map ; prefix "C-w"
|
(:map evil-window-map ; prefix "C-w"
|
||||||
;; Navigation
|
;; Navigation
|
||||||
"C-h" 'evil-window-left
|
"C-h" #'evil-window-left
|
||||||
"C-j" 'evil-window-down
|
"C-j" #'evil-window-down
|
||||||
"C-k" 'evil-window-up
|
"C-k" #'evil-window-up
|
||||||
"C-l" 'evil-window-right
|
"C-l" #'evil-window-right
|
||||||
"C-w" 'ace-window
|
"C-w" #'ace-window
|
||||||
;; Swapping windows
|
;; Swapping windows
|
||||||
"H" '+evil/window-move-left
|
"H" #'+evil/window-move-left
|
||||||
"J" '+evil/window-move-down
|
"J" #'+evil/window-move-down
|
||||||
"K" '+evil/window-move-up
|
"K" #'+evil/window-move-up
|
||||||
"L" '+evil/window-move-right
|
"L" #'+evil/window-move-right
|
||||||
"C-S-w" 'ace-swap-window
|
"C-S-w" #'ace-swap-window
|
||||||
;; Window undo/redo
|
;; Window undo/redo
|
||||||
"u" 'winner-undo
|
"u" #'winner-undo
|
||||||
"C-u" 'winner-undo
|
"C-u" #'winner-undo
|
||||||
"C-r" 'winner-redo
|
"C-r" #'winner-redo
|
||||||
"o" 'doom/window-zoom
|
"o" #'doom/window-zoom
|
||||||
;; Delete window
|
;; Delete window
|
||||||
"c" '+workspace/close-window-or-workspace
|
"c" #'+workspace/close-window-or-workspace
|
||||||
"C-C" 'ace-delete-window)
|
"C-C" #'ace-delete-window)
|
||||||
|
|
||||||
;;; Plugins
|
;;; Plugins
|
||||||
;; company-mode (+ vim-like omnicompletion)
|
;; company-mode (+ vim-like omnicompletion)
|
||||||
:i "C-SPC" '+company/complete
|
:i "C-SPC" #'+company/complete
|
||||||
(:prefix "C-x"
|
(:prefix "C-x"
|
||||||
:i "C-l" '+company/whole-lines
|
:i "C-l" #'+company/whole-lines
|
||||||
:i "C-k" '+company/dict-or-keywords
|
:i "C-k" #'+company/dict-or-keywords
|
||||||
:i "C-f" 'company-files
|
:i "C-f" #'company-files
|
||||||
:i "C-]" 'company-tags
|
:i "C-]" #'company-tags
|
||||||
:i "s" 'company-ispell
|
:i "s" #'company-ispell
|
||||||
:i "C-s" 'company-yasnippet
|
:i "C-s" #'company-yasnippet
|
||||||
:i "C-o" 'company-capf
|
:i "C-o" #'company-capf
|
||||||
:i "C-n" 'company-dabbrev-code
|
:i "C-n" #'company-dabbrev-code
|
||||||
:i "C-p" (λ! (let ((company-selection-wrap-around t))
|
:i "C-p" (λ! (let ((company-selection-wrap-around t))
|
||||||
(call-interactively 'company-dabbrev-code)
|
(call-interactively 'company-dabbrev-code)
|
||||||
(company-select-previous-or-abort))))
|
(company-select-previous-or-abort))))
|
||||||
;; evil-visual-star
|
;; evil-visual-star
|
||||||
:v "*" 'evil-visualstar/begin-search-forward
|
:v "*" #'evil-visualstar/begin-search-forward
|
||||||
:v "#" 'evil-visualstar/begin-search-backward
|
:v "#" #'evil-visualstar/begin-search-backward
|
||||||
;; evil-surround
|
;; evil-surround
|
||||||
:v "S" 'evil-surround-region
|
:v "S" #'evil-surround-region
|
||||||
:o "s" 'evil-surround-edit
|
:o "s" #'evil-surround-edit
|
||||||
:o "S" 'evil-Surround-edit
|
:o "S" #'evil-Surround-edit
|
||||||
;; expand-region
|
;; expand-region
|
||||||
:v "v" 'er/expand-region
|
:v "v" #'er/expand-region
|
||||||
:v "V" 'er/contract-region
|
:v "V" #'er/contract-region
|
||||||
;; rotate-text
|
;; rotate-text
|
||||||
:n "!" 'rotate-text
|
:n "!" #'rotate-text
|
||||||
;; evil-matchit
|
;; evil-matchit
|
||||||
:m "%" 'evilmi-jump-items
|
:m "%" #'evilmi-jump-items
|
||||||
;; hide-show/evil-matchit
|
;; hide-show/evil-matchit
|
||||||
:nv "<tab>" '+evil/matchit-or-toggle-fold
|
:nv "<tab>" #'+evil/matchit-or-toggle-fold
|
||||||
|
|
||||||
;; help-mode
|
;; help-mode
|
||||||
(:map help-mode-map
|
(:map help-mode-map
|
||||||
:n "]]" 'help-go-forward
|
:n "]]" #'help-go-forward
|
||||||
:n "[[" 'help-go-back
|
:n "[[" #'help-go-back
|
||||||
:n "o" 'ace-link-help))
|
:n "o" #'ace-link-help))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
@ -314,42 +315,43 @@
|
||||||
|
|
||||||
;; I want C-a and C-e to be a little smarter. C-a will jump to
|
;; I want C-a and C-e to be a little smarter. C-a will jump to
|
||||||
;; indentation. Pressing it again will send you to the true bol. Same goes
|
;; indentation. Pressing it again will send you to the true bol. Same goes
|
||||||
;; for C-e, except it will ignore comments and trailing whitespace.
|
;; for C-e, except it will ignore comments and trailing whitespace before
|
||||||
:i "C-a" 'doom/backward-to-bol-or-indent
|
;; jumping to eol.
|
||||||
:i "C-e" 'doom/forward-to-last-non-comment-or-eol
|
:i "C-a" #'doom/backward-to-bol-or-indent
|
||||||
:i "C-u" 'doom/backward-kill-to-bol-and-indent
|
:i "C-e" #'doom/forward-to-last-non-comment-or-eol
|
||||||
|
:i "C-u" #'doom/backward-kill-to-bol-and-indent
|
||||||
|
|
||||||
;; Restore 'dumb' indentation to the tab key. This rustles a lot of peoples'
|
;; Restore 'dumb' indentation to the tab key. This rustles a lot of peoples'
|
||||||
;; jimmies, apparently, but it's how I like it.
|
;; jimmies, apparently, but it's how I like it.
|
||||||
:i "<tab>" 'doom/dumb-indent
|
:i "<tab>" #'doom/dumb-indent
|
||||||
:i "<backtab>" 'doom/dumb-dedent
|
:i "<backtab>" #'doom/dumb-dedent
|
||||||
:i "<C-tab>" 'indent-for-tab-command
|
:i "<C-tab>" #'indent-for-tab-command
|
||||||
:i "<A-tab>" (λ! (insert "\t"))
|
:i "<A-tab>" (λ! (insert "\t"))
|
||||||
;; 'smart' indentation for lisp modes
|
;; 'smart' indentation for lisp modes
|
||||||
(:after lisp-mode
|
(:after lisp-mode
|
||||||
(:map lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command))
|
(:map lisp-mode-map :i [remap doom/dumb-indent] #'indent-for-tab-command))
|
||||||
(:after elisp-mode
|
(:after elisp-mode
|
||||||
(:map emacs-lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command))
|
(:map emacs-lisp-mode-map :i [remap doom/dumb-indent] #'indent-for-tab-command))
|
||||||
|
|
||||||
;; textmate-esque newline insertion
|
;; textmate-esque newline insertion
|
||||||
:i [M-return] 'evil-open-below
|
:i [M-return] #'evil-open-below
|
||||||
:i [S-M-return] 'evil-open-above
|
:i [S-M-return] #'evil-open-above
|
||||||
;; Textmate-esque newlines
|
;; Textmate-esque newlines
|
||||||
:i [backspace] 'delete-backward-char
|
:i [backspace] #'delete-backward-char
|
||||||
:i [M-backspace] 'doom/backward-kill-to-bol-and-indent
|
:i [M-backspace] #'doom/backward-kill-to-bol-and-indent
|
||||||
;; Emacsien motions for insert mode
|
;; Emacsien motions for insert mode
|
||||||
:i "C-b" 'backward-word
|
:i "C-b" #'backward-word
|
||||||
:i "C-f" 'forward-word
|
:i "C-f" #'forward-word
|
||||||
;; escape from insert mode (more responsive than using key-chord-define)
|
;; escape from insert mode (more responsive than using key-chord-define)
|
||||||
:irv "C-g" 'evil-normal-state
|
:irv "C-g" #'evil-normal-state
|
||||||
|
|
||||||
;; Highjacks space/backspace to:
|
;; Highjacks space/backspace to:
|
||||||
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
|
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
|
||||||
;; b) delete space-indented blocks intelligently
|
;; b) delete space-indented blocks intelligently
|
||||||
;; c) do none of this when inside a string
|
;; c) do none of this when inside a string
|
||||||
:i "SPC" 'doom/inflate-space-maybe
|
:i "SPC" #'doom/inflate-space-maybe
|
||||||
:i [remap delete-backward-char] 'doom/deflate-space-maybe
|
:i [remap delete-backward-char] #'doom/deflate-space-maybe
|
||||||
:i [remap newline] 'doom/newline-and-indent
|
:i [remap newline] #'doom/newline-and-indent
|
||||||
|
|
||||||
;; Make ESC quit all the things
|
;; Make ESC quit all the things
|
||||||
(:map (minibuffer-local-map
|
(:map (minibuffer-local-map
|
||||||
|
@ -357,23 +359,23 @@
|
||||||
minibuffer-local-completion-map
|
minibuffer-local-completion-map
|
||||||
minibuffer-local-must-match-map
|
minibuffer-local-must-match-map
|
||||||
minibuffer-local-isearch-map)
|
minibuffer-local-isearch-map)
|
||||||
[escape] 'abort-recursive-edit
|
[escape] #'abort-recursive-edit
|
||||||
"C-r" 'evil-paste-from-register)
|
"C-r" #'evil-paste-from-register)
|
||||||
|
|
||||||
(:map messages-buffer-mode-map
|
(:map messages-buffer-mode-map
|
||||||
"M-;" 'eval-expression
|
"M-;" #'eval-expression
|
||||||
"A-;" 'eval-expression)
|
"A-;" #'eval-expression)
|
||||||
|
|
||||||
(:map (evil-ex-completion-map evil-ex-search-keymap read-expression-map)
|
(:map (evil-ex-completion-map evil-ex-search-keymap read-expression-map)
|
||||||
"C-a" 'move-beginning-of-line
|
"C-a" #'move-beginning-of-line
|
||||||
"C-w" 'doom-minibuffer-kill-word
|
"C-w" #'doom-minibuffer-kill-word
|
||||||
"C-u" 'doom-minibuffer-kill-line
|
"C-u" #'doom-minibuffer-kill-line
|
||||||
"C-b" 'backward-word
|
"C-b" #'backward-word
|
||||||
"C-f" 'forward-word
|
"C-f" #'forward-word
|
||||||
"M-z" 'doom-minibuffer-undo)
|
"M-z" #'doom-minibuffer-undo)
|
||||||
|
|
||||||
(:after view
|
(:after view
|
||||||
(:map view-mode-map "<escape>" 'View-quit-all))
|
(:map view-mode-map "<escape>" #'View-quit-all))
|
||||||
|
|
||||||
(:after help-mode
|
(:after help-mode
|
||||||
(:map help-map
|
(:map help-map
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
(ex! "dehtml" '+web:decode-html-entities)
|
(ex! "dehtml" '+web:decode-html-entities)
|
||||||
(ex! "ie[dit]" 'evil-multiedit-ex-match)
|
(ex! "ie[dit]" 'evil-multiedit-ex-match)
|
||||||
(ex! "na[rrow]" '+evil:narrow-buffer)
|
(ex! "na[rrow]" '+evil:narrow-buffer)
|
||||||
(ex! "ref[actor]" 'emr-show-refactor-menu)
|
|
||||||
(ex! "retab" '+evil:retab)
|
(ex! "retab" '+evil:retab)
|
||||||
|
|
||||||
;; External resources
|
;; External resources
|
||||||
|
|
|
@ -4,10 +4,13 @@
|
||||||
(defun +gist/open-current ()
|
(defun +gist/open-current ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(gist-fetch-current)
|
(gist-fetch-current)
|
||||||
(doom/popup-close-all))
|
(when-let (win (get-buffer-window "*github:gists*"))
|
||||||
|
(doom/popup-close win)))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +gist/kill-cache ()
|
(defun +gist/kill-cache ()
|
||||||
|
"Clears the gist cache. Necessary when a faulty cache causes gist.el to be
|
||||||
|
entirely unuseable."
|
||||||
(interactive)
|
(interactive)
|
||||||
(delete-directory (expand-file-name "gh" pcache-directory) t)
|
(delete-directory (expand-file-name "gh" pcache-directory) t)
|
||||||
(message "gist.el cache cleared"))
|
(message "gist.el cache cleared"))
|
||||||
|
|
|
@ -14,16 +14,16 @@
|
||||||
;; evil-ify gist listing
|
;; evil-ify gist listing
|
||||||
(set! :evil-state 'gist-list-mode 'normal)
|
(set! :evil-state 'gist-list-mode 'normal)
|
||||||
(map! :map gist-list-menu-mode-map
|
(map! :map gist-list-menu-mode-map
|
||||||
:n "RET" '+gist/open-current
|
:n "RET" #'+gist/open-current
|
||||||
:n "d" 'gist-kill-current
|
:n "d" #'gist-kill-current
|
||||||
:n "r" 'gist-list-reload
|
:n "r" #'gist-list-reload
|
||||||
:n "c" 'gist-add-buffer
|
:n "c" #'gist-add-buffer
|
||||||
:n "y" 'gist-print-current-url
|
:n "y" #'gist-print-current-url
|
||||||
:n "b" 'gist-browse-current-url
|
:n "b" #'gist-browse-current-url
|
||||||
:n "s" 'gist-star
|
:n "s" #'gist-star
|
||||||
:n "S" 'gist-unstar
|
:n "S" #'gist-unstar
|
||||||
:n "f" 'gist-fork
|
:n "f" #'gist-fork
|
||||||
:n "q" 'quit-window)
|
:n "q" #'quit-window)
|
||||||
|
|
||||||
(when (bound-and-true-p shackle-mode)
|
(when (bound-and-true-p shackle-mode)
|
||||||
(defun +gist*list-render (orig-fn &rest args)
|
(defun +gist*list-render (orig-fn &rest args)
|
||||||
|
|
|
@ -59,11 +59,11 @@
|
||||||
(defun doom-visual-bell ()
|
(defun doom-visual-bell ()
|
||||||
"Blink the mode-line red briefly."
|
"Blink the mode-line red briefly."
|
||||||
(unless doom--visual-bell-old-bg
|
(unless doom--visual-bell-old-bg
|
||||||
(setq doom--visual-bell-old-bg (face-attribute 'mode-line :background)))
|
(setq doom--visual-bell-old-bg (face-background 'mode-line)))
|
||||||
(set-face-attribute 'mode-line nil :background "#54252C")
|
(set-face-background 'mode-line "#54252C")
|
||||||
(run-with-timer
|
(run-with-timer
|
||||||
0.1 nil
|
0.1 nil
|
||||||
(lambda () (set-face-attribute 'mode-line nil :background doom--visual-bell-old-bg))))
|
(lambda () (set-face-background 'mode-line doom--visual-bell-old-bg))))
|
||||||
(setq ring-bell-function #'doom-visual-bell
|
(setq ring-bell-function #'doom-visual-bell
|
||||||
visible-bell nil)
|
visible-bell nil)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue