Add modules/private/hlissner
This commit is contained in:
parent
7a72a019ea
commit
5c0b8af9d5
6 changed files with 577 additions and 0 deletions
360
modules/private/hlissner/+bindings.el
Normal file
360
modules/private/hlissner/+bindings.el
Normal file
|
@ -0,0 +1,360 @@
|
|||
;;; private/hlissner/+bindings.el
|
||||
|
||||
;; I've switched these keys on my keyboard
|
||||
(setq x-super-keysym 'alt
|
||||
x-alt-keysym 'meta)
|
||||
|
||||
(defmacro @find-file-in (path &optional project-p)
|
||||
"Returns a interactive function for searching files"
|
||||
`(lambda () (interactive)
|
||||
(let ((default-directory ,path))
|
||||
,(if project-p
|
||||
'(call-interactively (command-remapping 'projectile-find-file))
|
||||
'(call-interactive (command-remapping 'find-file))))))
|
||||
|
||||
(@map
|
||||
;; Essential
|
||||
"M-x" 'execute-extended-command
|
||||
"A-x" 'execute-extended-command
|
||||
"M-;" 'eval-expression
|
||||
"A-;" 'eval-expression
|
||||
;; Tools
|
||||
[f9] 'doom/what-face
|
||||
"C-`" 'doom/popup-toggle
|
||||
;; Text-scaling
|
||||
"M-0" (@λ (text-scale-set 0))
|
||||
"M-=" 'text-scale-increase
|
||||
"M--" 'text-scale-decrease
|
||||
;; Simple window navigation/manipulation
|
||||
"M-t" '+workspace/new
|
||||
"M-T" '+workspace/display
|
||||
"M-w" 'delete-window
|
||||
"M-W" 'delete-frame
|
||||
"M-n" 'evil-buffer-new
|
||||
"M-N" 'make-frame
|
||||
"C-j" 'evil-window-down
|
||||
"C-k" 'evil-window-up
|
||||
"C-h" 'evil-window-left
|
||||
"C-l" 'evil-window-right
|
||||
;; Basic escape keys for emacs mode
|
||||
:e "C-h" 'evil-window-left
|
||||
:e "C-j" 'evil-window-down
|
||||
:e "C-k" 'evil-window-up
|
||||
:e "C-l" 'evil-window-right
|
||||
;; Temporary escape into emacs mode
|
||||
[C-escape] 'evil-emacs-state
|
||||
:n [C-escape] 'evil-normal-state
|
||||
|
||||
;; Switching tabs (workgroups)
|
||||
"M-1" (@λ (+workspace/switch-to 0))
|
||||
"M-2" (@λ (+workspace/switch-to 1))
|
||||
"M-3" (@λ (+workspace/switch-to 2))
|
||||
"M-4" (@λ (+workspace/switch-to 3))
|
||||
"M-5" (@λ (+workspace/switch-to 4))
|
||||
"M-6" (@λ (+workspace/switch-to 5))
|
||||
"M-7" (@λ (+workspace/switch-to 6))
|
||||
"M-8" (@λ (+workspace/switch-to 7))
|
||||
"M-9" (@λ (+workspace/switch-to 8))
|
||||
"M-0" '+workspace/switch-to-last
|
||||
|
||||
[M-backspace] 'doom/backward-kill-to-bol-and-indent
|
||||
"M-a" 'mark-whole-buffer
|
||||
"M-c" 'evil-yank
|
||||
"M-q" 'save-buffers-kill-emacs
|
||||
"M-s" 'save-buffer
|
||||
"M-v" 'clipboard-yank
|
||||
"C-M-f" 'doom/toggle-fullscreen
|
||||
:m "A-j" '+hlissner:multi-next-line
|
||||
:m "A-k" '+hlissner:multi-previous-line
|
||||
|
||||
;;; <leader> and <localleader>
|
||||
:m ";" 'evil-ex
|
||||
(:leader
|
||||
:desc "Switch project buffer" :n "," 'projectile-switch-to-buffer
|
||||
:desc "Switch buffer" :n "<" 'switch-to-buffer
|
||||
:desc "Browse files" :n "." 'find-file
|
||||
:desc "Find file from here" :n ">" 'counsel-file-jump
|
||||
:desc "Find file in project" :n "/" 'projectile-find-file
|
||||
:desc "Open file explorer" :n "\\" '+evil/neotree
|
||||
:desc "Imenu" :n ";" 'imenu
|
||||
:desc "Imenu across buffers" :n ":" 'imenu-anywhere
|
||||
:desc "Find other file" :n "a" 'projectile-find-other-file
|
||||
:desc "Jump to bookmark" :n "b" 'bookmark-jump
|
||||
:desc "Delete bookmark" :n "B" 'bookmark-delete
|
||||
:desc "List errors" :n "e" 'flycheck-list-errors
|
||||
:desc "Open recent file" :n "m" 'recentf
|
||||
:desc "Open recent project file" :n "M" 'projectile-recentf
|
||||
:desc "Insert from kill ring" :n "y" 'counsel-yank-pop
|
||||
:desc "Switch project" :n "p" 'projectile-switch-project
|
||||
:desc "Find snippet in mode" :n "s" 'yas-visit-snippet-file
|
||||
:desc "Find snippet" :n "S" '+hlissner/find-in-snippets
|
||||
:desc "Execute in Emacs mode" :n "\\" 'evil-execute-in-emacs-state
|
||||
:desc "Switch to Emacs mode" :n "|" 'evil-emacs-state
|
||||
;; Since I've remapped C-h...
|
||||
:desc "Help" :n "h" 'help-command
|
||||
|
||||
(:desc "Applications" :prefix "a")
|
||||
|
||||
(:desc "Quit"
|
||||
:prefix "q"
|
||||
:desc "Quit" :n "q" 'evil-save-and-quit
|
||||
:desc "Quit (forget session)" :n "Q" '+workspace/kill-session-and-quit)
|
||||
|
||||
(:desc "Toggle"
|
||||
:prefix "t"
|
||||
:desc "Line numbers" :n "l" 'doom/toggle-line-numbers
|
||||
:desc "Fullscreen" :n "f" 'doom/toggle-fullscreen)
|
||||
|
||||
(:desc "Tmux"
|
||||
:prefix "T"
|
||||
:desc "cd to here" :n "." '+tmux/cd-to-here
|
||||
:desc "cd to project" :n "/" '+tmux/cd-to-project
|
||||
;; TODO :desc "ssh into..." :n "/" '+tmux/ssh
|
||||
:desc "send selection" :v "r" '+tmux/send-region)
|
||||
|
||||
(:desc "SSH/FTP"
|
||||
:prefix "u"
|
||||
:desc "Upload local" :n "u" '+upload/local
|
||||
:desc "Upload local (force)" :n "U" (@λ (+upload/local t))
|
||||
:desc "Download remote" :n "d" '+upload/remote-download
|
||||
:desc "Diff local & remote" :n "D" '+upload/diff
|
||||
:desc "Browse remote files" :n "." '+upload/browse
|
||||
:desc "Detect remote changes" :n "." '+upload/check-remote)
|
||||
|
||||
(:desc "External Applications"
|
||||
:prefix "o"
|
||||
:desc "Default browser" :n "b" 'browse-url-of-file
|
||||
(:when IS-MAC
|
||||
:desc "Reveal in Finder" :n "o" '+macos/reveal
|
||||
:desc "Reveal in Finder" :n "r" '+macos/reveal
|
||||
:desc "Reveal project in Finder" :n "p" '+macos/reveal-project
|
||||
:desc "Send to Transmit" :n "u" '+macos/send-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 project to Launchbar" :n "L" '+macos/send-project-to-launchbar))
|
||||
|
||||
(:desc "Code tools"
|
||||
:prefix "c"
|
||||
:desc "Build" :n "b" '+eval/build
|
||||
:desc "Open REPL" :n "r" '+eval/repl
|
||||
:desc "Open REPL" :v "r" '+eval/repl-send-region
|
||||
:desc "Open debugger" :n "R" '+debug/open)
|
||||
|
||||
(:desc "Personal"
|
||||
:prefix "SPC"
|
||||
:desc "Browse emacs.d" :n "." '+hlissner/browse-emacsd
|
||||
:desc "Find file in emacs.d" :n "/" '+hlissner/find-in-emacsd
|
||||
:desc "Browse dotfiles" :n ">" '+hlissner/browse-dotfiles
|
||||
:desc "Find file in dotfiles" :n "?" '+hlissner/find-in-dotfiles
|
||||
:desc "Reload theme" :n "R" 'doom/reset-theme))
|
||||
|
||||
(:localleader
|
||||
:desc "Open file explorer" :n "\\" '+evil/neotree
|
||||
|
||||
(:desc "Refactor" :prefix "r")
|
||||
(:desc "Unit tests" :prefix "t"))
|
||||
|
||||
;;; Evil-esque bindings
|
||||
;; Yank to EOL
|
||||
:n "Y" "y$"
|
||||
;; Folding
|
||||
:n "zr" '+evil:open-folds-recursively
|
||||
:n "zm" '+evil:close-folds-recursively
|
||||
:n "zx" 'doom/kill-this-buffer
|
||||
;; Buffers
|
||||
:n "ZX" 'bury-buffer
|
||||
:n "]b" 'doom/next-buffer
|
||||
:n "[b" 'doom/previous-buffer
|
||||
;; Diffs
|
||||
:m "]d" 'git-gutter:next-hunk
|
||||
:m "[d" 'git-gutter:previous-hunk
|
||||
:m "]e" 'next-error
|
||||
:m "[e" 'previous-error
|
||||
;; Switch tabs
|
||||
:n "]w" '+workspace/switch-right
|
||||
:n "[w" '+workspace/switch-left
|
||||
:m "gt" '+workspace/switch-right
|
||||
:m "gT" '+workspace/switch-left
|
||||
;; Increment/decrement number under cursor
|
||||
:n "g=" 'evil-numbers/inc-at-pt
|
||||
:n "g-" 'evil-numbers/dec-at-pt
|
||||
:n "gf" 'find-file-at-point
|
||||
;; Todos
|
||||
:m "]t" 'hl-todo-next
|
||||
:m "[t" 'hl-todo-previous
|
||||
;; Navigation
|
||||
:nv "K" 'smart-up
|
||||
:m "gD" 'doom/find-def
|
||||
:n "gp" 'doom/editor-reselect-paste
|
||||
:n "gc" 'evil-commentary
|
||||
:n "gx" 'evil-exchange
|
||||
:n "gr" '+repl:eval-region
|
||||
:n "gR" '+repl/eval-buffer
|
||||
:v "gR" '+repl:eval-region-and-replace
|
||||
:m "g]" 'smart-forward
|
||||
:m "g[" 'smart-backward
|
||||
:v "@" '+evil:macro-on-all-lines
|
||||
:n "g@" '+evil:macro-on-all-lines
|
||||
;; Repeat in visual mode (buggy)
|
||||
:v "." 'evil-repeat
|
||||
:v "<" '+evil/visual-dedent ; vnoremap < <gv
|
||||
:v ">" '+evil/visual-indent ; vnoremap > >gv
|
||||
;; undo/redo for regions (buggy)
|
||||
:nv "u" 'undo-tree-undo
|
||||
:nv "C-r" 'undo-tree-redo
|
||||
;; paste from recent yank register (which isn't overwritten)
|
||||
:v "C-p" "\"0p"
|
||||
|
||||
(:map evil-window-map ; prefix "C-w"
|
||||
;; Navigation
|
||||
"C-h" 'evil-window-left
|
||||
"C-j" 'evil-window-down
|
||||
"C-k" 'evil-window-up
|
||||
"C-l" 'evil-window-right
|
||||
"C-w" 'ace-window
|
||||
;; Swapping windows
|
||||
"H" '+evil/window-move-left
|
||||
"J" '+evil/window-move-down
|
||||
"K" '+evil/window-move-up
|
||||
"L" '+evil/window-move-right
|
||||
"C-S-w" 'ace-swap-window
|
||||
;; Window undo/redo
|
||||
"u" 'winner-undo
|
||||
"C-u" 'winner-undo
|
||||
"C-r" 'winner-redo
|
||||
"o" 'doom/window-zoom
|
||||
;; Delete window
|
||||
"c" '+workspace/close-window-or-workspace
|
||||
"C-C" 'ace-delete-window)
|
||||
|
||||
;;; Plugins
|
||||
;; company-mode (+ vim-like omnicompletion)
|
||||
:i "C-SPC" '+company/complete
|
||||
(:prefix "C-x"
|
||||
:i "C-l" '+company/whole-lines
|
||||
:i "C-k" '+company/dict-or-keywords
|
||||
:i "C-f" 'company-files
|
||||
:i "C-]" 'company-tags
|
||||
:i "s" 'company-ispell
|
||||
:i "C-s" 'company-yasnippet
|
||||
:i "C-o" 'company-capf
|
||||
:i "C-n" 'company-dabbrev-code
|
||||
:i "C-p" (@λ (let ((company-selection-wrap-around t))
|
||||
(call-interactively 'company-dabbrev-code)
|
||||
(company-select-previous-or-abort))))
|
||||
;; evil-visual-star
|
||||
:v "*" 'evil-visualstar/begin-search-forward
|
||||
:v "#" 'evil-visualstar/begin-search-backward
|
||||
;; evil-multiedit
|
||||
:v "R" 'evil-multiedit-match-all
|
||||
:n "M-C-D" 'evil-multiedit-restore
|
||||
:n "M-d" 'evil-multiedit-match-symbol-and-next
|
||||
:n "M-D" 'evil-multiedit-match-symbol-and-prev
|
||||
:v "M-d" 'evil-multiedit-match-and-next
|
||||
:v "M-D" 'evil-multiedit-match-and-prev
|
||||
;; evil-surround
|
||||
:v "S" 'evil-surround-region
|
||||
:o "s" 'evil-surround-edit
|
||||
:o "S" 'evil-Surround-edit
|
||||
;; expand-region
|
||||
:v "v" 'er/expand-region
|
||||
:v "V" 'er/contract-region
|
||||
;; rotate-text
|
||||
:n "!" 'rotate-text
|
||||
;; evil-matchit
|
||||
:m "%" 'evilmi-jump-items
|
||||
;; hide-show/evil-matchit
|
||||
:nv "<tab>" '+evil/matchit-or-toggle-fold
|
||||
|
||||
;; help-mode
|
||||
(:map help-mode-map
|
||||
:n "]]" 'help-go-forward
|
||||
:n "[[" 'help-go-back
|
||||
:n "o" 'ace-link-help))
|
||||
|
||||
|
||||
;;
|
||||
;; Keybinding fixes
|
||||
;;
|
||||
|
||||
;; This section is dedicated to "fixing" certain keys so that they behave
|
||||
;; properly or more like vim (or how I like it).
|
||||
|
||||
(@map (:unless window-system "TAB" [tab]) ; Fix TAB in terminal
|
||||
|
||||
;; 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
|
||||
;; for C-e, except it will ignore comments and trailing whitespace.
|
||||
:i "C-a" 'doom/backward-to-bol-or-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'
|
||||
;; jimmies, apparently, but it's how I like it.
|
||||
:i "<tab>" 'doom/dumb-indent
|
||||
:i "<backtab>" 'doom/dumb-dedent
|
||||
:i "<C-tab>" 'indent-for-tab-command
|
||||
:i "<A-tab>" (@λ (insert "\t"))
|
||||
;; 'smart' indentation for lisp modes
|
||||
(:after lisp-mode
|
||||
(:map lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command))
|
||||
(:after elisp-mode
|
||||
(:map emacs-lisp-mode-map :i [remap doom/dumb-indent] 'indent-for-tab-command))
|
||||
|
||||
;; textmate-esque newline insertion
|
||||
:i [M-return] 'evil-open-below
|
||||
:i [S-M-return] 'evil-open-above
|
||||
;; Textmate-esque newlines
|
||||
:i [backspace] 'delete-backward-char
|
||||
:i [M-backspace] 'doom/backward-kill-to-bol-and-indent
|
||||
;; Emacsien motions for insert mode
|
||||
:i "C-b" 'backward-word
|
||||
:i "C-f" 'forward-word
|
||||
;; escape from insert mode (more responsive than using key-chord-define)
|
||||
:irv "C-g" 'evil-normal-state
|
||||
|
||||
;; Highjacks space/backspace to:
|
||||
;; a) balance spaces inside brackets/parentheses ( | ) -> (|)
|
||||
;; b) delete space-indented blocks intelligently
|
||||
;; c) do none of this when inside a string
|
||||
:i "SPC" 'doom/inflate-space-maybe
|
||||
:i [remap delete-backward-char] 'doom/deflate-space-maybe
|
||||
:i [remap newline] 'doom/newline-and-indent
|
||||
|
||||
;; Make ESC quit all the things
|
||||
(:map (minibuffer-local-map
|
||||
minibuffer-local-ns-map
|
||||
minibuffer-local-completion-map
|
||||
minibuffer-local-must-match-map
|
||||
minibuffer-local-isearch-map)
|
||||
[escape] 'abort-recursive-edit
|
||||
"C-r" 'evil-paste-from-register)
|
||||
|
||||
(:map messages-buffer-mode-map
|
||||
"M-;" 'eval-expression
|
||||
"A-;" 'eval-expression)
|
||||
|
||||
(:after evil
|
||||
(:map (evil-ex-completion-map evil-ex-search-keymap)
|
||||
"C-a" 'move-beginning-of-line
|
||||
"C-w" 'backward-kill-word
|
||||
"C-u" 'backward-kill-sentence
|
||||
"C-b" 'backward-word
|
||||
"C-f" 'forward-word))
|
||||
(:map read-expression-map
|
||||
"C-a" 'move-beginning-of-line
|
||||
"C-w" 'backward-kill-word
|
||||
"C-u" 'backward-kill-sentence
|
||||
"C-b" 'backward-word
|
||||
"C-f" 'forward-word)
|
||||
|
||||
(:after view
|
||||
(:map view-mode-map "<escape>" 'View-quit-all))
|
||||
|
||||
(:after help-mode
|
||||
(:map help-map
|
||||
;; Remove slow/annoying help subsections
|
||||
"h" nil
|
||||
"g" nil)))
|
||||
|
||||
|
86
modules/private/hlissner/+commands.el
Normal file
86
modules/private/hlissner/+commands.el
Normal file
|
@ -0,0 +1,86 @@
|
|||
(defalias '@ex 'evil-ex-define-cmd)
|
||||
|
||||
;;; Custom commands
|
||||
;; Emacs utilities
|
||||
(@ex "bc[omp]" '+hlissner:byte-compile)
|
||||
(@ex "clog" 'global-command-log-mode)
|
||||
(@ex "minor" 'describe-minor-mode) ; list minor modes
|
||||
(@ex "re[load]" 'doom/reload)
|
||||
(@ex "re[load]au" 'doom/reload-autoloads)
|
||||
|
||||
;; Editing
|
||||
(@ex "@" '+evil:macro-on-all-lines) ; TODO Test me
|
||||
(@ex "date" '+text:insert-date)
|
||||
(@ex "enhtml" '+hlissner:encode-html-entities)
|
||||
(@ex "dehtml" '+hlissner:decode-html-entities)
|
||||
(@ex "ie[dit]" 'evil-multiedit-ex-match)
|
||||
(@ex "na[rrow]" '+hlissner:narrow-buffer)
|
||||
(@ex "ref[actor]" 'emr-show-refactor-menu)
|
||||
(@ex "retab" '+hlissner:retab)
|
||||
|
||||
;; External resources
|
||||
;; TODO (@ex "db" 'doom:db)
|
||||
;; TODO (@ex "dbu[se]" 'doom:db-select)
|
||||
;; TODO (@ex "go[ogle]" 'doom:google-search)
|
||||
(@ex "http" 'httpd-start) ; start http server
|
||||
(@ex "repl" '+repl/run) ; invoke or send to repl
|
||||
;; TODO (@ex "rx" 'doom:regex) ; open re-builder
|
||||
(@ex "sh[ell]" '+eshell:run)
|
||||
(@ex "t[mux]" '+tmux:run) ; send to tmux
|
||||
(@ex "tcd" '+tmux:cd-here) ; cd to default-directory in tmux
|
||||
(@ex "x" 'doom:scratch-buffer)
|
||||
|
||||
;; GIT
|
||||
(@ex "gbrowse" '+vcs/git-browse) ; show file in github/gitlab
|
||||
(@ex "gissues" '+vcs/git-browse-issues) ; show github issues
|
||||
(@ex "git" 'magit-status) ; open magit status window
|
||||
(@ex "gstage" 'magit-stage)
|
||||
(@ex "gunstage" 'magit-unstage)
|
||||
;; TODO :gblame
|
||||
;; TODO :grevert
|
||||
;; TODO :gblame
|
||||
|
||||
;; Dealing with buffers
|
||||
(@ex "clean[up]" 'doom:cleanup-buffers) ; Clean up old/unreal buffers
|
||||
(@ex "k[ill]" 'doom/kill-real-buffer) ; Kill current buffer
|
||||
(@ex "k[ill]all" 'doom:kill-all-buffers) ; Kill buffers (bang = in project)
|
||||
(@ex "k[ill]m" 'doom:kill-matching-buffers) ; kill buffers by regexp
|
||||
(@ex "k[ill]o" 'doom:kill-other-buffers) ; kill other buffers
|
||||
(@ex "l[ast]" 'doom/popup-last-buffer) ; pop up last popup
|
||||
(@ex "m[sg]" 'view-echo-area-messages) ; open *messages* in popup
|
||||
(@ex "pop[up]" 'doom/popup) ; open current buffer in popup
|
||||
|
||||
;; Project navigation
|
||||
(@ex "a" 'projectile-find-other-file)
|
||||
(@ex "ag" '+ivy:ag-search)
|
||||
(@ex "ag[cw]d" '+ivy:ag-search-cwd)
|
||||
(@ex "cd" '+hlissner:cd)
|
||||
(@ex "sw[iper]" '+ivy:swiper) ; in-file search
|
||||
|
||||
;; Project tools
|
||||
(@ex "build" '+eval/build)
|
||||
(@ex "debug" '+debug/run)
|
||||
(@ex "er[rors]" 'flycheck-list-errors)
|
||||
(@ex "todo" '+ivy/tasks)
|
||||
|
||||
;; File operations
|
||||
(@ex "mv" '+evil:file-move)
|
||||
(@ex "rm" '+evil:file-delete)
|
||||
|
||||
;; Sessions/tabs
|
||||
(@ex "sclear" '+workspace/kill-session)
|
||||
(@ex "sl[oad]" '+workspace:load-session) ; TODO :sload [NAME]
|
||||
(@ex "ss[ave]" '+workspace:save-session) ; TODO :ssave [NAME]
|
||||
(@ex "tabc[lose]" '+workspace:delete)
|
||||
(@ex "tabclear" 'doom/kill-all-buffers)
|
||||
(@ex "tabl[ast]" '+workspace/switch-to-list)
|
||||
(@ex "tabload" '+workspace:load)
|
||||
(@ex "tabn[ew]" '+workspace:new)
|
||||
(@ex "tabn[ext]" '+workspace:switch-next)
|
||||
(@ex "tabp[rev]" '+workspace:switch-previous)
|
||||
(@ex "tabr[ename]" '+workspace:rename)
|
||||
(@ex "tabs" '+workspace/display)
|
||||
(@ex "tabsave" '+workspace:save)
|
||||
|
||||
;; Org-mode
|
||||
(@ex "org" '+org:capture)
|
22
modules/private/hlissner/autoload/evil.el
Normal file
22
modules/private/hlissner/autoload/evil.el
Normal file
|
@ -0,0 +1,22 @@
|
|||
;;; private/hlissner/autoload/evil.el
|
||||
|
||||
;;;###autoload (autoload '+hlissner:multi-next-line "private/hlissner/autoload/evil" nil t)
|
||||
(evil-define-motion +hlissner:multi-next-line (count)
|
||||
"Move down 6 lines."
|
||||
:type line
|
||||
(let ((line-move-visual visual-line-mode))
|
||||
(evil-line-move (* 6 (or count 1)))))
|
||||
|
||||
;;;###autoload (autoload '+hlissner:multi-previous-line "private/hlissner/autoload/evil" nil t)
|
||||
(evil-define-motion +hlissner:multi-previous-line (count)
|
||||
"Move up 6 lines."
|
||||
:type line
|
||||
(let ((line-move-visual visual-line-mode))
|
||||
(evil-line-move (- (* 6 (or count 1))))))
|
||||
|
||||
;;;###autoload (autoload '+hlissner:cd "private/hlissner/autoload/evil" nil t)
|
||||
(evil-define-command +hlissner:cd ()
|
||||
"Change `default-directory' with `cd'."
|
||||
(interactive "<f>")
|
||||
(cd input))
|
||||
|
45
modules/private/hlissner/autoload/hlissner.el
Normal file
45
modules/private/hlissner/autoload/hlissner.el
Normal file
|
@ -0,0 +1,45 @@
|
|||
;;; private/hlissner/autoload/hlissner.el
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/install-snippets ()
|
||||
"Install my snippets from https://github.com/hlissner/emacs-snippets into
|
||||
private/hlissner/snippets."
|
||||
(interactive)
|
||||
(bs-fetch :github "hlissner/emacs-snippets"
|
||||
(expand-file-name "snippets" (doom-module-path :private 'hlissner))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/find-in-templates ()
|
||||
"Browse through snippets folder"
|
||||
(interactive)
|
||||
(projectile-find-file-in-directory (car yas-snippet-dirs)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/find-in-snippets ()
|
||||
"Browse through snippets folder"
|
||||
(interactive)
|
||||
(projectile-find-file-in-directory (car yas-snippet-dirs)))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/find-in-dotfiles ()
|
||||
(interactive)
|
||||
(projectile-find-file-in-directory (expand-file-name ".dotfiles" "~")))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/find-in-emacsd ()
|
||||
(interactive)
|
||||
(projectile-find-file-in-directory doom-emacs-dir))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/browse-emacsd ()
|
||||
(interactive)
|
||||
(let ((default-directory doom-emacs-dir))
|
||||
(call-interactively (command-remapping 'find-file))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +hlissner/browse-dotfiles ()
|
||||
(interactive)
|
||||
(let ((default-directory (expand-file-name ".dotfiles" "~")))
|
||||
(call-interactively (command-remapping 'find-file))))
|
||||
|
||||
|
63
modules/private/hlissner/config.el
Normal file
63
modules/private/hlissner/config.el
Normal file
|
@ -0,0 +1,63 @@
|
|||
;;; private/hlissner/config.el
|
||||
|
||||
(@load +bindings) ; my key bindings
|
||||
(when (featurep 'evil)
|
||||
(@load +commands)) ; my custom ex commands
|
||||
|
||||
(defvar +hlissner-snippets-dir
|
||||
(expand-file-name "snippets/" (file-name-directory load-file-name)))
|
||||
|
||||
|
||||
;; On Arch, bspwm is my window manager. When I open GUI Emacs there's a gap on
|
||||
;; the right side of the frame (which causes display glitches). I fix this by
|
||||
;; simply cycling fullscreen:
|
||||
(when (and (display-graphic-p) IS-LINUX)
|
||||
(@add-hook 'after-init-hook
|
||||
(set-frame-parameter nil 'fullscreen 'fullboth)
|
||||
(set-frame-parameter nil 'fullscreen nil)))
|
||||
|
||||
|
||||
;; Don't use default snippets, use mine.
|
||||
(@after yasnippet
|
||||
(setq yas-snippet-dirs (append (list '+hlissner-snippets-dir)
|
||||
(delete 'yas-installed-snippets-dir yas-snippet-dirs))))
|
||||
|
||||
|
||||
;; Repeat all sorts of motion and searches with SPC & C-SPC
|
||||
(defmacro +my@repeat-with-spc (command next-func prev-func)
|
||||
"Repeat motions with SPC/S-SPC"
|
||||
(let ((fn-sym (intern (format "+evil*repeat-%s" command))))
|
||||
`(progn
|
||||
(defun ,fn-sym (&rest _)
|
||||
(define-key evil-motion-state-map (kbd "SPC") ',next-func)
|
||||
(define-key evil-motion-state-map (kbd "S-SPC") ',prev-func))
|
||||
(advice-add ',command :before ',fn-sym))))
|
||||
|
||||
(@after evil
|
||||
;; n/N
|
||||
(+my@repeat-with-spc evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
||||
(+my@repeat-with-spc evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
|
||||
(+my@repeat-with-spc evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
|
||||
(+my@repeat-with-spc evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
|
||||
|
||||
;; f/F/t/T/s/S
|
||||
(@after evil-snipe
|
||||
(setq evil-snipe-repeat-keys nil
|
||||
evil-snipe-override-evil-repeat-keys nil) ; causes problems with remapped ;
|
||||
|
||||
(+my@repeat-with-spc evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
|
||||
(+my@repeat-with-spc evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
|
||||
|
||||
;; */#
|
||||
(@after evil-visualstar
|
||||
(+my@repeat-with-spc evil-visualstar/begin-search-forward
|
||||
evil-ex-search-next evil-ex-search-previous)
|
||||
(+my@repeat-with-spc evil-visualstar/begin-search-backward
|
||||
evil-ex-search-previous evil-ex-search-next)))
|
||||
|
1
modules/private/hlissner/snippets
Submodule
1
modules/private/hlissner/snippets
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 82fcb015435f21682f6f5880bf71bcec672ae14d
|
Loading…
Add table
Add a link
Reference in a new issue