Minor refactor & reformatting across the board

This commit is contained in:
Henrik Lissner 2020-04-08 15:29:29 -04:00
parent 2957f5ff28
commit b78fc4eb76
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
27 changed files with 189 additions and 164 deletions

View file

@ -49,8 +49,7 @@
;; Packages
(after! company-files
(pushnew! company-files--regexps
"file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
(add-to-list 'company-files--regexps "file:\\(\\(?:\\.\\{1,2\\}/\\|~/\\|/\\)[^\]\n]*\\)"))
(use-package! company-prescient

View file

@ -122,7 +122,14 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
'(:columns
((counsel-describe-variable-transformer (:width 40)) ; the original transformer
(+ivy-rich-describe-variable-transformer (:width 50))
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face)))))
(ivy-rich-counsel-variable-docstring (:face font-lock-doc-face))))
'counsel-M-x
'(:columns
((counsel-M-x-transformer (:width 60))
(ivy-rich-counsel-function-docstring (:face font-lock-doc-face))))
;; Apply switch buffer transformers to `counsel-projectile-switch-to-buffer' as well
'counsel-projectile-switch-to-buffer
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
;; Remove built-in coloring of buffer list; we do our own
(setq ivy-switch-buffer-faces-alist nil)
@ -135,11 +142,6 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(when switch-buffer-alist
(setcar switch-buffer-alist '+ivy-rich-buffer-name)))
;; Apply switch buffer transformers to `counsel-projectile-switch-to-buffer' as well
(plist-put! ivy-rich-display-transformers-list
'counsel-projectile-switch-to-buffer
(plist-get ivy-rich-display-transformers-list 'ivy-switch-buffer))
(ivy-rich-mode +1))
@ -153,9 +155,10 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(all-the-icons-ivy-setup)
(after! counsel-projectile
(let ((all-the-icons-ivy-file-commands '(counsel-projectile
counsel-projectile-find-file
counsel-projectile-find-dir)))
(let ((all-the-icons-ivy-file-commands
'(counsel-projectile
counsel-projectile-find-file
counsel-projectile-find-dir)))
(all-the-icons-ivy-setup))))
@ -336,8 +339,9 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(use-package! ivy-prescient
:hook (ivy-mode . ivy-prescient-mode)
:when (featurep! +prescient)
:hook (ivy-mode . ivy-prescient-mode)
:hook (ivy-prescient-mode . prescient-persist-mode)
:init
(setq prescient-filter-method
(if (featurep! +fuzzy)
@ -354,8 +358,7 @@ evil-ex-specific constructs, so we disable it solely in evil-ex."
(ivy-prescient-re-builder str)))
;; NOTE prescient config duplicated with `company'
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el"))
(prescient-persist-mode +1))
(setq prescient-save-file (concat doom-cache-dir "prescient-save.el")))
;;;###package swiper

View file

@ -255,7 +255,6 @@
:desc "M-x" ":" #'execute-extended-command
:desc "Pop up scratch buffer" "x" #'doom/open-scratch-buffer
:desc "Org Capture" "X" #'org-capture
;; C-u is used by evil
:desc "Universal argument" "u" #'universal-argument
:desc "window" "w" evil-window-map
@ -264,12 +263,10 @@
(:when (featurep! :ui popup)
:desc "Toggle last popup" "~" #'+popup/toggle)
:desc "Find file" "." #'find-file
:desc "Switch buffer" "," #'switch-to-buffer
(:when (featurep! :ui workspaces)
:desc "Switch workspace buffer" "," #'persp-switch-to-buffer
:desc "Switch buffer" "<" #'switch-to-buffer)
:desc "Switch to last buffer" "`" #'evil-switch-to-windows-last-buffer
:desc "Resume last search" "'"
(cond ((featurep! :completion ivy) #'ivy-resume)

View file

@ -35,7 +35,7 @@
(defun +default/yank-buffer-filename ()
"Copy the current buffer's path to the kill ring."
(interactive)
(if-let* ((filename (or buffer-file-name (bound-and-true-p list-buffers-directory))))
(if-let (filename (or buffer-file-name (bound-and-true-p list-buffers-directory)))
(message (kill-new (abbreviate-file-name filename)))
(error "Couldn't find filename in current buffer")))

View file

@ -56,6 +56,7 @@ Run one of the following commands.
#+BEGIN_SRC sh
sudo pacman -S isync # mbsync
# OR
sudo pacman -S offlineimap
#+END_SRC

View file

@ -97,7 +97,8 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
"v" #'find-variable
"l" #'find-library)))
;; Adapted from http://www.modernemacs.com/post/comint-highlighting/
;; Adapted from http://www.modernemacs.com/post/comint-highlighting/ to add
;; syntax highlighting to ielm REPLs.
(add-hook! 'ielm-mode-hook
(defun +emacs-lisp-init-syntax-highlighting-h ()
(font-lock-add-keywords
@ -122,7 +123,7 @@ This marks a foldable marker for `outline-minor-mode' in elisp buffers.")
;;;###package overseer
(autoload 'overseer-test "overseer" nil t)
(remove-hook 'emacs-lisp-mode-hook 'overseer-enable-mode)
(remove-hook 'emacs-lisp-mode-hook #'overseer-enable-mode)
(use-package! flycheck-cask

View file

@ -3,16 +3,16 @@
(use-package! intero
:commands intero-mode
:init
(add-hook! 'haskell-mode-local-vars-hook
(defun +haskell-init-intero-h ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
This is necessary because `intero-mode' doesn't do its own error checks."
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode.")))))
:hook (haskell-mode-local-vars . +haskell-init-intero-h)
:config
(defun +haskell-init-intero-h ()
"Initializes `intero-mode' in haskell-mode, unless stack isn't installed.
This is necessary because `intero-mode' doesn't do its own error checks."
(when (derived-mode-p 'haskell-mode)
(if (executable-find "stack")
(intero-mode +1)
(message "Couldn't find stack. Refusing to enable intero-mode."))))
(setq haskell-compile-cabal-build-command "stack build --fast")
(set-lookup-handlers! 'intero-mode :definition #'intero-goto-definition)
(set-company-backend! 'intero-mode 'intero-company)

View file

@ -6,9 +6,8 @@
:config
(when IS-MAC
(setq lsp-haskell-process-path-hie "hie-wrapper"))
;; Does some strange indentation if it pastes in the snippet
(setq-hook! 'haskell-mode-hook yas-indent-line 'fixed)
(when (featurep! +ghcide)
(setq lsp-haskell-process-path-hie "ghcide"
lsp-haskell-process-args-hie nil)))
lsp-haskell-process-args-hie nil))
;; Does some strange indentation if it pastes in the snippet
(setq-hook! 'haskell-mode-hook yas-indent-line 'fixed))

View file

@ -11,8 +11,8 @@
"An alist mapping languages to babel libraries. This is necessary for babel
libraries (ob-*.el) that don't match the name of the language.
For example, with (fish . shell) will cause #+BEGIN_SRC fish to load ob-shell.el
when executed.")
For example, (fish . shell) will cause #+BEGIN_SRC fish blocks to load
ob-shell.el when executed.")
(defvar +org-babel-load-functions ()
"A list of functions executed to load the current executing src block. They

View file

@ -22,7 +22,6 @@
(:map org-journal-search-mode-map
"C-n" #'org-journal-search-next
"C-p" #'org-journal-search-previous)
:localleader
(:map org-journal-mode-map
"c" #'org-journal-new-entry

View file

@ -11,7 +11,7 @@
;;; Packages
(use-package! sh-script ; built-in
:mode ("\\.zunit\\'" . sh-mode)
:mode ("\\.\\(?:zunit\\|env\\)\\'" . sh-mode)
:mode ("/bspwmrc\\'" . sh-mode)
:config
(set-electric! 'sh-mode :words '("else" "elif" "fi" "done" "then" "do" "esac" ";;"))

View file

@ -24,10 +24,9 @@
(add-hook! '(css-mode-hook sass-mode-hook stylus-mode-hook)
#'rainbow-mode)
;; built-in, and contains both css-mode & scss-mode
;; built-in. Contains both css-mode & scss-mode
(after! css-mode
;; css-mode hooks apply to scss and less-css modes
(add-hook 'css-mode-hook #'rainbow-delimiters-mode)
(map! :localleader
:map scss-mode-map
"b" #'+css/scss-build
@ -61,5 +60,7 @@
;;; Tools
(when (featurep! +lsp)
(add-hook! '(css-mode-hook sass-mode-hook less-css-mode-hook)
(add-hook! '(css-mode-local-vars-hook
sass-mode-local-vars-hook
less-css-mode-local-vars-hook)
#'lsp!))

View file

@ -33,7 +33,7 @@ extension, try to guess one."
(file-name-extension buffer-file-name))
buffer-file-name
(format "%s%s" (buffer-file-name (buffer-base-buffer))
(if-let* ((ext (cdr (assq major-mode +editorconfig-mode-alist))))
(if-let (ext (alist-get major-mode +editorconfig-mode-alist))
(concat "." ext)
"")))))
(funcall orig-fn)))

View file

@ -62,30 +62,31 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
(dolist (mode (doom-enlist modes))
(let ((hook (intern (format "%s-hook" mode)))
(fn (intern (format "+lookup--init-%s-handlers-h" mode))))
(cond ((null (car plist))
(remove-hook hook fn)
(unintern fn nil))
((fset
fn
(lambda ()
(cl-destructuring-bind (&key definition references documentation file xref-backend async)
plist
(cl-mapc #'+lookup--set-handler
(list definition
references
documentation
file
xref-backend)
(list '+lookup-definition-functions
'+lookup-references-functions
'+lookup-documentation-functions
'+lookup-file-functions
'xref-backend-functions)
(make-list 5 async)
(make-list 5 (or (eq major-mode mode)
(and (boundp mode)
(symbol-value mode))))))))
(add-hook hook fn))))))
(if (null (car plist))
(progn
(remove-hook hook fn)
(unintern fn nil))
(fset
fn
(lambda ()
(cl-destructuring-bind (&key definition references documentation file xref-backend async)
plist
(cl-mapc #'+lookup--set-handler
(list definition
references
documentation
file
xref-backend)
(list '+lookup-definition-functions
'+lookup-references-functions
'+lookup-documentation-functions
'+lookup-file-functions
'xref-backend-functions)
(make-list 5 async)
(make-list 5 (or (eq major-mode mode)
(and (boundp mode)
(symbol-value mode))))))))
(add-hook hook fn)))))
;;

View file

@ -70,7 +70,7 @@
(set-popup-rule! "^\\(?:\\*magit\\|magit:\\| \\*transient\\*\\)" :ignore t)
(add-hook 'magit-popup-mode-hook #'hide-mode-line-mode)
;; Add --tags switch
;; Add additional switches that seem common enough
(transient-append-suffix 'magit-fetch "-p"
'("-t" "Fetch all tags" ("-t" "--tags")))
(transient-append-suffix 'magit-pull "-r"

View file

@ -1,5 +1,10 @@
;;; ui/doom/config.el -*- lexical-binding: t; -*-
;;;###package pos-tip
(setq pos-tip-internal-border-width 6
pos-tip-border-width 1)
(use-package! doom-themes
:defer t
:init

View file

@ -1,5 +1,7 @@
;;; ui/fill-column/autoload.el -*- lexical-binding: t; -*-
;; DEPRECATED Replaced by `display-fill-column-indicator-mode' in Emacs 27+
;;;###autoload (autoload 'hl-fill-column-mode "hl-fill-column" nil t)
;;;###autoload

View file

@ -110,6 +110,7 @@ prevent the popup(s) from messing up the UI (or vice versa)."
`(let* ((in-popup-p (+popup-buffer-p))
(popups (+popup-windows))
(+popup--inhibit-transient t)
buffer-list-update-hook
+popup--last)
(dolist (p popups)
(+popup/close p 'force))

View file

@ -3,6 +3,7 @@
(defun +treemacs--init ()
(require 'treemacs)
(let ((origin-buffer (current-buffer)))
;; Toggle treemacs without prompting for the first project.
(cl-letf (((symbol-function 'treemacs-workspace->is-empty?)
(symbol-function 'ignore)))
(treemacs--init))