Update doom-emacs-config

This commit is contained in:
Jeffrey Serio 2024-07-08 00:26:36 -05:00
parent 3b1ef7add5
commit a2729d1aa1
3 changed files with 31 additions and 122 deletions

125
config.el
View File

@ -1,6 +1,5 @@
;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-
;;;; Misc settings
;; start Emacs as a server process
@ -17,23 +16,6 @@
(setq projectile-project-root-files-bottom-up
(remove ".git" projectile-project-root-files-bottom-up)))
;; This sets the frame dimensions and position take up the right half
;; of the screen when the host is default.ravenwatch, which has an
;; ultra-wide monitor.
;; (when (string= (system-name) "moonshadow")
;; (setq default-frame-alist
;; '((height . 55)
;; (width . 154)
;; (left . 1720)
;; (top . 0)
;; (vertical-scroll-bars . nil)
;; (horizontal-scroll-bars . nil))))
;; ;; This sets the frame to be fullscreen and maximized when the host is
;; ;; default.evergloam, which is my 15-inch screen laptop.
;; (when (string= (system-name) "evergloam")
;; (add-to-list 'default-frame-alist '(fullscreen . maximized)))
;; Set fonts
(setq fontsize 18)
(setq monofontfam "JetBrainsMono Nerd Font Mono")
@ -211,15 +193,10 @@ If point was already at that position, move point to beginning of line."
;; org-mode tags
;; I hardly use these but whatever
(setq org-tag-alist (quote (("@archiving" .?a)
("@calendar" .?t)
("@config" . ?c)
("@devel" . ?d)
("@errand" . ?e)
("@fedora" . ?f)
("@blog" .?b)
("@homelab" . ?l)
("@homemaking" . ?m)
("@journal" . ?j)
("@log" . ?w)
("@hyperreal.coffee" .?h)
("@nirn.quest" .?n)
("@reading" . ?r)
("@selfcare" . ?s))))
@ -351,78 +328,34 @@ If point was already at that position, move point to beginning of line."
(global-set-key (kbd "C-c C-d") #'helpful-at-point)
;;;; dired
(after! dired
(setq dired-listing-switches "-laGh1v --group-directories-first")
(setq dired-confirm-shell-command nil
dired-no-confirm t
dired-deletion-confirmer '(lambda (x) t)
dired-recursive-deletes 'always))
;; casual-dired
;(define-key dired-mode-map (kbd "C-o") #'casual-dired-tmenu)
;;;; dictionary
(global-set-key (kbd "C-c l") #'dictionary-lookup-definition)
(setq dictionary-server "dict.org")
;;;; centaur-tabs
;;;; magit
;; from https://anonoverflow.nirn.quest/exchange/emacs/questions/35775/how-to-kill-magit-diffs-buffers-on-quit
(defun kill-magit-diff-buffer-in-current-repo (&rest _)
"Delete the magit-diff buffer related to the current repo."
(let ((magit-diff-buffer-in-current-repo
(magit-mode-get-buffer 'magit-diff-mode)))
(kill-buffer magit-diff-buffer-in-current-repo)))
(global-set-key (kbd "s-{") 'centaur-tabs-switch-group)
(global-set-key (kbd "s-h") 'centaur-tabs-backward-tab)
(global-set-key (kbd "s-l") 'centaur-tabs-forward-tab)
;; When 'C-c C-c' is pressed in the magit commit message buffer,
;; delete the magit-diff buffer related to the current repo.
(add-hook 'git-commit-setup-hook
(lambda ()
(add-hook 'with-editor-post-finish-hook
#'kill-magit-diff-buffer-in-current-repo
nil t)))
(setq centaur-tabs-buffer-show-groups t)
(defun my-centaur-tabs-buffer-groups ()
"Create centaur-tabs groups."
(cond
((string-equal "*" (substring (buffer-name) 0 1))
'("Emacs"))
((memq major-mode '(org-mode
org-agenda-clockreport-mode
org-src-mode
org-beamer-mode
org-indent-mode
org-bullets-mode
org-agenda-log-mode
diary-mode
org-roam-mode))
'("OrgMode"))
((memq major-mode '(dired-mode))
'("Dired"))
((memq major-mode '(helpful-mode
help-mode))
'("Help"))
((memq major-mode '(vterm-mode))
'("VTerm"))))
;;;; dired
(setq centaur-tabs-buffer-groups-function 'my-centaur-tabs-buffer-groups)
;; prevent access to specified buffers
(defun centaur-tabs-hide-tab (x)
"Do not show given buffer in tabs."
(let ((name (format "%s" x)))
(or
;; Current window is not dedicated window.
(window-dedicated-p (selected-window))
;; Buffer name does not match blacklisted buffers.
(string-prefix-p "*epc" name)
(string-prefix-p "*Compile-Log*" name)
(string-prefix-p "*lsp" name)
(string-prefix-p "*tramp" name)
(string-prefix-p "*help" name)
(string-prefix-p "*Help" name)
(string-prefix-p "*vterminal" name)
;; Buffer is not a magit buffer.
(and (string-prefix-p "magit" name)
(not (file-name-extension name)))
)))
(map! :after dired
:map dired-mode-map
"C-o" #'casual-dired-tmenu)
;;;; elpher
@ -435,22 +368,6 @@ If point was already at that position, move point to beginning of line."
(setq vterm-kill-buffer-on-exit t)
(setq vterm-always-compile-module t)
(setq multi-vterm-buffer-name "localhost")
(defun hyperreal/create-mvterm-buffer ()
"Create new multi-vterm buffer and rename it to localhost<i>
and switch to it."
(interactive)
(let ((index 1)
(buffer-name "localhost"))
;; Find the next available index number
(while (get-buffer (format "%s<%d>" buffer-name index))
(setq index (1+ index)))
(multi-vterm)
(setq mvterm-buffer-name (format "%s<%d>" buffer-name index))
(rename-buffer mvterm-buffer-name)
(message "Created and started: %s" mvterm-buffer-name)
(switch-to-buffer mvterm-buffer-name)))
;;;; nushell

13
init.el
View File

@ -22,6 +22,7 @@
:completion
company ; the ultimate code completion backend
;;(corfu +orderless) ; complete with cap(f), cape and a flying feather!
;;helm ; the *other* search engine for love and life
;;ido ; the other *other* search engine...
;;ivy ; a search engine for love and life
@ -34,9 +35,8 @@
;;doom-quit ; DOOM quit-message prompts when you quit Emacs
(emoji +unicode) ; 🙂
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
;;hydra
;;indent-guides ; highlighted indent columns
;;ligatures ; ligatures and symbols to make your code pretty again
ligatures ; ligatures and symbols to make your code pretty again
;;minimap ; show a map of the code on the side
modeline ; snazzy, Atom-inspired modeline, plus API
;;nav-flash ; blink cursor line after big motions
@ -77,7 +77,7 @@
;;eshell ; the elisp shell that works everywhere
;;shell ; simple shell REPL for Emacs
;;term ; basic terminal emulator for Emacs
;;vterm ; the best terminal emulation in Emacs
vterm ; the best terminal emulation in Emacs
:checkers
syntax ; tasing you for every semicolon you forget
@ -98,11 +98,9 @@
lsp ; M-x vscode
magit ; a git porcelain for Emacs
make ; run make tasks from Emacs
pass ; password manager for nerds
;;pass ; password manager for nerds
pdf ; pdf enhancements
;;prodigy ; FIXME managing external services & code builders
;;rgb ; creating color strings
;;taskrunner ; taskrunner for all your projects
;;terraform ; infrastructure as code
;;tmux ; an API for interacting with tmux
tree-sitter ; syntax and parsing, sitting in a tree...
@ -121,7 +119,7 @@
;;coq ; proofs-as-programs
;;crystal ; ruby at the speed of c
;;csharp ; unity, .NET, and mono shenanigans
;;data ; config/data formats
data ; config/data formats
;;(dart +flutter) ; paint ui and not much else
;;dhall
;;elixir ; erlang done right
@ -187,7 +185,6 @@
;;everywhere ; *leave* Emacs!? You must be joking
;;irc ; how neckbeards socialize
;;(rss +org) ; emacs as an RSS reader
;;twitter ; twitter client https://twitter.com/vnought
:config
;;literate

View File

@ -15,25 +15,20 @@
(package! elpher)
(package! elpy)
(package! evil-nerd-commenter)
(package! fzf)
(package! gemini :recipe
(:host nil :repo "https://git.carcosa.net/jmcbray/gemini.el"))
(package! go-complete)
(package! helpful)
(package! importmagic)
(package! just-mode)
(package! ledger-mode)
(package! license-templates)
(package! multi-vterm)
(package! nushell-mode :recipe (:host github :repo "mrkkrp/nushell-mode"))
(package! nushell-ts-mode :recipe
(:host github :repo "herbertjones/nushell-ts-mode"))
;(package! org)
;(package! org-superstar)
(package! org-superstar)
(package! ox-gemini)
(package! pdf-tools)
(package! python-docstring)
(package! shell-pop)
(package! systemd)
(package! tramp)
(package! undo-tree)