Minor updates

This commit is contained in:
Andrew Scott 2023-09-04 03:42:08 -04:00
parent 99e6c22573
commit 30ca8a5ed9
Signed by: a
GPG key ID: 7CD5A5977E4931C1

View file

@ -39,7 +39,6 @@
(float-time
(time-subtract (current-time) before-init-time)))
gcs-done)))
;;; Initialize elpaca
(defvar elpaca-installer-version 0.5)
(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory))
@ -88,6 +87,25 @@
;;; Built-in features
(use-package emacs
:elpaca nil
:init
;;; Vertico
;; Add prompt to `completing-read-multiple'
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Recursive minibuffers
(setq enable-recursive-minibuffers t)
;; Disable prompt in minibuffer
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
:bind
(:map global-map
;; Disable suspend-frame shortcut
@ -99,7 +117,7 @@
("S-C-<right>" . enlarge-window-horizontally)
("S-C-<down>" . shrink-window)
("S-C-<up>" . enlarge-window))
:init
:config
;;; General Options
;; Better scrolling
(setq scroll-step 1
@ -120,26 +138,7 @@
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
;;; Vertico
;; Add prompt to `completing-read-multiple'
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
;; Recursive minibuffers
(setq enable-recursive-minibuffers t)
;; Disable prompt in minibuffer
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode))
(set-keyboard-coding-system 'utf-8))
(use-package compile
:elpaca nil
@ -154,8 +153,8 @@
:elpaca nil
:hook ((conf-mode
markdown-mode
lsp-mode) . display-fill-column-indicator-mode)
:config (setq-default fill-column 80))
prog-mode) . display-fill-column-indicator-mode)
:config (setq-default fill-column 100))
(use-package display-line-numbers
:elpaca nil
@ -169,16 +168,16 @@
(use-package files
:elpaca nil
:config
(let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
(setq backup-directory-alist `((".*" . ,auto_save_directory))
auto-save-file-name-transforms `((".*" ,auto_save_directory t))))
(setq backup-by-copying t
confirm-kill-processes nil
delete-old-versions t
kept-new-versions 5
kept-old-versions 3
require-final-newline t
version-control t)
(let ((auto_save_directory (concat xdg_cache_home "auto-save-list/")))
(setq backup-directory-alist `((".*" . ,auto_save_directory))
auto-save-file-name-transforms `((".*" ,auto_save_directory t)))))
version-control t))
(use-package flyspell
:elpaca nil
@ -227,8 +226,8 @@
(use-package simple
:elpaca nil
:config
(setq-default indent-tabs-mode nil
column-number-mode t))
(setq-default indent-tabs-mode nil)
(column-number-mode))
(use-package whitespace
:elpaca nil
@ -238,11 +237,12 @@
text-mode) . whitespace-mode)
:config
(add-hook 'before-save-hook #'whitespace-cleanup)
(setq whitespace-line-column 100
whitespace-style '(big-indent
face
lines-tail
(setq whitespace-line-column nil
whitespace-style '(face
lines-char
missing-newline-at-eof
space-after-tab
space-before-tab
tabs
trailing)))
@ -254,21 +254,31 @@
;; Theme
(use-package everforest
:elpaca (everforest
:host sourcehut
:repo "theorytoe/everforest-theme")
:elpaca (everforest :host sourcehut :repo "theorytoe/everforest-theme")
:config
(setq custom-safe-themes t)
(load-theme 'everforest-hard-dark t)
(set-face-attribute 'cursor nil :background "#7fbbb3")
(let ((line (face-attribute 'mode-line :foreground))
(inactive (face-attribute 'mode-line-inactive :background)))
(set-face-attribute 'mode-line nil :overline line)
(set-face-attribute 'mode-line-inactive nil :overline line)
(set-face-attribute 'mode-line-inactive nil :underline line)
(let ((moody_line (face-attribute 'mode-line :foreground))
(moody_inactive (face-attribute 'mode-line-inactive :background)))
(set-face-attribute 'mode-line nil :overline moody_line)
(set-face-attribute 'mode-line-inactive nil :overline moody_line)
(set-face-attribute 'mode-line-inactive nil :underline moody_line)
(set-face-attribute 'mode-line nil :box nil)
(set-face-attribute 'mode-line-inactive nil :box nil)
(set-face-attribute 'mode-line-inactive nil :background inactive)))
(set-face-attribute 'mode-line-inactive nil :background moody_inactive))
:custom-face
(cursor ((t (:background "#7fbbb3"))))
(whitespace-big-indent ((t (:background "#9da9a0"))))
(whitespace-empty ((t (:background "#9da9a0"))))
(whitespace-hspace ((t (:background "#9da9a0"))))
(whitespace-indentation ((t (:background "#9da9a0"))))
(whitespace-line ((t (:background "#e67e80"))))
(whitespace-newline ((t (:background "#e67e80"))))
(whitespace-space ((t (:background "#9da9a0"))))
(whitespace-space-after-tab ((t (:background "#9da9a0"))))
(whitespace-space-before-tab ((t (:background "#9da9a0"))))
(whitespace-tab ((t (:background "#9da9a0"))))
(whitespace-trailing ((t (:background "#e67e80")))))
(elpaca-wait)
@ -450,8 +460,7 @@
:config (push #'kind-icon-margin-formatter corfu-margin-formatters)
:custom
(kind-icon-default-face 'corfu-default)
(kind-icon-blend-background nil)
(svg-lib-icons-dir (concat xdg_cache_home "svg-lib/")))
(kind-icon-blend-background nil))
;; Git
(use-package magit
@ -554,7 +563,7 @@
;; Syntax checking
(use-package flycheck
:hook (lsp-mode . flycheck-mode)
:custom (flycheck-python-flake8-executable 'flake8))
:custom (flycheck-python-flake8-executable "flake8"))
(use-package consult-flycheck
:after (consult flycheck))
@ -577,13 +586,13 @@
:hook (lsp-mode . lsp-ui-mode)
:custom
(lsp-ui-doc-position 'bottom-and-right)
(lsp-ui-flycheck-enable t)
(lsp-ui-flycheck-list-position 'right)
(lsp-ui-peek-enable t)
(lsp-ui-sideline-delay 0.6)
(lsp-ui-sideline-show-code-actions t)
(lsp-ui-sideline-show-hover t)
(lsp-ui-sideline-update-mode 'line)
(lsp-ui-flycheck-enable t)
(lsp-ui-flycheck-list-position 'right)
(lsp-ui-peek-enable t))
(lsp-ui-sideline-update-mode 'line))
(use-package consult-lsp
:after (consult lsp-mode)
@ -608,14 +617,14 @@
:config
(eval-when-compile
(require 'cl-lib))
(require 'dap-python)
(require 'dap-lldb)
(require 'dap-gdb-lldb)
(require 'dap-lldb)
(require 'dap-python)
:custom
(dap-breakpoints-file (concat xdg_cache_home "dap-breakpoints"))
(dap-utils-extension-path (concat user-emacs-directory "dap-extensions/"))
(dap-auto-configure-features '(sessions locals tooltip))
(dap-breakpoints-file (concat xdg_cache_home "dap-breakpoints"))
(dap-lldb-debug-program 'lldb-vscode)
(dap-utils-extension-path (concat user-emacs-directory "dap-extensions/"))
(dap-python-debugger 'debugpy)
;; Templates
(dap-register-debug-template
@ -648,6 +657,7 @@
(use-package lsp-pyright
:after (python)
:hook (python-ts-mode . (lambda ()
(setq-local fill-column 80)
(require 'lsp-pyright)
(lsp)))) ; or `lsp-deferred'
@ -672,23 +682,22 @@
;; Web templates
(use-package web-mode
:custom
(web-mode-attribute-indent-offset 2)
(web-mode-code-indent-offset 2)
(web-mode-enable-front-matter-block t)
(web-mode-markup-indent-offset 2)
(web-mode-attribute-indent-offset 2)
:mode
((("\\.astro\\'" "\\.html?\\'") . web-mode)))
;; Zig
(use-package zig-mode
:hook
(zig-mode . (lambda ()
(setq-local fill-column 100)
(setq-local tab-width 4))))
:commands (zig-mode)
:config (setq-local fill-column 100))
;;; File format/markup support
(use-package markdown-mode
:commands (markdown-mode))
:commands (markdown-mode)
:config (setq-local fill-column 120))
(use-package yaml-pro
:hook (yaml-ts-mode . yaml-pro-ts-mode))