Minor, general refactors

This commit is contained in:
Henrik Lissner 2019-03-09 02:42:03 -05:00
parent 442bd7cfb9
commit 54d1c0dd56
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
8 changed files with 22 additions and 17 deletions

View file

@ -18,6 +18,10 @@
(add-hook 'find-file-hook #'doom|init-project-mode) (add-hook 'find-file-hook #'doom|init-project-mode)
(projectile-mode +1) (projectile-mode +1)
(define-key!
[remap evil-jump-to-tag] #'projectile-find-tag
[remap find-tag] #'projectile-find-tag)
;; a more generic project root file ;; a more generic project root file
(push ".project" projectile-project-root-files-bottom-up) (push ".project" projectile-project-root-files-bottom-up)

View file

@ -77,8 +77,8 @@ immediately runs it on the current candidate (ending the ivy session)."
:commands (ivy-dispatching-done-hydra ivy--matcher-desc) :commands (ivy-dispatching-done-hydra ivy--matcher-desc)
:init :init
(define-key! ivy-minibuffer-map (define-key! ivy-minibuffer-map
"\C-o" #'+ivy-coo-hydra/body "C-o" #'+ivy-coo-hydra/body
(kbd "M-o") #'ivy-dispatching-done-hydra))) "M-o" #'ivy-dispatching-done-hydra)))
(def-package! ivy-rich (def-package! ivy-rich

View file

@ -17,9 +17,6 @@
"M-;" #'eval-expression "M-;" #'eval-expression
"A-;" #'eval-expression) "A-;" #'eval-expression)
[remap evil-jump-to-tag] #'projectile-find-tag
[remap find-tag] #'projectile-find-tag
;; Smart tab ;; Smart tab
:i [tab] (general-predicate-dispatch nil ; fall back to nearest keymap :i [tab] (general-predicate-dispatch nil ; fall back to nearest keymap
(and (featurep! :feature snippets) (and (featurep! :feature snippets)

View file

@ -131,12 +131,12 @@
:prefix doom-leader-key "u" #'universal-argument-more :prefix doom-leader-key "u" #'universal-argument-more
:prefix doom-leader-alt-key "u" #'universal-argument-more)) :prefix doom-leader-alt-key "u" #'universal-argument-more))
(defun +default|setup-input-decode-map () (defun +default|init-input-decode-map ()
"Ensure TAB and [tab] are treated the same in TTY Emacs." "Ensure TAB and [tab] are treated the same in TTY Emacs."
(define-key input-decode-map [tab] (kbd "TAB")) (define-key input-decode-map [tab] (kbd "TAB"))
(define-key input-decode-map [return] (kbd "RET")) (define-key input-decode-map [return] (kbd "RET"))
(define-key input-decode-map [escape] (kbd "ESC"))) (define-key input-decode-map [escape] (kbd "ESC")))
(add-hook 'tty-setup-hook #'+default|setup-input-decode-map) (add-hook 'tty-setup-hook #'+default|init-input-decode-map)
;; A Doom convention where C-s on popups and interactive searches will invoke ;; A Doom convention where C-s on popups and interactive searches will invoke
;; ivy/helm for their superior filtering. ;; ivy/helm for their superior filtering.

View file

@ -50,10 +50,10 @@
(call-interactively #'evil-paste-after))) (call-interactively #'evil-paste-after)))
(defun +evil--window-swap (direction) (defun +evil--window-swap (direction)
"Move current window to the next window in DIRECTION. If there are no windows "Move current window to the next window in DIRECTION.
there and there is only one window, split in that direction and place this If there are no windows there and there is only one window, split in that
window there. If there are no windows and this isn't the only window, use direction and place this window there. If there are no windows and this isn't
evil-window-move-* (e.g. `evil-window-move-far-left')" the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
(when (window-dedicated-p) (when (window-dedicated-p)
(user-error "Cannot swap a dedicated window")) (user-error "Cannot swap a dedicated window"))
(let* ((this-window (selected-window)) (let* ((this-window (selected-window))

View file

@ -98,17 +98,17 @@ library/userland functions"
(defun +emacs-lisp|extend-imenu () (defun +emacs-lisp|extend-imenu ()
"Improve imenu support with better expression regexps and Doom-specific forms." "Improve imenu support with better expression regexps and Doom-specific forms."
(setq imenu-generic-expression (setq imenu-generic-expression
'(("Evil Commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1) '(("Evil commands" "^\\s-*(evil-define-\\(?:command\\|operator\\|motion\\) +\\(\\_<[^ ()\n]+\\_>\\)" 1)
("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1) ("Unit tests" "^\\s-*(\\(?:ert-deftest\\|describe\\) +\"\\([^\")]+\\)\"" 1)
("Package" "^\\s-*(\\(?:def-\\)?package! +\\(\\_<[^ ()\n]+\\_>\\)" 1) ("Package" "^\\s-*(\\(?:def-\\)?package! +\\(\\_<[^ ()\n]+\\_>\\)" 1)
("Package" "^\\s-*;; `\\(\\_<[^ ()\n]+\\_>\\)'$" 1) ("Package" "^\\s-*;;;###package\\s-+\\(\\_<[^ ()\n]+\\_>\\)$" 1)
("Major modes" "^\\s-*(define-derived-mode +\\([^ ()\n]+\\)" 1) ("Major modes" "^\\s-*(define-derived-mode +\\([^ ()\n]+\\)" 1)
("Modelines" "^\\s-*(def-modeline! +\\([^ ()\n]+\\)" 1) ("Modelines" "^\\s-*(def-modeline! +\\([^ ()\n]+\\)" 1)
("Modeline Segments" "^\\s-*(def-modeline-segment! +\\([^ ()\n]+\\)" 1) ("Modeline segments" "^\\s-*(def-modeline-segment! +\\([^ ()\n]+\\)" 1)
("Advice" "^\\s-*(def\\(?:\\(?:ine-\\)?advice\\))") ("Advice" "^\\s-*(def\\(?:\\(?:ine-\\)?advice\\))")
("Modes" "^\\s-*(define-\\(?:global\\(?:ized\\)?-minor\\|generic\\|minor\\)-mode +\\([^ ()\n]+\\)" 1) ("Modes" "^\\s-*(define-\\(?:global\\(?:ized\\)?-minor\\|generic\\|minor\\)-mode +\\([^ ()\n]+\\)" 1)
("Macros" "^\\s-*(\\(?:cl-\\)?def\\(?:ine-compile-macro\\|macro\\) +\\([^ )\n]+\\)" 1) ("Macros" "^\\s-*(\\(?:cl-\\)?def\\(?:ine-compile-macro\\|macro\\) +\\([^ )\n]+\\)" 1)
("Inline Functions" "\\s-*(\\(?:cl-\\)?defsubst +\\([^ )\n]+\\)" 1) ("Inline functions" "\\s-*(\\(?:cl-\\)?defsubst +\\([^ )\n]+\\)" 1)
("Functions" "^\\s-*(\\(?:cl-\\)?def\\(?:un\\|un\\*\\|method\\|generic\\|-memoized!\\) +\\([^ ,)\n]+\\)" 1) ("Functions" "^\\s-*(\\(?:cl-\\)?def\\(?:un\\|un\\*\\|method\\|generic\\|-memoized!\\) +\\([^ ,)\n]+\\)" 1)
("Variables" "^\\s-*(\\(def\\(?:c\\(?:onst\\(?:ant\\)?\\|ustom\\)\\|ine-symbol-macro\\|parameter\\|var\\(?:-local\\)?\\)\\)\\s-+\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)" 2) ("Variables" "^\\s-*(\\(def\\(?:c\\(?:onst\\(?:ant\\)?\\|ustom\\)\\|ine-symbol-macro\\|parameter\\|var\\(?:-local\\)?\\)\\)\\s-+\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)" 2)
("Types" "^\\s-*(\\(cl-def\\(?:struct\\|type\\)\\|def\\(?:class\\|face\\|group\\|ine-\\(?:condition\\|error\\|widget\\)\\|package\\|struct\\|t\\(?:\\(?:hem\\|yp\\)e\\)\\)\\)\\s-+'?\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)" 2)))) ("Types" "^\\s-*(\\(cl-def\\(?:struct\\|type\\)\\|def\\(?:class\\|face\\|group\\|ine-\\(?:condition\\|error\\|widget\\)\\|package\\|struct\\|t\\(?:\\(?:hem\\|yp\\)e\\)\\)\\)\\s-+'?\\(\\(?:\\sw\\|\\s_\\|\\\\.\\)+\\)" 2))))

View file

@ -60,7 +60,7 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
(font-lock-add-keywords (font-lock-add-keywords
'emacs-lisp-mode 'emacs-lisp-mode
(append `(;; custom Doom cookies (append `(;; custom Doom cookies
("^;;;###\\(autodef\\|if\\)[ \n]" (1 font-lock-warning-face t))) ("^;;;###\\(autodef\\|if\\|package\\)[ \n]" (1 font-lock-warning-face t)))
;; highlight defined, special variables & functions ;; highlight defined, special variables & functions
(when +emacs-lisp-enable-extra-fontification (when +emacs-lisp-enable-extra-fontification
`((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face))))) `((+emacs-lisp-highlight-vars-and-faces . +emacs-lisp--face)))))

View file

@ -429,7 +429,11 @@ controlled by `+doom-dashboard-pwd-policy'."
(with-temp-buffer (with-temp-buffer
(save-excursion (insert (key-description key))) (save-excursion (insert (key-description key)))
(while (re-search-forward "<\\([^>]+\\)>" nil t) (while (re-search-forward "<\\([^>]+\\)>" nil t)
(replace-match (upcase (substring (match-string 1) 0 3)))) (let ((str (match-string 1)))
(replace-match
(upcase (if (< (length str) 3)
str
(substring str 0 3))))))
(propertize (buffer-string) 'face 'font-lock-constant-face))) (propertize (buffer-string) 'face 'font-lock-constant-face)))
"")))) ""))))
(if (display-graphic-p) (if (display-graphic-p)