2022-06-19 14:13:36 -08:00
|
|
|
;;; mitch-packages --- Declare and configure use-package statements
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
;; -----------------------------------------------------------------------------
|
|
|
|
;; This is a file in which I put declarations for packages and things.
|
|
|
|
;; -----------------------------------------------------------------------------
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
;; diminish
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package diminish)
|
|
|
|
(use-package eldoc
|
2022-07-16 17:55:54 -08:00
|
|
|
:straight (:type built-in)
|
2022-08-24 19:22:08 -08:00
|
|
|
:diminish
|
2022-06-19 14:13:36 -08:00
|
|
|
:defer 1
|
2022-11-15 10:43:38 -09:00
|
|
|
:custom (eldoc-echo-area-use-multiline-p nil))
|
2022-11-15 10:47:59 -09:00
|
|
|
|
|
|
|
;; save minibuffer history, see Vertico below
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package savehist
|
2022-07-16 17:55:54 -08:00
|
|
|
:straight (:type built-in)
|
2022-09-24 18:59:24 -08:00
|
|
|
:init (savehist-mode)
|
|
|
|
:custom (savehist-file
|
|
|
|
(expand-file-name "minibuffer-history" backup-directory)))
|
2022-11-15 10:49:15 -09:00
|
|
|
|
2022-10-07 19:37:49 -08:00
|
|
|
;; save place in all files
|
2022-09-07 06:09:59 -08:00
|
|
|
(use-package saveplace
|
|
|
|
:straight (:type built-in)
|
|
|
|
:init (save-place-mode t)
|
|
|
|
:custom
|
|
|
|
(save-place-file
|
2022-10-07 19:37:49 -08:00
|
|
|
(expand-file-name "file-position-save" backup-directory)))
|
2022-09-24 19:02:11 -08:00
|
|
|
(use-package tramp
|
|
|
|
:straight (:type built-in)
|
|
|
|
:custom (tramp-persistency-file-name
|
|
|
|
(expand-file-name "tramp-history" backup-directory)))
|
2022-08-27 21:47:33 -08:00
|
|
|
;; Visualize whitespace. In a very chill and invisible way.
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package whitespace
|
2022-07-16 17:55:54 -08:00
|
|
|
:straight (:type built-in)
|
2022-11-15 10:44:12 -09:00
|
|
|
:diminish (whitespace-mode org-indent-mode org-vw-mode auto-fill-mode)
|
2022-07-16 17:55:54 -08:00
|
|
|
:custom
|
|
|
|
(whitespace-style '(face lines-tail))
|
|
|
|
(whitespace-line-column 80)
|
2022-10-26 09:45:24 -08:00
|
|
|
(fill-column whitespace-line-column)
|
|
|
|
:hook
|
|
|
|
(prog-mode . whitespace-mode)
|
2022-11-15 10:44:12 -09:00
|
|
|
(org-mode . auto-fill-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package image-mode
|
2022-07-16 17:55:54 -08:00
|
|
|
:straight (:type built-in)
|
|
|
|
:config
|
|
|
|
(turn-off-line-numbers)
|
|
|
|
(blink-cursor-mode -1))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-08-24 19:27:47 -08:00
|
|
|
;; ...and finally, sync files with disk changes
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package autorevert
|
2022-08-24 19:27:47 -08:00
|
|
|
:straight (:type built-in)
|
|
|
|
:diminish auto-revert-mode
|
|
|
|
:config (global-auto-revert-mode))
|
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
;; Keybinding manager
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package general
|
2022-08-24 19:28:10 -08:00
|
|
|
:straight t
|
2022-06-19 14:13:36 -08:00
|
|
|
:config (mitch/general-config))
|
|
|
|
|
2022-09-30 12:51:08 -08:00
|
|
|
(use-package use-package-ensure-system-package)
|
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
;; load evil
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package evil
|
2022-06-19 14:13:36 -08:00
|
|
|
:general
|
2022-10-09 11:52:06 -08:00
|
|
|
;; Visual lines. Redefined for auto-scrolling madness.
|
2022-06-19 14:13:36 -08:00
|
|
|
(general-define-key
|
|
|
|
:states 'normal
|
|
|
|
"<escape>" 'evil-beginning-of-line
|
2022-10-12 15:26:40 -08:00
|
|
|
"j" 'evil-next-visual-line
|
|
|
|
"k" 'evil-previous-visual-line
|
2022-10-10 12:16:37 -08:00
|
|
|
"C-n" 'move-screen-up-line
|
|
|
|
"C-p" 'move-screen-down-line)
|
2022-06-19 14:13:36 -08:00
|
|
|
(general-define-key
|
|
|
|
:states 'insert
|
|
|
|
"C-w" 'evil-window-map
|
|
|
|
"C-V" (general-key-dispatch
|
2022-07-05 20:56:48 -08:00
|
|
|
'evil-quoted-insert
|
|
|
|
"u" 'insert-char))
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish visual-line-mode
|
|
|
|
:custom
|
|
|
|
(evil-want-integration t)
|
|
|
|
(evil-want-keybinding nil)
|
|
|
|
(evil-want-C-u-scroll nil)
|
|
|
|
(evil-want-C-i-jump nil)
|
|
|
|
(evil-vsplit-window-right t)
|
|
|
|
(evil-split-window-below t)
|
|
|
|
(evil-undo-system
|
|
|
|
(if (>= (string-to-number emacs-version) 28)
|
|
|
|
(quote undo-redo)
|
|
|
|
(quote undo-fu)))
|
2022-10-14 11:43:01 -08:00
|
|
|
:init (evil-mode t)
|
|
|
|
:config (mitch/evil-config))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package evil-collection
|
2022-08-24 19:28:10 -08:00
|
|
|
:straight t
|
2022-06-19 14:13:36 -08:00
|
|
|
:after evil
|
|
|
|
:diminish evil-collection-unimpaired-mode
|
|
|
|
:config (evil-collection-init))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package evil-commentary
|
2022-08-24 19:28:10 -08:00
|
|
|
:straight t
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish 'evil-commentary-mode
|
|
|
|
:config (evil-commentary-mode)
|
2022-06-22 06:41:28 -08:00
|
|
|
:hook (prog-mode . evil-commentary-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package evil-surround
|
2022-08-24 19:28:10 -08:00
|
|
|
:straight t
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish 'global-evil-surround-mode
|
2022-06-22 06:41:28 -08:00
|
|
|
:hook (prog-mode . evil-surround-mode)
|
2022-06-19 14:13:36 -08:00
|
|
|
:config (global-evil-surround-mode 1))
|
2022-09-25 12:42:35 -08:00
|
|
|
(use-package evil-matchit
|
|
|
|
:straight t
|
|
|
|
:diminish 'evil-matchit-mode
|
|
|
|
:config (global-evil-matchit-mode 1))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package evil-terminal-cursor-changer
|
2022-08-24 19:28:10 -08:00
|
|
|
:straight t
|
2022-06-19 14:13:36 -08:00
|
|
|
:after evil
|
|
|
|
:diminish
|
|
|
|
:if (not (display-graphic-p))
|
2022-11-06 19:37:47 -09:00
|
|
|
:custom
|
|
|
|
(evil-motion-state-cursor 'box) ; █
|
|
|
|
(evil-visual-state-cursor 'box) ; █
|
|
|
|
(evil-normal-state-cursor 'box) ; █
|
|
|
|
(evil-insert-state-cursor 'bar) ; ⎸
|
|
|
|
(evil-emacs-state-cursor 'hbar) ; _
|
2022-06-19 14:13:36 -08:00
|
|
|
:config
|
|
|
|
(evil-terminal-cursor-changer-activate)
|
|
|
|
(xterm-mouse-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package undo-fu
|
2022-06-19 14:13:36 -08:00
|
|
|
:after evil
|
2022-07-05 20:56:48 -08:00
|
|
|
:if (< (string-to-number emacs-version) 28)
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish)
|
|
|
|
|
2022-08-27 21:47:33 -08:00
|
|
|
;; eshell. Pretty good actually.
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package eshell
|
2022-08-27 21:47:33 -08:00
|
|
|
:straight (:type built-in)
|
|
|
|
:commands (eshell/emacs eshell/man)
|
2022-10-10 13:35:05 -08:00
|
|
|
:custom
|
|
|
|
(eshell-scroll-to-bottom-on-input t)
|
|
|
|
(eshell-hist-ignoredups t)
|
2022-08-27 21:47:33 -08:00
|
|
|
:config
|
2022-11-20 13:44:19 -09:00
|
|
|
(evil-collection-define-key 'insert 'eshell-mode-map
|
|
|
|
(kbd "C-c") 'eshell-interrupt-process)
|
2022-08-27 21:47:33 -08:00
|
|
|
(add-to-list 'eshell-modules-list 'eshell-rebind)
|
|
|
|
(defun eshell-evil-insert-line (count &optional vcount)
|
|
|
|
(interactive "p")
|
|
|
|
(eshell-bol)
|
|
|
|
(evil-insert count vcount))
|
|
|
|
(defun eshell/emacs (&rest args)
|
|
|
|
"Basically you can edit ARGS and it will open in a new buffer.
|
|
|
|
When your shell is Emacs, your Emacs is but an oyster...
|
|
|
|
This is taken from a website that I can't remember at the moment."
|
2022-08-28 14:25:26 -08:00
|
|
|
(if (null args) (bury-buffer)
|
|
|
|
(mapc #'find-file-other-window
|
2022-10-07 19:37:49 -08:00
|
|
|
(mapcar #'expand-file-name (flatten-tree (reverse args))))))
|
2022-11-05 12:52:11 -08:00
|
|
|
(defun aweshell-sudo-toggle ()
|
|
|
|
"Toggle sudo with current command."
|
|
|
|
(interactive)
|
|
|
|
(save-excursion
|
|
|
|
(let ((commands (buffer-substring-no-properties
|
|
|
|
(progn (eshell-bol) (point)) (point-max))))
|
|
|
|
(if (string-match-p "^sudo " commands)
|
|
|
|
(progn
|
|
|
|
(eshell-bol)
|
|
|
|
(while (re-search-forward "sudo " nil t)
|
|
|
|
(replace-match "" t nil)))
|
|
|
|
(progn
|
|
|
|
(eshell-bol)
|
2022-11-20 13:44:19 -09:00
|
|
|
(insert "sudo ")))))))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package eshell-vterm
|
2022-08-27 21:47:33 -08:00
|
|
|
:after eshell
|
|
|
|
:custom (eshell-destroy-buffer-when-process-dies t)
|
|
|
|
:hook (eshell-mode . eshell-vterm-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package eshell-syntax-highlighting
|
2022-10-04 17:57:54 -08:00
|
|
|
:after eshell
|
2022-11-05 12:52:11 -08:00
|
|
|
:hook (eshell-mode . eshell-syntax-highlighting-mode)
|
|
|
|
:config
|
|
|
|
;; Make cat with syntax highlight.
|
|
|
|
(defun aweshell-cat-with-syntax-highlight (filename)
|
|
|
|
"Like cat(1) but with syntax highlighting.
|
|
|
|
|
|
|
|
Taken from https://github.com/manateelazycat/aweshell/blob/d246df619573ca3f46070cc0ac82d024271ed243/aweshell.el#L775"
|
|
|
|
(let ((existing-buffer (get-file-buffer filename))
|
|
|
|
(buffer (find-file-noselect filename)))
|
|
|
|
(eshell-print
|
|
|
|
(with-current-buffer buffer
|
|
|
|
(if (fboundp 'font-lock-ensure)
|
|
|
|
(font-lock-ensure)
|
|
|
|
(with-no-warnings
|
|
|
|
(font-lock-fontify-buffer)))
|
|
|
|
(let ((contents (buffer-string)))
|
|
|
|
(remove-text-properties 0 (length contents) '(read-only nil) contents)
|
|
|
|
contents)))
|
|
|
|
(unless existing-buffer
|
2022-11-15 10:49:15 -09:00
|
|
|
(kill-buffer buffer)) nil))
|
2022-11-19 17:13:58 -09:00
|
|
|
;; helpers for catimg below
|
|
|
|
(defun esh-catimg--imagep (filename)
|
|
|
|
"Check if FILENAME is an image. Helper for `esh-catimg--image-print'.
|
|
|
|
|
|
|
|
Taken from https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode "
|
|
|
|
(let ((extension (file-name-extension filename))
|
|
|
|
(image-extensions '("png" "jpg" "bmp")))
|
|
|
|
(member extension image-extensions)))
|
|
|
|
(defun esh-catimg--image-width (filename)
|
|
|
|
"Get the pixel (?) width of the image FILENAME, using imagemagick. Helper
|
|
|
|
for `esh-catimg--image-print'.
|
|
|
|
|
|
|
|
Taken from https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode "
|
|
|
|
(string-to-number
|
|
|
|
(shell-command-to-string
|
|
|
|
(format "convert '%s' -ping -format \"%%w\" info:" filename))))
|
|
|
|
(defun esh-catimg--rescale-image (filename)
|
|
|
|
"Rescale an image to a maximum width, or leave untouched if already small.
|
|
|
|
Returns the new file path. Helper for `esh-catimg--image-print'.
|
|
|
|
|
|
|
|
Taken from https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode "
|
|
|
|
(let ((file (make-temp-file "resized_emacs"))
|
|
|
|
(max-width 350))
|
|
|
|
(if (> (esh-catimg--image-width filename) max-width)
|
|
|
|
(progn
|
|
|
|
(shell-command-to-string
|
|
|
|
(format "convert -resize %dx '%s' '%s'" max-width filename file))
|
|
|
|
file)
|
|
|
|
filename)))
|
|
|
|
(defun esh-catimg--image-print (file)
|
|
|
|
"Print the single image FILE.
|
|
|
|
|
|
|
|
Taken from https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode "
|
|
|
|
(eshell/printnl (propertize " " 'display (create-image file))))
|
2022-11-05 12:52:11 -08:00
|
|
|
(defun eshell/cat (&rest args)
|
2022-11-19 17:13:58 -09:00
|
|
|
"Wrapper around `aweshell-cat-with-syntax-highlight' for multiple ARGS.
|
|
|
|
|
|
|
|
Also, can cat images for some reason.
|
|
|
|
|
2022-11-20 16:48:47 -09:00
|
|
|
See:
|
|
|
|
https://github.com/manateelazycat/aweshell/blob/d246df619573ca3f46070cc0ac82d024271ed243/aweshell.el#L775
|
|
|
|
https://emacs.stackexchange.com/questions/3432/display-images-in-eshell-with-iimage-mode "
|
2022-11-05 12:52:11 -08:00
|
|
|
(setq args (eshell-stringify-list (flatten-tree args)))
|
|
|
|
(dolist (file args)
|
|
|
|
(if (string= file "-")
|
|
|
|
(throw 'eshell-external
|
|
|
|
(eshell-external-command "cat" args))
|
2022-11-19 17:13:58 -09:00
|
|
|
(if (esh-catimg--imagep file)
|
|
|
|
(esh-catimg--image-print (esh-catimg--rescale-image file))
|
|
|
|
(aweshell-cat-with-syntax-highlight file))))))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package eshell-prompt-extras
|
2022-08-27 21:47:33 -08:00
|
|
|
:after eshell
|
|
|
|
:custom
|
|
|
|
(eshell-highlight-prompt nil)
|
|
|
|
(eshell-prompt-function 'epe-theme-multiline-with-status)
|
|
|
|
(epe-path-style 'full))
|
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package all-the-icons)
|
|
|
|
(use-package dirvish
|
2022-07-17 10:50:11 -08:00
|
|
|
:straight (:files (:defaults "extensions/*.el"))
|
2022-08-24 19:28:10 -08:00
|
|
|
:defer 0.5
|
|
|
|
:commands dirvish
|
2022-07-28 07:06:19 -08:00
|
|
|
:custom
|
|
|
|
(dirvish-attributes '(all-the-icons collapse))
|
|
|
|
(dirvish-cache-dir (expand-file-name ".dirvish/" user-emacs-directory))
|
2022-08-24 19:28:10 -08:00
|
|
|
(dired-listing-switches "-l --almost-all")
|
|
|
|
(dirvish-side-display-alist '((window-width . 0.15)
|
|
|
|
(slot . -1)
|
|
|
|
(side . left)))
|
|
|
|
:init (dirvish-override-dired-mode t)
|
|
|
|
:config
|
2022-07-17 10:50:11 -08:00
|
|
|
(general-define-key
|
|
|
|
:states 'normal
|
2022-07-20 17:31:42 -08:00
|
|
|
:keymaps 'dirvish-mode-map
|
2022-07-17 10:50:11 -08:00
|
|
|
"h" 'dired-up-directory
|
|
|
|
"l" 'dired-find-file
|
2022-11-17 14:43:06 -09:00
|
|
|
"/" 'dirvish-narrow
|
|
|
|
"q" 'dirvish-quit)
|
2022-07-17 10:50:11 -08:00
|
|
|
(general-define-key
|
|
|
|
:states 'normal
|
|
|
|
:prefix-command 'file-tree-map-prefix
|
|
|
|
:prefix-map 'file-tree-map
|
|
|
|
:prefix "SPC t"
|
|
|
|
"t" 'dirvish-side))
|
2022-07-20 17:31:42 -08:00
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
;; Completion framework...
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package vertico
|
2022-07-17 10:49:15 -08:00
|
|
|
:straight (:files (:defaults "extensions/vertico-mouse.el"))
|
2022-07-16 18:03:19 -08:00
|
|
|
:custom (vertico-resize t)
|
2022-08-29 05:47:01 -08:00
|
|
|
:init (vertico-mode t)
|
|
|
|
:config
|
2022-08-28 14:25:50 -08:00
|
|
|
(add-hook 'minibuffer-setup-hook 'turn-off-line-numbers)
|
|
|
|
(defun backspace-in-minibuffer ()
|
|
|
|
"If previous character is `/', kill to the previous `/'.
|
2022-10-06 10:24:25 -08:00
|
|
|
Otherwise, kill back 1 letter.
|
|
|
|
|
|
|
|
see https://www.reddit.com/r/emacs/comments/xq6rpa/comment/iqynyu9/?utm_source=share&utm_medium=web2x&context=3"
|
2022-08-28 14:25:50 -08:00
|
|
|
(interactive)
|
2022-10-06 10:24:25 -08:00
|
|
|
(if (string-match-p "/." (minibuffer-contents))
|
|
|
|
(let ((end (point)))
|
|
|
|
(re-search-backward "/.")
|
|
|
|
(forward-char)
|
|
|
|
(delete-region (point) end))
|
2022-08-28 14:25:50 -08:00
|
|
|
(backward-delete-char 1)))
|
|
|
|
:general
|
|
|
|
(general-define-key
|
|
|
|
:prefix-map 'minibuffer-mode-map
|
|
|
|
"DEL" 'backspace-in-minibuffer))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package vertico-mouse
|
2022-07-17 10:49:15 -08:00
|
|
|
:straight vertico
|
|
|
|
:after vertico
|
|
|
|
:config
|
2022-07-22 06:59:25 -08:00
|
|
|
(vertico-mouse-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package consult
|
2022-09-29 06:18:28 -08:00
|
|
|
:after vertico
|
|
|
|
:general
|
|
|
|
(general-define-key
|
|
|
|
[remap switch-to-buffer] 'consult-buffer))
|
2022-06-19 14:13:36 -08:00
|
|
|
;; Minibuffer generic stuff
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package marginalia
|
2022-07-22 06:59:25 -08:00
|
|
|
;; :custom (marginalia-separator " ")
|
2022-06-19 14:13:36 -08:00
|
|
|
:init (marginalia-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package orderless
|
2022-07-16 18:03:19 -08:00
|
|
|
:custom
|
|
|
|
(completion-styles '(orderless partial-completion basic))
|
|
|
|
(completion-category-defaults nil)
|
|
|
|
;; (completion-category-overrides '((file (styles basic partial-completion))))
|
2022-07-22 06:59:25 -08:00
|
|
|
(completion-category-overrides nil))
|
|
|
|
|
|
|
|
;; weird multi-path thing
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package embark
|
2022-07-22 16:24:12 -08:00
|
|
|
:general
|
|
|
|
(general-define-key
|
|
|
|
:keymap minibuffer-mode-map
|
|
|
|
"C-." 'embark-act
|
|
|
|
"C-;" 'embark-dwim)
|
2022-07-22 06:59:25 -08:00
|
|
|
:init
|
2022-10-04 17:57:54 -08:00
|
|
|
;; :TODO: Should we put this in the which-key section?
|
2022-07-22 06:59:25 -08:00
|
|
|
(defun embark-which-key-indicator ()
|
|
|
|
"An embark indicator that displays keymaps using which-key.
|
|
|
|
The which-key help message will show the type and value of the
|
|
|
|
current target followed by an ellipsis if there are further
|
|
|
|
targets."
|
2022-07-22 16:24:12 -08:00
|
|
|
(lambda (&optional keymap targets prefix)
|
|
|
|
(if (null keymap) (which-key--hide-popup-ignore-command)
|
2022-07-22 06:59:25 -08:00
|
|
|
(which-key--show-keymap
|
2022-07-22 16:24:12 -08:00
|
|
|
(if (eq (plist-get (car targets) :type) 'embark-become)
|
|
|
|
"Become"
|
2022-07-22 06:59:25 -08:00
|
|
|
(format "Act on %s '%s'%s" (plist-get (car targets) :type)
|
|
|
|
(embark--truncate-target (plist-get (car targets) :target))
|
|
|
|
(if (cdr targets) "…" "")))
|
|
|
|
(if prefix (pcase (lookup-key keymap prefix 'accept-default)
|
2022-08-24 19:28:10 -08:00
|
|
|
((and (pred keymapp) km) km)
|
|
|
|
(_ (key-binding prefix 'accept-default))) keymap)
|
2022-07-22 16:24:12 -08:00
|
|
|
nil nil t (lambda (binding)
|
2022-07-22 06:59:25 -08:00
|
|
|
(not (string-suffix-p "-argument" (cdr binding))))))))
|
|
|
|
(setq embark-indicators
|
|
|
|
'(embark-which-key-indicator
|
|
|
|
embark-highlight-indicator
|
|
|
|
embark-isearch-highlight-indicator))
|
|
|
|
(defun embark-hide-which-key-indicator (fn &rest args)
|
|
|
|
"Hide the which-key indicator immediately when using the completing-read prompter."
|
|
|
|
(which-key--hide-popup-ignore-command)
|
|
|
|
(let ((embark-indicators
|
|
|
|
(remq #'embark-which-key-indicator embark-indicators)))
|
|
|
|
(apply fn args)))
|
|
|
|
(advice-add #'embark-completing-read-prompter
|
|
|
|
:around #'embark-hide-which-key-indicator)
|
|
|
|
:config
|
|
|
|
(setq enable-recursive-minibuffers t))
|
|
|
|
;; Consult users will also want the embark-consult package.
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package embark-consult
|
2022-07-22 06:59:25 -08:00
|
|
|
:after (embark consult))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-07-27 07:09:43 -08:00
|
|
|
;; SORTA WORKING: Relative line numbers with stuff
|
2022-10-12 15:27:07 -08:00
|
|
|
;; (use-package nlinum-relative
|
|
|
|
;; :custom
|
|
|
|
;; (nlinum-format "%s ")
|
|
|
|
;; (nlinum-relative-redisplay-delay 0))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package linum-relative
|
2022-10-11 12:08:59 -08:00
|
|
|
:straight (:host nil
|
2022-11-23 11:06:39 -09:00
|
|
|
:type git
|
|
|
|
:repo
|
|
|
|
"https://git.mitchmarq42.xyz/mitch/linum-relative-justify.el")
|
2022-08-11 06:26:14 -08:00
|
|
|
:diminish
|
2022-10-11 10:45:16 -08:00
|
|
|
:custom (linum-relative-current-symbol "")
|
2022-08-11 06:26:14 -08:00
|
|
|
:init
|
|
|
|
(require 'cl-lib)
|
|
|
|
(require 'linum-relative)
|
|
|
|
(add-hook 'prog-mode-hook #'display-line-numbers-equalize)
|
|
|
|
(add-hook 'prog-mode-hook #'linum-relative-mode)
|
2022-10-11 12:08:59 -08:00
|
|
|
(add-hook 'minibuffer-exit-hook #'linum-relative-on))
|
2022-06-22 06:31:32 -08:00
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
;; broken terminal that doesn't compile but at least it's fast when it does
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package vterm
|
2022-06-19 14:13:36 -08:00
|
|
|
:custom
|
|
|
|
(vterm-always-compile-module t)
|
|
|
|
(vterm-module-cmake-args "-DUSE_SYSTEM_LIBVTERM=no")
|
|
|
|
(vterm-clear-scrollback-when-clearing t)
|
|
|
|
:config
|
|
|
|
(evil-collection-define-key 'insert 'vterm-mode-map
|
|
|
|
(kbd "C-w") 'evil-window-map)
|
2022-06-25 10:57:03 -08:00
|
|
|
(evil-collection-define-key 'normal 'vterm-mode-map
|
2022-10-04 17:04:07 -08:00
|
|
|
(kbd "RET") 'hkey-either
|
|
|
|
(kbd "k") 'vterm-send-up
|
2022-06-27 18:58:48 -08:00
|
|
|
(kbd "j") 'vterm-send-down)
|
2022-06-19 14:13:36 -08:00
|
|
|
(add-to-list 'vterm-keymap-exceptions
|
2022-06-25 10:57:03 -08:00
|
|
|
"C-w")
|
|
|
|
(add-to-list 'vterm-keymap-exceptions
|
|
|
|
"RET")
|
2022-06-19 14:13:36 -08:00
|
|
|
(setq mitch/vterm-eval-cmds-strings
|
2022-06-25 10:57:03 -08:00
|
|
|
'("update-pwd"
|
|
|
|
"restart-emacs"
|
|
|
|
"find-file-other-window"
|
|
|
|
"find-file-other-frame"
|
|
|
|
"eshell/emacs"
|
2022-06-27 18:58:48 -08:00
|
|
|
"eshell/man"
|
2022-07-17 10:50:11 -08:00
|
|
|
"dirvish"
|
|
|
|
"magit"
|
2022-06-27 18:58:48 -08:00
|
|
|
"info-other-window"
|
2022-06-25 10:57:03 -08:00
|
|
|
"add-vterm-eval-cmd"))
|
|
|
|
(defun add-vterm-eval-cmd (function)
|
|
|
|
"Add FUNCTION to `vterm-eval-cmds' so it can be ran through sh in vterm."
|
2022-06-19 14:13:36 -08:00
|
|
|
(add-to-list 'vterm-eval-cmds
|
2022-06-25 10:57:03 -08:00
|
|
|
(list function (intern function))))
|
|
|
|
(dolist (emacs-function mitch/vterm-eval-cmds-strings)
|
|
|
|
(add-vterm-eval-cmd emacs-function))
|
2022-06-19 14:13:36 -08:00
|
|
|
:hook
|
|
|
|
(vterm-mode . mitch/terminal-setup)
|
|
|
|
(vterm-exit-functions . save-buffers-kill-terminal))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package multi-vterm
|
2022-06-19 14:13:36 -08:00
|
|
|
:commands (multi-vterm multi-vterm-other-window)
|
|
|
|
:config
|
|
|
|
(defun multi-vterm-other-window ()
|
|
|
|
"Run a new-ish vterm in the other window"
|
|
|
|
(interactive)
|
|
|
|
(other-window 1) (multi-vterm))
|
|
|
|
:general
|
|
|
|
(general-define-key
|
|
|
|
:states '(normal visual)
|
|
|
|
:prefix "SPC"
|
|
|
|
:non-normal-prefix "SPC"
|
|
|
|
"v" 'multi-vterm)
|
|
|
|
(general-define-key
|
|
|
|
:states 'normal
|
|
|
|
:prefix-map 'ctl-x-4-map
|
|
|
|
:prefix "SPC 4"
|
|
|
|
"v" 'multi-vterm-other-window))
|
|
|
|
|
2022-07-11 17:59:39 -08:00
|
|
|
;; Better modeline? Better modeline.
|
2022-11-06 19:40:30 -09:00
|
|
|
;; (use-package powerline
|
|
|
|
;; :custom
|
|
|
|
;; (powerline-display-buffer-size nil)
|
|
|
|
;; (powerline-default-separator 'utf-8)
|
|
|
|
;; (powerline-utf-8-separator-left (string-to-char ""))
|
|
|
|
;; (powerline-utf-8-separator-right (string-to-char "")))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package airline-themes
|
2022-08-11 06:27:00 -08:00
|
|
|
:custom
|
|
|
|
(airline-cursor-colors nil)
|
|
|
|
(airline-display-directory t)
|
|
|
|
(airline-eshell-colors nil)
|
2022-11-02 17:59:07 -08:00
|
|
|
(airline-shortened-directory-length 20))
|
2022-08-11 06:27:00 -08:00
|
|
|
|
2022-11-06 19:40:30 -09:00
|
|
|
;; see https://github.com/dbordak/telephone-line/issues/126
|
|
|
|
(use-package telephone-line
|
|
|
|
:custom-face
|
|
|
|
(mode-line-buffer-id
|
|
|
|
((t (:inherit mode-line-active))))
|
2022-11-19 17:28:36 -09:00
|
|
|
:after airline-themes
|
2022-11-06 19:40:30 -09:00
|
|
|
:init
|
|
|
|
(load-theme 'airline-kolor)
|
2022-11-19 17:28:36 -09:00
|
|
|
(defun airline-themes-set-modeline () nil)
|
2022-11-06 19:40:30 -09:00
|
|
|
(setq telephone-line-primary-left-separator 'telephone-line-identity-left
|
|
|
|
telephone-line-secondary-left-separator 'telephone-line-identity-hollow-left
|
|
|
|
telephone-line-primary-right-separator 'telephone-line-identity-right
|
|
|
|
telephone-line-secondary-right-separator 'telephone-line-identity-hollow-right)
|
|
|
|
(setq telephone-line-lhs
|
2022-11-23 11:06:39 -09:00
|
|
|
'((evil . (telephone-line-evil-tag-segment))
|
|
|
|
(accent . (telephone-line-vc-segment
|
|
|
|
telephone-line-erc-modified-channels-segment
|
|
|
|
telephone-line-process-segment))
|
|
|
|
(nil . (telephone-line-minor-mode-segment
|
|
|
|
telephone-line-buffer-segment))))
|
2022-11-06 19:40:30 -09:00
|
|
|
(setq telephone-line-rhs
|
2022-11-23 11:06:39 -09:00
|
|
|
'((nil . (telephone-line-misc-info-segment))
|
|
|
|
(accent . (telephone-line-major-mode-segment))
|
|
|
|
(evil . (telephone-line-airline-position-segment))))
|
2022-11-06 19:40:30 -09:00
|
|
|
(defun airline/telephone-line-evil-face (active)
|
|
|
|
"Return an appropriate face for the current mode."
|
|
|
|
(let* ((evil-mode-active (featurep 'evil))
|
2022-11-23 11:06:39 -09:00
|
|
|
(outer-face
|
|
|
|
(if active
|
|
|
|
(if evil-mode-active
|
|
|
|
(cond ((eq evil-state (intern "normal")) 'airline-normal-outer)
|
|
|
|
((eq evil-state (intern "insert")) 'airline-insert-outer)
|
|
|
|
((eq evil-state (intern "visual")) 'airline-visual-outer)
|
|
|
|
((eq evil-state (intern "replace")) 'airline-replace-outer)
|
|
|
|
((eq evil-state (intern "emacs")) 'airline-emacs-outer)
|
|
|
|
(t 'airline-normal-outer))
|
|
|
|
'airline-normal-outer)
|
|
|
|
'powerline-inactive1)))
|
2022-11-06 19:40:30 -09:00
|
|
|
outer-face))
|
|
|
|
(defun airline/telephone-line-accent-face (active)
|
|
|
|
"Return an appropriate face for the current mode."
|
|
|
|
(let* ((evil-mode-active (featurep 'evil))
|
2022-11-23 11:06:39 -09:00
|
|
|
(inner-face
|
|
|
|
(if active
|
|
|
|
(if evil-mode-active
|
|
|
|
(cond ((eq evil-state (intern "normal")) 'airline-normal-inner)
|
|
|
|
((eq evil-state (intern "insert")) 'airline-insert-inner)
|
|
|
|
((eq evil-state (intern "visual")) 'airline-visual-inner)
|
|
|
|
((eq evil-state (intern "replace")) 'airline-replace-inner)
|
|
|
|
((eq evil-state (intern "emacs")) 'airline-emacs-inner)
|
|
|
|
(t 'airline-normal-inner))
|
|
|
|
'airline-normal-inner)
|
|
|
|
'powerline-inactive2)))
|
2022-11-06 19:40:30 -09:00
|
|
|
inner-face))
|
|
|
|
(defun airline/telephone-line-nil-face (active)
|
|
|
|
"Return an appropriate face for the current mode."
|
|
|
|
(let* ((evil-mode-active (featurep 'evil))
|
2022-11-23 11:06:39 -09:00
|
|
|
(center-face
|
|
|
|
(if active
|
|
|
|
(if evil-mode-active
|
|
|
|
(cond ((eq evil-state (intern "normal")) 'airline-normal-center)
|
|
|
|
((eq evil-state (intern "insert")) 'airline-insert-center)
|
|
|
|
((eq evil-state (intern "visual")) 'airline-visual-center)
|
|
|
|
((eq evil-state (intern "replace")) 'airline-replace-center)
|
|
|
|
((eq evil-state (intern "emacs")) 'airline-emacs-center)
|
|
|
|
(t 'airline-normal-center))
|
|
|
|
'airline-normal-center)
|
|
|
|
'airline-inactive3)))
|
2022-11-06 19:40:30 -09:00
|
|
|
center-face))
|
|
|
|
(setq telephone-line-faces
|
2022-11-23 11:06:39 -09:00
|
|
|
'((evil . airline/telephone-line-evil-face)
|
|
|
|
(accent . airline/telephone-line-accent-face)
|
|
|
|
(nil . airline/telephone-line-nil-face)))
|
2022-11-06 19:40:30 -09:00
|
|
|
:config
|
2022-11-15 10:49:15 -09:00
|
|
|
(telephone-line-mode t))
|
2022-11-06 19:40:30 -09:00
|
|
|
|
2022-10-09 12:00:36 -08:00
|
|
|
;; Custom Theme.
|
|
|
|
;; Not to be confused with a color theme, or a color scheme, or a custom scheme.
|
2022-10-10 13:38:53 -08:00
|
|
|
(use-package mitch-theme
|
|
|
|
:straight (:type git :repo
|
|
|
|
"https://git.mitchmarq42.xyz/mitch/vimcolors"
|
|
|
|
:files (:defaults "mitch-theme.el"))
|
|
|
|
:config (mitch/visual-setup)
|
|
|
|
:init
|
2022-11-15 10:49:15 -09:00
|
|
|
(load-theme 'mitch t))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-10-04 17:51:31 -08:00
|
|
|
(use-package yascroll
|
|
|
|
:diminish
|
|
|
|
:defer 1
|
2022-10-07 19:37:49 -08:00
|
|
|
;; :if (not (display-graphic-p))
|
2022-10-04 17:51:31 -08:00
|
|
|
:custom (yascroll:delay-to-hide nil)
|
|
|
|
:custom-face
|
2022-10-09 11:56:51 -08:00
|
|
|
(yascroll:thumb-text-area
|
|
|
|
((t (:inherit airline-emacs-outer))))
|
2022-10-11 16:20:08 -08:00
|
|
|
:config
|
|
|
|
(defun yascroll:make-thumb-overlay-fringe (left-or-right)
|
|
|
|
"Make thumb overlay on the LEFT-OR-RIGHT fringe."
|
|
|
|
(let* ((pos (point))
|
|
|
|
;; If `pos' is at the beginning of line, overlay of the
|
|
|
|
;; fringe will be on the previous visual line.
|
|
|
|
(pos (if (= (line-end-position) pos) pos (1+ pos)))
|
|
|
|
;; below originally said `filled-rectangle' instead of `empty-line'.
|
|
|
|
;; Changed to fix transparency.
|
|
|
|
(display-string `(,left-or-right empty-line yascroll:thumb-fringe))
|
|
|
|
(after-string (propertize "." 'display display-string))
|
|
|
|
(overlay (make-overlay pos pos)))
|
|
|
|
(overlay-put overlay 'after-string after-string)
|
|
|
|
(overlay-put overlay 'fringe-helper t)
|
|
|
|
(overlay-put overlay 'window (selected-window))
|
|
|
|
(overlay-put overlay 'priority yascroll:priority)
|
|
|
|
overlay))
|
|
|
|
(global-yascroll-bar-mode 1))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; parentheses settingses
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package paredit
|
2022-10-09 11:52:54 -08:00
|
|
|
:diminish
|
2022-06-19 14:13:36 -08:00
|
|
|
:general (general-define-key
|
2022-08-24 19:28:10 -08:00
|
|
|
"M-j" 'paredit-forward-slurp-sexp
|
|
|
|
"M-k" 'paredit-forward-barf-sexp
|
|
|
|
"M-h" 'paredit-backward-barf-sexp
|
|
|
|
"M-l" 'paredit-backward-slurp-sexp)
|
2022-10-09 11:52:54 -08:00
|
|
|
:hook (prog-mode . paredit-mode)
|
|
|
|
:init
|
2022-06-19 14:13:36 -08:00
|
|
|
(show-paren-mode 1)
|
2022-10-07 19:38:02 -08:00
|
|
|
(paredit-mode 1)
|
2022-10-09 11:52:54 -08:00
|
|
|
(electric-pair-mode 1)
|
2022-06-19 14:13:36 -08:00
|
|
|
:custom
|
|
|
|
(show-paren-delay 0)
|
|
|
|
(show-paren-style 'parenthesis))
|
2022-10-07 19:38:02 -08:00
|
|
|
(use-package evil-paredit
|
|
|
|
:after paredit
|
|
|
|
:hook (evil-mode . evil-paredit-mode))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; org mode and messy things
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package org
|
2022-06-19 14:13:36 -08:00
|
|
|
:straight (:type built-in)
|
2022-11-01 14:19:14 -08:00
|
|
|
:diminish (org-indent-mode org-vw-mode)
|
2022-06-19 14:13:36 -08:00
|
|
|
:custom
|
|
|
|
(org-hide-leading-stars t)
|
|
|
|
(org-startup-indented t)
|
2022-09-16 17:45:59 -08:00
|
|
|
(org-hide-emphasis-markers t)
|
2022-06-19 14:13:36 -08:00
|
|
|
:config
|
2022-06-21 07:26:38 -08:00
|
|
|
(add-hook 'after-save-hook
|
2022-08-24 19:25:03 -08:00
|
|
|
#'(lambda () (if (equal major-mode 'org-mode)
|
2022-11-23 11:06:39 -09:00
|
|
|
(org-babel-tangle))))
|
2022-11-15 10:49:15 -09:00
|
|
|
(defvar org-electric-pairs '((?_ . ?_)
|
2022-11-02 17:31:15 -08:00
|
|
|
(?/ . ?/)
|
|
|
|
(?* . ?*)
|
|
|
|
(?+ . ?+)
|
2022-11-22 06:45:01 -09:00
|
|
|
(?~ . ?~)
|
2022-11-02 17:31:15 -08:00
|
|
|
(?= . ?=))
|
2022-11-02 13:59:22 -08:00
|
|
|
"Electric pairs for org-mode.
|
2022-11-02 09:39:36 -08:00
|
|
|
|
2022-11-02 13:59:22 -08:00
|
|
|
See https://emacs.stackexchange.com/questions/2538/how-to-define-additional-mode-specific-pairs-for-electric-pair-mode")
|
|
|
|
(defun org-add-electric-pairs ()
|
|
|
|
(setq-local electric-pair-pairs (append electric-pair-pairs org-electric-pairs))
|
|
|
|
(setq-local electric-pair-text-pairs electric-pair-pairs))
|
|
|
|
(add-hook 'org-mode-hook 'org-add-electric-pairs)
|
2022-09-24 19:02:57 -08:00
|
|
|
(require 'mitch-orgstuff)
|
|
|
|
:hook
|
|
|
|
(org-mode . turn-off-line-numbers)
|
|
|
|
(org-mode . org-vw-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package org-tempo
|
2022-08-08 06:36:43 -08:00
|
|
|
:straight (:type built-in)
|
|
|
|
:after org
|
|
|
|
:config
|
|
|
|
(add-to-list 'org-structure-template-alist '("sh" . "src shell"))
|
|
|
|
(add-to-list 'org-structure-template-alist '("el" . "src elisp"))
|
|
|
|
(add-to-list 'org-structure-template-alist '("html" . "src html")))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package org-variable-pitch
|
2022-08-08 06:36:43 -08:00
|
|
|
:if (display-graphic-p)
|
2022-06-19 19:16:32 -08:00
|
|
|
:diminish (buffer-face-mode org-variable-pitch-minor-mode)
|
2022-10-04 17:56:51 -08:00
|
|
|
:custom-face (org-meta-line
|
|
|
|
((nil (:inherit
|
2022-10-06 10:24:05 -08:00
|
|
|
(font-lock-comment-delimiter-face fixed-pitch)))))
|
2022-06-19 14:13:36 -08:00
|
|
|
:hook (org-mode . org-variable-pitch-minor-mode))
|
2022-09-16 17:45:59 -08:00
|
|
|
(use-package org-appear
|
|
|
|
:hook (org-mode . org-appear-mode)
|
2022-06-19 14:13:36 -08:00
|
|
|
:after org
|
2022-09-16 17:45:59 -08:00
|
|
|
:custom
|
|
|
|
(org-appear-autolinks t)
|
|
|
|
(org-appear-autoemphasis t)
|
|
|
|
(org-appear-autoentities t)
|
|
|
|
(org-appear-autokeywords t)
|
|
|
|
(org-appear-autosubmarkers t))
|
2022-10-07 19:38:12 -08:00
|
|
|
(use-package org-pretty-table
|
|
|
|
:straight (:type git
|
|
|
|
:host github
|
|
|
|
:repo "Fuco1/org-pretty-table")
|
2022-10-26 09:45:00 -08:00
|
|
|
:diminish
|
2022-10-07 19:38:12 -08:00
|
|
|
:hook (org-mode . org-pretty-table-mode))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package ox-hugo
|
2022-11-22 06:42:19 -09:00
|
|
|
:after ox
|
|
|
|
:config
|
|
|
|
(defun hugo-dir-above (dir)
|
|
|
|
"Return path of Hugo project root above or at DIR.
|
|
|
|
Return nil if DIR is not in a hugo project at all."
|
|
|
|
(if (eq dir nil) nil
|
|
|
|
(if (file-exists-p (expand-file-name "config.toml" dir)) dir
|
|
|
|
(hugo-dir-above (file-name-directory (string-trim-right dir "/"))))))
|
|
|
|
(add-hook 'after-save-hook
|
|
|
|
(lambda () (let ((hugo-dir (hugo-dir-above default-directory)))
|
|
|
|
(if hugo-dir
|
|
|
|
(let ((default-directory hugo-dir))
|
|
|
|
(shell-command "hugo")))))))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-10-26 09:46:08 -08:00
|
|
|
;; fake indentation, other than the other fake indentation
|
|
|
|
(use-package adaptive-wrap
|
|
|
|
:custom (adaptive-wrap-extra-indent 2)
|
|
|
|
:hook (org-mode . adaptive-wrap-prefix-mode))
|
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
;; cheaty key popups
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package which-key
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish
|
|
|
|
:defer 5
|
|
|
|
:init (which-key-mode t))
|
|
|
|
|
|
|
|
;; parentheses are boring
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package rainbow-delimiters
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish
|
|
|
|
:defer 1
|
|
|
|
:hook (prog-mode . rainbow-delimiters-mode))
|
|
|
|
|
|
|
|
;; Hex colors
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package rainbow-mode
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish
|
|
|
|
:hook (prog-mode . rainbow-mode))
|
|
|
|
|
|
|
|
;; Nobody loves a good language
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package powershell
|
2022-06-19 14:13:36 -08:00
|
|
|
:mode ("\\.ps1\\'" . powershell-mode))
|
2022-11-06 19:38:47 -09:00
|
|
|
|
|
|
|
;; or an okay language
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package cider
|
2022-06-19 14:13:36 -08:00
|
|
|
:defer 1)
|
|
|
|
|
|
|
|
;; c sharp; taken from https://www.reddit.com/r/emacs/comments/k8tnzg/help_setting_up_c_lsp_omnisharproslyn/
|
2022-08-08 06:37:40 -08:00
|
|
|
;; '(there is nothing here because I'm not using c sharp...)
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package lsp-mode
|
2022-10-26 10:53:10 -08:00
|
|
|
:hook ((powershell-mode . lsp-mode)
|
|
|
|
(lsp-mode . lsp-enable-which-key-integration))
|
2022-06-19 14:13:36 -08:00
|
|
|
:commands lsp
|
2022-11-15 10:49:15 -09:00
|
|
|
:diminish lsp-lens-mode
|
|
|
|
:custom (lsp-completion-provider :none))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-08-08 06:37:40 -08:00
|
|
|
;; broken snippets I don't care about...
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package yasnippet
|
2022-08-11 06:27:27 -08:00
|
|
|
:diminish yas-minor-mode
|
2022-08-08 06:37:40 -08:00
|
|
|
:hook (prog-mode . yas-minor-mode))
|
2022-10-26 10:53:10 -08:00
|
|
|
(use-package yasnippet-snippets)
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; Better help-pages. Genuinely pretty great.
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package helpful
|
2022-06-19 14:13:36 -08:00
|
|
|
:general (general-define-key
|
2022-08-24 19:28:10 -08:00
|
|
|
[remap describe-key] 'helpful-key
|
|
|
|
[remap describe-variable] 'helpful-variable
|
|
|
|
[remap describe-function] 'helpful-callable)
|
2022-06-19 14:13:36 -08:00
|
|
|
(general-define-key
|
|
|
|
:keymaps 'help-map
|
|
|
|
"F" 'describe-face
|
|
|
|
"k" 'helpful-key)
|
|
|
|
(general-define-key
|
|
|
|
:keymaps 'emacs-lisp-mode-map
|
|
|
|
:states 'normal
|
2022-08-11 06:27:27 -08:00
|
|
|
"K" 'helpful-at-point)
|
|
|
|
:custom (elisp-refs-verbose nil))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; Better lisp highlighting?
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package highlight-defined
|
2022-06-19 14:13:36 -08:00
|
|
|
:hook (emacs-lisp-mode . highlight-defined-mode))
|
|
|
|
|
|
|
|
;; Shell linting?
|
2022-11-15 10:49:41 -09:00
|
|
|
(use-package flymake
|
2022-06-19 14:13:36 -08:00
|
|
|
:diminish
|
2022-11-15 10:49:41 -09:00
|
|
|
:hook (prog-mode . flymake-mode))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; Emacs startup profiling
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package esup
|
2022-06-19 14:13:36 -08:00
|
|
|
:commands esup)
|
|
|
|
|
|
|
|
;; Blingy laggy minimap on the right
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package minimap
|
2022-06-19 14:13:36 -08:00
|
|
|
:general (general-define-key
|
2022-08-24 19:28:10 -08:00
|
|
|
:states 'normal
|
|
|
|
:prefix-command 'mini-map-prefix
|
|
|
|
:prefix-map 'mini-map
|
|
|
|
:prefix "SPC m"
|
|
|
|
"m" 'minimap-mode
|
|
|
|
"k" 'minimap-kill)
|
2022-06-19 14:13:36 -08:00
|
|
|
:custom
|
|
|
|
(minimap-window-location 'right)
|
|
|
|
(minimap-update-delay 0)
|
|
|
|
:custom-face
|
|
|
|
(minimap-active-region-background
|
|
|
|
((t (:background "#303030" :extend t))))
|
|
|
|
(minimap-current-line-face
|
2022-07-21 08:15:38 -08:00
|
|
|
((nil (:background "#afafaf" :extend t)))))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
|
|
|
;; epic drop-down completion
|
2022-07-16 18:03:19 -08:00
|
|
|
;; (use-package company
|
|
|
|
;; :diminish
|
|
|
|
;; :custom ;(company-require-match nil)
|
|
|
|
;; (company-tooltip-align-annotations t)
|
|
|
|
;; :hook (prog-mode . company-mode))
|
|
|
|
;; (use-package company-lsp
|
|
|
|
;; :after (lsp company)
|
|
|
|
;; :config
|
|
|
|
;; (push 'company-lsp company-backends))
|
2022-06-19 14:13:36 -08:00
|
|
|
;; (use-package company-fuzzy
|
2022-07-05 20:56:48 -08:00
|
|
|
;; :diminish
|
2022-06-19 14:13:36 -08:00
|
|
|
;; :hook (company-mode . company-fuzzy-mode)
|
|
|
|
;; ;; :init
|
|
|
|
;; :custom
|
|
|
|
;; ;; (company-fuzzy-sorting-backend 'flx)
|
|
|
|
;; (company-fuzzy-prefix-on-top nil)
|
|
|
|
;; (company-fuzzy-history-backends '(company-yasnippet))
|
|
|
|
;; (company-fuzzy-trigger-symbols '("." "->" "<" "\"" "'" "@"))
|
|
|
|
;; (company-fuzzy-passthrough-backends '(company-capf)))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package corfu
|
2022-07-16 18:03:19 -08:00
|
|
|
:custom
|
|
|
|
(completion-cycle-threshold 3)
|
|
|
|
(tab-always-indent 'complete)
|
|
|
|
(corfu-auto t)
|
|
|
|
(corfu-quit-no-match t)
|
|
|
|
(corfu-count (- (window-total-height) 10))
|
|
|
|
;; (corfu-separator ";")
|
|
|
|
:init (global-corfu-mode)
|
|
|
|
;; (defun corfu-enable-always-in-minibuffer ()
|
|
|
|
;; "Enable Corfu in the minibuffer if Vertico/Mct are not active."
|
|
|
|
;; (unless (or (bound-and-true-p mct--active)
|
|
|
|
;; (bound-and-true-p vertico--input))
|
|
|
|
;; (setq-local corfu-auto nil) ;; Enable/disable auto completion
|
|
|
|
;; (corfu-mode 1)
|
|
|
|
;; (minibuffer-complete)))
|
|
|
|
;; (add-hook 'minibuffer-setup-hook #'corfu-enable-always-in-minibuffer 1)
|
|
|
|
;; (defun corfu-kill-in-minibuffer ()
|
|
|
|
;; "Kill corfu and minibuffer. To be bound to Esc."
|
|
|
|
;; (interactive)
|
|
|
|
;; (setq-local inhibit-debugger t)
|
|
|
|
;; (corfu-quit)
|
|
|
|
;; (exit-minibuffer)
|
|
|
|
;; )
|
|
|
|
(defun corfu-send-shell (&rest _)
|
|
|
|
"Send completion candidate when inside comint/eshell."
|
|
|
|
(cond
|
|
|
|
((and (derived-mode-p 'eshell-mode) (fboundp 'eshell-send-input))
|
|
|
|
(eshell-send-input))
|
|
|
|
((and (derived-mode-p 'comint-mode) (fboundp 'comint-send-input))
|
|
|
|
(comint-send-input))))
|
|
|
|
:general
|
|
|
|
(general-define-key
|
|
|
|
:prefix-map 'corfu-map
|
|
|
|
"C-n" 'corfu-next
|
|
|
|
"C-p" 'corfu-previous
|
|
|
|
"RET" 'corfu-insert
|
2022-11-15 10:49:15 -09:00
|
|
|
"ESC" 'corfu-kill-in-minibuffer))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package popon
|
2022-06-19 14:13:36 -08:00
|
|
|
:straight
|
|
|
|
(:type git
|
2022-08-24 19:28:10 -08:00
|
|
|
:repo "https://codeberg.org/akib/emacs-popon")
|
2022-06-22 06:41:28 -08:00
|
|
|
:if (not (display-graphic-p)))
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package corfu-terminal
|
2022-06-19 14:13:36 -08:00
|
|
|
:straight
|
|
|
|
(:type git
|
2022-08-24 19:28:10 -08:00
|
|
|
:repo "https://codeberg.org/akib/emacs-corfu-terminal")
|
2022-06-22 06:41:28 -08:00
|
|
|
:after popon
|
2022-06-19 14:13:36 -08:00
|
|
|
:init (unless
|
2022-08-24 19:28:10 -08:00
|
|
|
(display-graphic-p)
|
|
|
|
(corfu-terminal-mode +1)))
|
2022-06-19 14:13:36 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package magit
|
2022-11-15 21:03:37 -09:00
|
|
|
:commands (madots magit-status magit)
|
|
|
|
:hook (magit-mode . turn-off-line-numbers)
|
|
|
|
:config
|
|
|
|
(defun madots--magit-buffers-p ()
|
|
|
|
(not (not ; converts all non-nil values to t
|
|
|
|
(remove nil ; clean useless elements
|
|
|
|
(mapcar (lambda (buffer)
|
|
|
|
(if (string-match-p "magit: " (buffer-name buffer))
|
|
|
|
buffer))
|
|
|
|
(buffer-list))))))
|
|
|
|
(defun madots--cleanup ()
|
|
|
|
"Remove modifications made for `madots' once all magit buffers are killed."
|
|
|
|
(if (not (madots--magit-buffers-p))
|
|
|
|
(progn
|
|
|
|
(setq magit-git-executable madots--old-magit-exe)
|
|
|
|
(cancel-function-timers #'madots--cleanup))))
|
|
|
|
(defun madots (&optional exe)
|
|
|
|
"Magit but with custom EXE, default \"dots\"."
|
|
|
|
(interactive)
|
|
|
|
(require 'magit)
|
|
|
|
(setq madots--old-magit-exe magit-git-executable)
|
|
|
|
(setq magit-git-executable (or exe "dots"))
|
|
|
|
(magit-status)
|
|
|
|
(run-with-timer 5 3 #'madots--cleanup)))
|
2022-06-19 19:32:07 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package hyperbole
|
2022-06-21 16:50:50 -08:00
|
|
|
:diminish
|
2022-06-21 16:56:59 -08:00
|
|
|
:general (general-define-key
|
2022-08-24 19:28:10 -08:00
|
|
|
:states 'normal
|
|
|
|
"RET" 'hkey-either))
|
2022-06-21 16:50:50 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package dconf-mode
|
2022-06-25 10:59:43 -08:00
|
|
|
:straight
|
|
|
|
(:type git
|
2022-08-24 19:28:10 -08:00
|
|
|
:repo "https://git.mitchmarq42.xyz/mitch/dconf-mode.el"))
|
2022-06-25 10:59:43 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package info-variable-pitch
|
2022-06-27 18:58:48 -08:00
|
|
|
:straight
|
|
|
|
(:type git :host github
|
|
|
|
:repo "kisaragi-hiu/info-variable-pitch")
|
|
|
|
:config
|
|
|
|
(add-hook 'Info-mode-hook #'info-variable-pitch-mode))
|
|
|
|
|
2022-07-05 20:56:48 -08:00
|
|
|
;; (use-package exwm
|
|
|
|
;; ;; :init
|
|
|
|
;; ;; (require 'exwm-config)
|
2022-11-15 10:49:15 -09:00
|
|
|
;; ;; (exwm-config-example))
|
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package ani-el
|
2022-07-07 20:44:27 -08:00
|
|
|
:straight (:type git :repo "https://git.mitchmarq42.xyz/mitch/ani-el"
|
|
|
|
:files ("ani-el.el" "lib")))
|
2022-07-05 20:56:48 -08:00
|
|
|
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package slime
|
2022-07-11 17:59:39 -08:00
|
|
|
:if (file-exists-p (expand-file-name "~/quicklisp/slime-helper.el"))
|
|
|
|
:custom (inferior-lisp-program "sbcl")
|
|
|
|
:init (load (expand-file-name "~/quicklisp/slime-helper.el")))
|
|
|
|
|
2022-07-22 16:24:56 -08:00
|
|
|
;; built in spell checker, for losers
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package flyspell
|
2022-07-22 16:24:56 -08:00
|
|
|
:straight (:type built-in)
|
2022-11-01 14:19:14 -08:00
|
|
|
:diminish
|
2022-07-22 16:24:56 -08:00
|
|
|
:custom
|
|
|
|
(flyspell-auto-correct-word t)
|
|
|
|
:hook
|
|
|
|
(org-mode . flyspell-mode))
|
|
|
|
|
2022-08-24 19:28:10 -08:00
|
|
|
;; Java never looked so useful...
|
2022-08-30 05:40:34 -08:00
|
|
|
(use-package clojure-mode)
|
|
|
|
(use-package inf-clojure)
|
2022-08-24 19:28:10 -08:00
|
|
|
|
2022-09-04 11:09:04 -08:00
|
|
|
;; unique buffer names
|
|
|
|
(use-package uniquify
|
|
|
|
:straight (:type built-in)
|
2022-10-09 11:53:34 -08:00
|
|
|
:custom (uniquify-buffer-name-style 'forward))
|
2022-09-04 11:09:04 -08:00
|
|
|
|
2022-09-29 06:18:54 -08:00
|
|
|
;; cache file cleanup
|
2022-09-16 17:46:49 -08:00
|
|
|
(use-package kkc
|
|
|
|
:straight (:type built-in)
|
|
|
|
:custom (kkc-init-file-name (expand-file-name "kkcrc" backup-directory)))
|
|
|
|
|
2022-11-06 19:42:23 -09:00
|
|
|
;; see https://www.reddit.com/r/emacs/comments/xyo2fo/orgmode_vterm_tmux/
|
|
|
|
(use-package ob-tmux
|
2022-11-15 10:47:09 -09:00
|
|
|
:after (org dash)
|
|
|
|
:config
|
|
|
|
(setq org-src-lang-modes (-replace
|
|
|
|
'("tmux" . sh)
|
|
|
|
'("tmux" . powershell)
|
|
|
|
org-src-lang-modes))
|
2022-11-06 19:42:23 -09:00
|
|
|
:custom
|
|
|
|
(org-babel-default-header-args:tmux
|
|
|
|
'((:results . "display")
|
|
|
|
(:session . "default")
|
|
|
|
(:socket . nil)))
|
|
|
|
(org-babel-tmux-session-prefix "ob-")
|
|
|
|
(org-babel-tmux-terminal "/home/mitch/.local/bin/emacs-term-shim.sh")
|
2022-11-15 10:47:09 -09:00
|
|
|
(org-babel-tmux-terminal-opts))
|
2022-11-06 19:42:23 -09:00
|
|
|
|
2022-11-15 10:50:22 -09:00
|
|
|
(use-package dwim-shell-command
|
|
|
|
:straight (:files (:defaults "dwim-shell-commands.el"))
|
|
|
|
:config (require 'dwim-shell-commands)
|
|
|
|
:commands dwim-shell-commands-kill-process)
|
2022-11-15 10:50:40 -09:00
|
|
|
|
|
|
|
(use-package youtube-sub-extractor
|
|
|
|
:straight (:type git :host github :repo "agzam/youtube-sub-extractor.el")
|
2022-11-15 15:17:22 -09:00
|
|
|
:custom (youtube-sub-extractor-timestamps 'left-margin)
|
|
|
|
:commands youtube-sub-extractor-extract-subs)
|
|
|
|
|
2022-11-15 15:17:56 -09:00
|
|
|
(use-package cheat-sh
|
|
|
|
:straight (:type git :host github :repo "davep/cheat-sh.el")
|
|
|
|
:commands cheat-sh)
|
2022-11-15 10:50:40 -09:00
|
|
|
|
2022-06-19 14:13:36 -08:00
|
|
|
(provide 'mitch-packages)
|
|
|
|
;;; mitch-packages.el ends here
|