style(emacs): format config.org
Some checks failed
Check Formatting of Files / Check-Formatting (push) Has been cancelled

This commit is contained in:
Price Hiller 2024-07-09 23:26:19 -05:00
parent c6baf97dd9
commit 824adba95b
Signed by: Price
GPG Key ID: C3FADDE7A8534BEB

View File

@ -6,13 +6,13 @@
* Auto Compile * Auto Compile
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package auto-compile (use-package auto-compile
:custom :custom
(load-prefer-newer t) (load-prefer-newer t)
:defer nil :defer nil
:config :config
(auto-compile-on-load-mode) (auto-compile-on-load-mode)
(auto-compile-on-save-mode)) (auto-compile-on-save-mode))
#+end_src #+end_src
* Add Additional Package Archives * Add Additional Package Archives
@ -23,48 +23,45 @@
** Font Settings ** Font Settings
#+begin_src emacs-lisp #+begin_src emacs-lisp
(set-face-attribute 'default nil :family "Fira Code" :height 130) (set-face-attribute 'default nil :family "Fira Code" :height 130)
#+end_src #+end_src
** Splash Screen
** Splash Screen
Remove splash screen and use a *scratch* buffer instead Remove splash screen and use a *scratch* buffer instead
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq inhibit-startup-message t (setq inhibit-startup-message t
inhibit-startup-echo-area-message t) inhibit-startup-echo-area-message t)
#+end_src #+end_src
** Line Numbers ** Line Numbers
Default to enabling line numbers in all buffers Default to enabling line numbers in all buffers
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq display-line-numbers-type 'relative (setq display-line-numbers-type 'relative
column-number-mode t) column-number-mode t)
(global-display-line-numbers-mode t) (global-display-line-numbers-mode t)
#+end_src #+end_src
** Improved Tabs/Indentation ** Improved Tabs/Indentation
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq-default indent-tabs-mode nil) (setq-default indent-tabs-mode nil)
(setq-default tab-width 4) (setq-default tab-width 4)
#+end_src #+end_src
** Improved default visuals ** Improved default visuals
#+begin_src emacs-lisp #+begin_src emacs-lisp
(menu-bar-mode -1) (menu-bar-mode -1)
(scroll-bar-mode -1) (scroll-bar-mode -1)
(tool-bar-mode -1) (tool-bar-mode -1)
(tooltip-mode t) (tooltip-mode t)
(setq visible-bell nil) (setq visible-bell nil)
(global-hl-line-mode t) (global-hl-line-mode t)
(blink-cursor-mode 0) (blink-cursor-mode 0)
#+end_src #+end_src
** Improve yes or no prompt ** Improve yes or no prompt
#+begin_src emacs-lisp #+begin_src emacs-lisp
(fset 'yes-or-no-p 'y-or-n-p) (fset 'yes-or-no-p 'y-or-n-p)
#+end_src #+end_src
* Appearance / Themeing * Appearance / Themeing
@ -72,387 +69,397 @@ Default to enabling line numbers in all buffers
** Kanagawa Theme ** Kanagawa Theme
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package kanagawa-theme (use-package kanagawa-theme
:ensure t :ensure t
:config :config
(load-theme 'kanagawa t)) (load-theme 'kanagawa t))
#+end_src #+end_src
* Evil Mode * Evil Mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package evil (use-package evil
:defer nil :defer nil
:custom :custom
(evl-kbd-macro-suppress-motion-error t) (evl-kbd-macro-suppress-motion-error t)
(evil-want-C-u-scroll t) (evil-want-C-u-scroll t)
(evil-want-integration t) (evil-want-integration t)
(evil-want-keybinding 'nil) (evil-want-keybinding 'nil)
(which-key-allow-evil-operators t) (which-key-allow-evil-operators t)
(evil-undo-system 'undo-redo) (evil-undo-system 'undo-redo)
(evil-want-fine-undo t) (evil-want-fine-undo t)
(evil-emacs-state-modes nil) (evil-emacs-state-modes nil)
(evil-insert-state-modes nil) (evil-insert-state-modes nil)
(evil-motion-state-modes nil) (evil-motion-state-modes nil)
:config :config
(evil-mode 1)) (evil-mode 1))
#+end_src #+end_src
* General.el * General.el
Used for keybindings Used for keybindings
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package general (use-package general
:ensure (:wait t) :ensure (:wait t)
:after evil :after evil
:demand t) :demand t)
(general-create-definer key-leader (general-create-definer key-leader
:states 'normal :states 'normal
:keymaps 'override :keymaps 'override
:prefix "SPC") :prefix "SPC")
;; Make hitting escape work more like vim ;; Make hitting escape work more like vim
(general-def (general-def
"<escape>" #'keyboard-escape-quit) "<escape>" #'keyboard-escape-quit)
#+end_src #+end_src
* Which Key * Which Key
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package which-key (use-package which-key
:defer nil :defer nil
:config :config
:general :general
(key-leader (key-leader
:states 'normal :states 'normal
"w w" #'which-key-show-top-level) "w w" #'which-key-show-top-level)
:custom :custom
(which-key-idle-delay 1) (which-key-idle-delay 1)
(which-key-max-description-length 50) (which-key-max-description-length 50)
:init :init
(which-key-mode)) (which-key-mode))
#+end_src #+end_src
* Auto Revert * Auto Revert
#+begin_src emacs-lisp #+begin_src emacs-lisp
(global-auto-revert-mode t) (global-auto-revert-mode t)
#+end_src #+end_src
* Treesitter * Treesitter
** Auto setup ** Auto setup
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package treesit-auto (use-package treesit-auto
:custom :custom
(treesit-auto-install 'prompt) (treesit-auto-install 'prompt)
:config :config
(treesit-auto-add-to-auto-mode-alist 'all) (treesit-auto-add-to-auto-mode-alist 'all)
(global-treesit-auto-mode)) (global-treesit-auto-mode))
#+end_src #+end_src
** Nix Integration
** Nix Integration
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package nix-ts-mode (use-package nix-ts-mode
:mode "\\.nix\\'") :mode "\\.nix\\'")
#+end_src #+end_src
* Completion * Completion
** Orderless w/ Hotfuzz ** Orderless w/ Hotfuzz
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package hotfuzz (use-package hotfuzz
:ensure (:host github :ensure (:host github
:depth 1 :depth 1
:repo "axelf4/hotfuzz" :repo "axelf4/hotfuzz"
:pre-build (("cmake" "-DCMAKE_C_FLAGS='-O3 -march=native'" ".") ("cmake" "--build" ".")))) :pre-build (("cmake" "-DCMAKE_C_FLAGS='-O3 -march=native'" ".") ("cmake" "--build" "."))))
(use-package orderless (use-package orderless
:after hotfuzz :after hotfuzz
:demand t :demand t
:config :config
(defun +orderless--consult-suffix () (defun +orderless--consult-suffix ()
"Regexp which matches the end of string with Consult tofu support." "Regexp which matches the end of string with Consult tofu support."
(if (and (boundp 'consult--tofu-char) (boundp 'consult--tofu-range)) (if (and (boundp 'consult--tofu-char) (boundp 'consult--tofu-range))
(format "[%c-%c]*$" (format "[%c-%c]*$"
consult--tofu-char consult--tofu-char
(+ consult--tofu-char consult--tofu-range -1)) (+ consult--tofu-char consult--tofu-range -1))
"$")) "$"))
;; Recognizes the following patterns: ;; Recognizes the following patterns:
;; * .ext (file extension) ;; * .ext (file extension)
;; * regexp$ (regexp matching at end) ;; * regexp$ (regexp matching at end)
(defun +orderless-consult-dispatch (word _index _total) (defun +orderless-consult-dispatch (word _index _total)
(cond (cond
;; Ensure that $ works with Consult commands, which add disambiguation suffixes ;; Ensure that $ works with Consult commands, which add disambiguation suffixes
((string-suffix-p "$" word) ((string-suffix-p "$" word)
`(orderless-regexp . ,(concat (substring word 0 -1) (+orderless--consult-suffix)))) `(orderless-regexp . ,(concat (substring word 0 -1) (+orderless--consult-suffix))))
;; File extensions ;; File extensions
((and (or minibuffer-completing-file-name ((and (or minibuffer-completing-file-name
(derived-mode-p 'eshell-mode)) (derived-mode-p 'eshell-mode))
(string-match-p "\\`\\.." word)) (string-match-p "\\`\\.." word))
`(orderless-regexp . ,(concat "\\." (substring word 1) (+orderless--consult-suffix)))))) `(orderless-regexp . ,(concat "\\." (substring word 1) (+orderless--consult-suffix))))))
(setq
(defun flex-if-twiddle (pattern _index _total) completion-ignore-case t
(when (string-suffix-p "~" pattern) completion-styles '(hotfuzz orderless basic)
`(orderless-flex . ,(substring pattern 0 -1)))) completion-category-defaults nil
completion-category-overrides nil
(defun first-initialism (pattern index _total) orderless-component-separator #'orderless-escapable-split-on-space
(if (= index 0) 'orderless-initialism)) orderless-style-dispatchers (list #'+orderless-consult-dispatch
#'orderless-affix-dispatch)
(defun not-if-bang (pattern _index _total) completion-category-overrides '((file (styles partial-completion))
(cond (command (styles +orderless-with-initialism))
((equal "!" pattern) (variable (styles +orderless-with-initialism))
#'ignore) (symbol (styles +orderless-with-initialism)))
((string-prefix-p "!" pattern) orderless-matching-styles
`(orderless-not . ,(substring pattern 1))))) '(orderless-prefixes
(setq orderless-initialism
completion-ignore-case t orderless-literal
completion-styles '(hotfuzz orderless basic) orderless-regexp)))
completion-category-defaults nil
completion-category-overrides nil
orderless-component-separator #'orderless-escapable-split-on-space
orderless-style-dispatchers (list #'+orderless-consult-dispatch
#'orderless-affix-dispatch)
orderless-matching-styles
'(orderless-prefixes
orderless-initialism
orderless-literal
orderless-regexp)))
#+end_src #+end_src
** Corfu ** Corfu
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package corfu (use-package corfu
:custom :custom
(corfu-min-width 60) (corfu-min-width 60)
(corfu-max-width corfu-min-width) (corfu-max-width corfu-min-width)
(corfu-cycle t) (corfu-cycle t)
(corfu-auto t) (corfu-auto t)
(corfu-auto-prefix 1) (corfu-auto-prefix 1)
(corfu-on-exact-match nil) (corfu-on-exact-match nil)
(corfu-preselect 'prompt) (corfu-preselect 'prompt)
(read-extended-command-predicate #'command-completion-default-include-p) (read-extended-command-predicate #'command-completion-default-include-p)
(completion-cycle-threshold 0) (completion-cycle-threshold 0)
(corfu-separator ?\s) (corfu-separator ?\s)
(tab-always-indent 'complete) (tab-always-indent 'complete)
(corfu-scroll-margin 5) (corfu-scroll-margin 5)
(corfu-popupinfo-delay 0.1) (corfu-popupinfo-delay 0.1)
:general :general
(:keymaps 'corfu-map (:keymaps 'corfu-map
"TAB" 'corfu-next "TAB" 'corfu-next
"S-TAB" 'corfu-previous "S-TAB" 'corfu-previous
"S-SPC" 'corfu-insert-separator "S-SPC" 'corfu-insert-separator
"<escape>" 'corfu-quit "<escape>" 'corfu-quit
"<return>" 'corfu-insert "<return>" 'corfu-insert
"M-d" 'corfu-show-documentation "M-d" 'corfu-show-documentation
"M-d" 'corfu-show-location) "M-d" 'corfu-show-location)
:init :init
(global-corfu-mode) (global-corfu-mode)
(corfu-history-mode) (corfu-history-mode)
(corfu-popupinfo-mode)) (corfu-popupinfo-mode))
#+end_src #+end_src
** Cape ** Cape
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package cape (use-package cape
:ensure (:host github :ensure (:host github
:repo "minad/cape" :repo "minad/cape"
:depth 1) :depth 1)
:init :init
;; Add to the global default value of `completion-at-point-functions' which is ;; Add to the global default value of `completion-at-point-functions' which is
;; used by `completion-at-point'. The order of the functions matters, the ;; used by `completion-at-point'. The order of the functions matters, the
;; first function returning a result wins. Note that the list of buffer-local ;; first function returning a result wins. Note that the list of buffer-local
;; completion functions takes precedence over the global list. ;; completion functions takes precedence over the global list.
(add-to-list 'completion-at-point-functions #'cape-dabbrev) (add-to-list 'completion-at-point-functions #'cape-dabbrev)
(add-to-list 'completion-at-point-functions #'cape-file) (add-to-list 'completion-at-point-functions #'cape-file)
(add-to-list 'completion-at-point-functions #'cape-elisp-block) (add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-to-list 'completion-at-point-functions #'cape-keyword) (add-to-list 'completion-at-point-functions #'cape-keyword)
(add-to-list 'completion-at-point-functions #'cape-elisp-symbol) (add-to-list 'completion-at-point-functions #'cape-elisp-symbol)
(add-to-list 'completion-at-point-functions #'cape-elisp-block) (add-to-list 'completion-at-point-functions #'cape-elisp-block)
(add-to-list 'completion-at-point-functions #'cape-tex) (add-to-list 'completion-at-point-functions #'cape-tex)
(add-to-list 'completion-at-point-functions #'cape-emoji)) (add-to-list 'completion-at-point-functions #'cape-emoji))
#+end_src #+end_src
** Marginalia ** Marginalia
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package marginalia (use-package marginalia
; :ensure (:host github ; :ensure (:host github
; :depth 1 ; :depth 1
; :repo "minad/marginalia") ; :repo "minad/marginalia")
:general :general
(:keymaps 'minibuffer-local-map (:keymaps 'minibuffer-local-map
"M-A" #'marginalia-cycle) "M-A" #'marginalia-cycle)
:custom :custom
(marginalia-max-relative-age 0) (marginalia-max-relative-age 0)
(marginalia-align #'center) (marginalia-align #'center)
:init :init
(marginalia-mode)) (marginalia-mode))
#+end_src #+end_src
** Completion Icons ** Completion Icons
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package kind-icon (use-package kind-icon
:ensure t :ensure t
:after corfu nerd-icons :after corfu nerd-icons
:custom :custom
(kind-icon-use-icons nil) (kind-icon-use-icons nil)
(kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly (kind-icon-default-face 'corfu-default) ; to compute blended backgrounds correctly
(kind-icon-mapping (kind-icon-mapping
`( `(
(array ,(nerd-icons-codicon "nf-cod-symbol_array") :face font-lock-type-face) (array ,(nerd-icons-codicon "nf-cod-symbol_array") :face font-lock-type-face)
(boolean ,(nerd-icons-codicon "nf-cod-symbol_boolean") :face font-lock-builtin-face) (boolean ,(nerd-icons-codicon "nf-cod-symbol_boolean") :face font-lock-builtin-face)
(class ,(nerd-icons-codicon "nf-cod-symbol_class") :face font-lock-type-face) (class ,(nerd-icons-codicon "nf-cod-symbol_class") :face font-lock-type-face)
(color ,(nerd-icons-codicon "nf-cod-symbol_color") :face success) (color ,(nerd-icons-codicon "nf-cod-symbol_color") :face success)
(command ,(nerd-icons-codicon "nf-cod-terminal") :face default) (command ,(nerd-icons-codicon "nf-cod-terminal") :face default)
(constant ,(nerd-icons-codicon "nf-cod-symbol_constant") :face font-lock-constant-face) (constant ,(nerd-icons-codicon "nf-cod-symbol_constant") :face font-lock-constant-face)
(constructor ,(nerd-icons-codicon "nf-cod-triangle_right") :face font-lock-function-name-face) (constructor ,(nerd-icons-codicon "nf-cod-triangle_right") :face font-lock-function-name-face)
(enummember ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face) (enummember ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
(enum-member ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face) (enum-member ,(nerd-icons-codicon "nf-cod-symbol_enum_member") :face font-lock-builtin-face)
(enum ,(nerd-icons-codicon "nf-cod-symbol_enum") :face font-lock-builtin-face) (enum ,(nerd-icons-codicon "nf-cod-symbol_enum") :face font-lock-builtin-face)
(event ,(nerd-icons-codicon "nf-cod-symbol_event") :face font-lock-warning-face) (event ,(nerd-icons-codicon "nf-cod-symbol_event") :face font-lock-warning-face)
(field ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-variable-name-face) (field ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-variable-name-face)
(file ,(nerd-icons-codicon "nf-cod-symbol_file") :face font-lock-string-face) (file ,(nerd-icons-codicon "nf-cod-symbol_file") :face font-lock-string-face)
(folder ,(nerd-icons-codicon "nf-cod-folder") :face font-lock-doc-face) (folder ,(nerd-icons-codicon "nf-cod-folder") :face font-lock-doc-face)
(interface ,(nerd-icons-codicon "nf-cod-symbol_interface") :face font-lock-type-face) (interface ,(nerd-icons-codicon "nf-cod-symbol_interface") :face font-lock-type-face)
(keyword ,(nerd-icons-codicon "nf-cod-symbol_keyword") :face font-lock-keyword-face) (keyword ,(nerd-icons-codicon "nf-cod-symbol_keyword") :face font-lock-keyword-face)
(macro ,(nerd-icons-codicon "nf-cod-symbol_misc") :face font-lock-keyword-face) (macro ,(nerd-icons-codicon "nf-cod-symbol_misc") :face font-lock-keyword-face)
(magic ,(nerd-icons-codicon "nf-cod-wand") :face font-lock-builtin-face) (magic ,(nerd-icons-codicon "nf-cod-wand") :face font-lock-builtin-face)
(method ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face) (method ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face)
(function ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face) (function ,(nerd-icons-codicon "nf-cod-symbol_method") :face font-lock-function-name-face)
(module ,(nerd-icons-codicon "nf-cod-file_submodule") :face font-lock-preprocessor-face) (module ,(nerd-icons-codicon "nf-cod-file_submodule") :face font-lock-preprocessor-face)
(numeric ,(nerd-icons-codicon "nf-cod-symbol_numeric") :face font-lock-builtin-face) (numeric ,(nerd-icons-codicon "nf-cod-symbol_numeric") :face font-lock-builtin-face)
(operator ,(nerd-icons-codicon "nf-cod-symbol_operator") :face font-lock-comment-delimiter-face) (operator ,(nerd-icons-codicon "nf-cod-symbol_operator") :face font-lock-comment-delimiter-face)
(param ,(nerd-icons-codicon "nf-cod-symbol_parameter") :face default) (param ,(nerd-icons-codicon "nf-cod-symbol_parameter") :face default)
(property ,(nerd-icons-codicon "nf-cod-symbol_property") :face font-lock-variable-name-face) (property ,(nerd-icons-codicon "nf-cod-symbol_property") :face font-lock-variable-name-face)
(reference ,(nerd-icons-codicon "nf-cod-references") :face font-lock-variable-name-face) (reference ,(nerd-icons-codicon "nf-cod-references") :face font-lock-variable-name-face)
(snippet ,(nerd-icons-codicon "nf-cod-symbol_snippet") :face font-lock-string-face) (snippet ,(nerd-icons-codicon "nf-cod-symbol_snippet") :face font-lock-string-face)
(string ,(nerd-icons-codicon "nf-cod-symbol_string") :face font-lock-string-face) (string ,(nerd-icons-codicon "nf-cod-symbol_string") :face font-lock-string-face)
(struct ,(nerd-icons-codicon "nf-cod-symbol_structure") :face font-lock-variable-name-face) (struct ,(nerd-icons-codicon "nf-cod-symbol_structure") :face font-lock-variable-name-face)
(text ,(nerd-icons-codicon "nf-cod-text_size") :face font-lock-doc-face) (text ,(nerd-icons-codicon "nf-cod-text_size") :face font-lock-doc-face)
(typeparameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face) (typeparameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face)
(type-parameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face) (type-parameter ,(nerd-icons-codicon "nf-cod-list_unordered") :face font-lock-type-face)
(unit ,(nerd-icons-codicon "nf-cod-symbol_ruler") :face font-lock-constant-face) (unit ,(nerd-icons-codicon "nf-cod-symbol_ruler") :face font-lock-constant-face)
(value ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-builtin-face) (value ,(nerd-icons-codicon "nf-cod-symbol_field") :face font-lock-builtin-face)
(variable ,(nerd-icons-codicon "nf-cod-symbol_variable") :face font-lock-variable-name-face) (variable ,(nerd-icons-codicon "nf-cod-symbol_variable") :face font-lock-variable-name-face)
(t ,(nerd-icons-codicon "nf-cod-code") :face font-lock-warning-face))) (t ,(nerd-icons-codicon "nf-cod-code") :face font-lock-warning-face)))
:config :config
(add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter)) (add-to-list 'corfu-margin-formatters #'kind-icon-margin-formatter))
(use-package nerd-icons-completion (use-package nerd-icons-completion
:after marginalia :after marginalia
:config :config
(nerd-icons-completion-mode) (nerd-icons-completion-mode)
(add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup)) (add-hook 'marginalia-mode-hook #'nerd-icons-completion-marginalia-setup))
#+end_src #+end_src
** Vertico ** Vertico
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package vertico (use-package vertico
:general :general
(:keymaps '(normal insert visual motion) (:keymaps '(normal insert visual motion)
"M-." #'vertico-repeat) ; Perfectly return to the state of the last Vertico minibuffer usage "M-." #'vertico-repeat) ; Perfectly return to the state of the last Vertico minibuffer usage
(:keymaps 'vertico-map (:keymaps 'vertico-map
"C-<return>" #'vertico-insert "C-<return>" #'vertico-insert
"M-s" #'vertico-next-group "M-s" #'vertico-next-group
"M-a" #'vertico-previous-group "M-a" #'vertico-previous-group
"TAB" #'vertico-next "TAB" #'vertico-next
[tab] #'vertico-next [tab] #'vertico-next
"S-TAB" #'vertico-previous "S-TAB" #'vertico-previous
[backtab] #'vertico-previous [backtab] #'vertico-previous
"<backspace>" #'vertico-directory-delete-char "<backspace>" #'vertico-directory-delete-char
"C-<backspace>" #'vertico-directory-delete-word "C-<backspace>" #'vertico-directory-delete-word
"<return>" #'vertico-directory-enter "<return>" #'vertico-directory-enter
"M-j" #'vertico-quick-insert) "M-j" #'vertico-quick-insert)
:hook (minibuffer-setup . vertico-repeat-save) ; Make sure vertico state is saved for `vertico-repeat' :hook (minibuffer-setup . vertico-repeat-save) ; Make sure vertico state is saved for `vertico-repeat'
:custom :custom
(vertico-count 15) (vertico-count 15)
(vertico-resize t) (vertico-resize t)
(vertico-cycle nil) (vertico-cycle nil)
(enable-recursive-minibuffers t) (enable-recursive-minibuffers t)
(vertico-grid-lookahead 50) (vertico-grid-lookahead 50)
(vertico-buffer-display-action '(display-buffer-reuse-window)) (vertico-buffer-display-action '(display-buffer-reuse-window))
(vertico-multiform-categories (vertico-multiform-categories
'((file reverse) '((file reverse)
(consult-ripgrep buffer) (consult-ripgrep buffer)
(consult-location) (consult-location)
(imenu buffer) (imenu buffer)
(library reverse indexed) (library reverse indexed)
(org-roam-node reverse indexed) (org-roam-node reverse indexed)
(t reverse))) (t reverse)))
(vertico-multiform-commands (vertico-multiform-commands
'(("flyspell-correct-*" grid reverse) '(("flyspell-correct-*" grid reverse)
(org-refile grid reverse indexed) (org-refile grid reverse indexed)
(consult-yank-pop indexed) (consult-yank-pop indexed)
(consult-lsp-diagnostics) (consult-lsp-diagnostics)
)) ))
:init :init
(defun crm-indicator (args) (defun crm-indicator (args)
(cons (format "[CRM%s] %s" (cons (format "[CRM%s] %s"
(replace-regexp-in-string (replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator) crm-separator)
(car args)) (car args))
(cdr args))) (cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator) (advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Do not allow the cursor in the minibuffer prompt ;; Do not allow the cursor in the minibuffer prompt
(setq minibuffer-prompt-properties (setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt)) '(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
(setq read-extended-command-predicate
#'command-completion-default-include-p)
(vertico-mode)
(vertico-mouse-mode))
#+end_src
** Consult
#+begin_src emacs-lisp
(use-package consult
:init
(advice-add #'register-preview :override #'consult-register-window)
(setq register-preview-delay 0.5
register-preview-function #'consult-register-format
xref-show-xrefs-function #'consult-xref
xref-show-definitions-function #'consult-xref
consult-narrow-key "<"
completion-in-region-function #'consult-completion-in-region)
:general
(key-leader
:states 'normal
"c" '(nil :which-key "Consult")
"c b" '(consult-buffer :which-key "Consult: Buffers")
"c f" '(consult-fd :which-key "Consult: Find File")
"c r" '(consult-recent-file :which-key "Consult: Recent Files")))
(setq read-extended-command-predicate
#'command-completion-default-include-p)
(vertico-mode)
(vertico-mouse-mode))
#+end_src #+end_src
* Modeline * Modeline
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package doom-modeline (use-package doom-modeline
:custom :custom
(doom-modeline-height 25) (doom-modeline-height 25)
(doom-modeline-bar-width 5) (doom-modeline-bar-width 5)
(doom-modeline-icon t) (doom-modeline-icon t)
(doom-modeline-major-mode-icon t) (doom-modeline-major-mode-icon t)
(doom-modeline-major-mode-color-icon t) (doom-modeline-major-mode-color-icon t)
(doom-modeline-buffer-file-name-style 'truncate-upto-project) (doom-modeline-buffer-file-name-style 'truncate-upto-project)
(doom-modeline-buffer-state-icon t) (doom-modeline-buffer-state-icon t)
(doom-modeline-buffer-modification-icon t) (doom-modeline-buffer-modification-icon t)
(doom-modeline-minor-modes nil) (doom-modeline-minor-modes nil)
(doom-modeline-enable-word-count nil) (doom-modeline-enable-word-count nil)
(doom-modeline-buffer-encoding t) (doom-modeline-buffer-encoding t)
(doom-modeline-indent-info nil) (doom-modeline-indent-info nil)
(doom-modeline-checker-simple-format t) (doom-modeline-checker-simple-format t)
(doom-modeline-vcs-max-length 12) (doom-modeline-vcs-max-length 12)
(doom-modeline-env-version t) (doom-modeline-env-version t)
(doom-modeline-irc-stylize 'identity) (doom-modeline-irc-stylize 'identity)
(doom-modeline-github-timer nil) (doom-modeline-github-timer nil)
(doom-modeline-gnus-timer nil) (doom-modeline-gnus-timer nil)
:config :config
(doom-modeline-mode)) (doom-modeline-mode))
#+end_src
* Save Hist
#+begin_src emacs-lisp
(use-package savehist
:ensure nil
:init
(savehist-mode))
#+end_src #+end_src
* Org Mode * Org Mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org (use-package org
:hook (org-mode . org-indent-mode) :hook (org-mode . org-indent-mode)
:ensure nil :ensure nil
:defer nil :defer nil
:general :general
(key-leader (key-leader
:states 'normal :states 'normal
"o" '(nil :which-key "Org")) "o" '(nil :which-key "Org"))
:custom :custom
(org-agenda-files '("~/Notes" "~/Git/College")) (org-agenda-files '("~/Notes" "~/Git/College"))
(org-hide-emphasis-markers t)) (org-hide-emphasis-markers t))
(use-package org-modern (use-package org-modern
:after org :after org
:config :config
(global-org-modern-mode)) (global-org-modern-mode))
#+end_src #+end_src