Minor refactoring across the board

This commit is contained in:
Henrik Lissner 2021-05-23 21:48:38 -04:00
parent a8e57438dc
commit 3ba364ae10
12 changed files with 63 additions and 48 deletions

View file

@ -1,7 +1,10 @@
;;; completion/company/config.el -*- lexical-binding: t; -*-
(use-package! company
:commands company-complete-common company-manual-begin company-grab-line
:commands (company-complete-common
company-complete-common-or-cycle
company-manual-begin
company-grab-line)
:hook (doom-first-input . global-company-mode)
:init
(setq company-minimum-prefix-length 2
@ -37,6 +40,9 @@
company-dabbrev-ignore-case nil
company-dabbrev-downcase nil)
(when (featurep! +tng)
(add-hook 'global-company-mode-hook #'company-tng-mode))
:config
(when (featurep! :editor evil)
(add-hook 'company-mode-hook #'evil-normalize-keymaps)
@ -60,8 +66,6 @@
(add-hook 'after-change-major-mode-hook #'+company-init-backends-h 'append)
(when (featurep! +tng)
(company-tng-mode +1))
;; NOTE Fix #1335: ensure `company-emulation-alist' is the first item of
;; `emulation-mode-map-alists', thus higher priority than keymaps of

View file

@ -38,7 +38,8 @@ directives. By default, this only recognizes C directives.")
evil-mode-line-format 'nil
;; more vim-like behavior
evil-symbol-word-search t
;; cursor appearance
;; if the current state is obvious from the cursor's color/shape, then
;; we won't need superfluous indicators to do it instead.
evil-default-cursor '+evil-default-cursor-fn
evil-normal-state-cursor 'box
evil-emacs-state-cursor '(box +evil-emacs-cursor-fn)
@ -310,7 +311,7 @@ directives. By default, this only recognizes C directives.")
(use-package! evil-escape
:commands evil-escape
:after-call pre-command-hook
:hook (doom-first-input . evil-escape-mode)
:init
(setq evil-escape-excluded-states '(normal visual multiedit emacs motion)
evil-escape-excluded-major-modes '(neotree-mode treemacs-mode vterm-mode)
@ -318,15 +319,14 @@ directives. By default, this only recognizes C directives.")
evil-escape-delay 0.15)
(evil-define-key* '(insert replace visual operator) 'global "\C-g" #'evil-escape)
:config
;; no `evil-escape' in minibuffer, unless `evil-collection-setup-minibuffer'
;; is enabled, where we could be in insert mode in the minibuffer.
;; `evil-escape' in the minibuffer is more disruptive than helpful. That is,
;; unless we have `evil-collection-setup-minibuffer' enabled, in which case we
;; want the same behavior in insert mode as we do in normal buffers.
(add-hook! 'evil-escape-inhibit-functions
(defun +evil-inhibit-escape-in-minibuffer-fn ()
(and (minibufferp)
(or (not (bound-and-true-p evil-collection-setup-minibuffer))
(evil-normal-state-p)))))
;; so that evil-escape-mode-hook runs, and can be toggled by evil-mc
(evil-escape-mode +1))
(evil-normal-state-p))))))
(use-package! evil-exchange
@ -351,20 +351,16 @@ directives. By default, this only recognizes C directives.")
(use-package! evil-snipe
:commands (evil-snipe-mode
evil-snipe-override-mode
evil-snipe-local-mode
evil-snipe-override-local-mode)
:after-call pre-command-hook
:commands evil-snipe-local-mode evil-snipe-override-local-mode
:hook (doom-first-input . evil-snipe-override-mode)
:hook (doom-first-input . evil-snipe-mode)
:init
(setq evil-snipe-smart-case t
evil-snipe-scope 'line
evil-snipe-repeat-scope 'visible
evil-snipe-char-fold t)
:config
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode 'treemacs-mode)
(evil-snipe-mode +1)
(evil-snipe-override-mode +1))
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode 'treemacs-mode))
(use-package! evil-surround

View file

@ -1,18 +1,18 @@
;; -*- no-byte-compile: t; -*-
;;; editor/parinfer/packages.el
(when (and (not (featurep! +rust)) (featurep! :editor evil))
;; Parinfer uses `evil-define-key' without loading evil, so if evil is
;; installed *after* parinfer, parinfer will throw up void-function errors.
;; because evil-define-key (a macro) wasn't expanded at compile-time. So we
;; make sure evil is installed before parinfer...
(package! evil)
;; ...and that it can see `evil-define-key' if evil was installed in a
;; separate session:
(autoload 'evil-define-key "evil-core" nil nil 'macro))
(if (featurep! +rust)
(package! parinfer-rust-mode :pin "f130fa04ec75131686872f24a253d0a1d5522fa4")
(when (featurep! :editor evil)
;; Parinfer uses `evil-define-key' without loading evil, so if evil is
;; installed *after* parinfer, parinfer will throw up void-function errors.
;; because evil-define-key (a macro) wasn't expanded at compile-time. So we
;; make sure evil is installed before parinfer...
(package! evil)
;; ...and that it can see `evil-define-key' if evil was installed in a
;; separate session:
(autoload 'evil-define-key "evil-core" nil nil 'macro))
(package! parinfer
:recipe (:host github :repo "emacsattic/parinfer")
:pin "8659c99a9475ee34af683fdf8f272728c6bebb3a"))

View file

@ -2,5 +2,6 @@
;;; editor/rotate-text/packages.el
(package! rotate-text
:recipe (:host github :repo "debug-ito/rotate-text.el")
:recipe (:host github
:repo "debug-ito/rotate-text.el")
:pin "48f193697db996855aee1ad2bc99b38c6646fe76")

View file

@ -172,10 +172,12 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
(defun +emacs-lisp/buttercup-run-file ()
"Run all buttercup tests in the focused buffer."
(interactive)
(let ((load-path (append (list (doom-path (dir!) "..")
(or (doom-project-root)
default-directory))
load-path)))
(let ((load-path
(append (list (doom-path (dir!) "..")
(or (doom-project-root)
default-directory))
load-path))
(buttercup-suites nil))
(save-selected-window
(eval-buffer)
(buttercup-run))
@ -188,7 +190,8 @@ https://emacs.stackexchange.com/questions/10230/how-to-indent-keywords-aligned"
(let* ((default-directory (doom-project-root))
(load-path (append (list (doom-path "test")
default-directory)
load-path)))
load-path))
(buttercup-suites nil))
(buttercup-run-discover)))
;;;###autoload

View file

@ -6,11 +6,9 @@
(use-package! doom-themes
:defer t
:init
(setq doom-theme 'doom-one)
;; improve integration w/ org-mode
(add-hook 'doom-load-theme-hook #'doom-themes-org-config)
:hook (doom-load-theme . doom-themes-org-config)
:init (setq doom-theme 'doom-one)
;; more Atom-esque file icons for neotree/treemacs
(when (featurep! :ui neotree)
(add-hook 'doom-load-theme-hook #'doom-themes-neotree-config)