A week's worth of emacs config updates

This commit is contained in:
Ian Keane 2023-12-23 22:13:16 -05:00
parent 39c722cfaf
commit 7d28feb884
2 changed files with 201 additions and 104 deletions

2
.gitignore vendored
View file

@ -5,3 +5,5 @@ slackware/home/vim/.vim/autoload/*
slackware/home/vim/.vim/undo/*
*.swp
*.netrwhist
.DS_Store
slackware/home/doom/.doom.d/config.el

View file

@ -118,6 +118,8 @@ Eventually I'll set this up so that all these directories are set in the config
empv-audio-dir "~/.config/emacs/audio"
backup-directory-alist `(("." . "~/.config/emacs/backups/"))
auto-save-file-name-transforms `((".*" "~/.config/emacs/autosaves/" t)))
(projectile-mode)
#+end_src
** Helper Functions
#+begin_src emacs-lisp
@ -201,7 +203,9 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
'(org-mode-hook
term-mode-hook
eshell-mode-hook
treemacs-mode-hook))
treemacs-mode-hook
vterm-mode-hook
nov-mode-hook))
(add-hook mode (lambda () (display-line-numbers-mode 0))))
(column-number-mode)
#+end_src
@ -240,6 +244,8 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
(setq indent-tabs-mode nil) ; tabs not spaces
(visual-line-mode) ; wrap long lines visually
(whitespace-mode)
(setq-default indent-tabs-mode nil)
#+end_src
** Tab bar
#+begin_src emacs-lisp
@ -249,6 +255,57 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
(tab-bar-echo-area-mode 1)
(setq tab-bar-show nil))
#+end_src
* Evil
#+begin_src emacs-lisp
(use-package evil
:ensure t
:config
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
(define-key evil-normal-state-map (kbd "ghp") 'git-gutter+-previous-hunk)
(define-key evil-normal-state-map (kbd "ghn") 'git-gutter+-next-hunk)
(define-key evil-normal-state-map (kbd "ghr") 'git-gutter+-revert-hunk)
(define-key evil-normal-state-map (kbd "ghs") 'git-gutter+-popup-hunk)
(define-key evil-normal-state-map (kbd "ghS") 'git-gutter+-stage-hunk)
(define-key evil-normal-state-map (kbd "gp") nil)
(define-key evil-normal-state-map (kbd "gpn") 'popper-cycle)
(define-key evil-normal-state-map (kbd "gpp") 'popper-cycle-backwards)
(define-key evil-normal-state-map (kbd "gpq") 'popper-kill-latest-popup)
(define-key evil-normal-state-map (kbd "gpt") 'popper-toggle-type)
(define-key evil-normal-state-map (kbd "gbn") 'projectile-next-project-buffer)
(define-key evil-normal-state-map (kbd "gbp") 'projectile-previous-project-buffer)
(evil-mode 1))
(use-package undo-tree
:ensure t
:after evil
:diminish
:config
(evil-set-undo-system 'undo-tree)
(global-undo-tree-mode 1))
(use-package evil-org
:ensure t
:after org
:hook (org-mode . (lambda () evil-org-mode)))
(use-package evil-collection
:after evil
:ensure t
:diminish evil-collection-unimpaired-mode
:init
:config
(setq evil-respect-visual-line-mode t)
(evil-collection-init))
(use-package evil-commentary
:config
(evil-commentary-mode))
#+end_src
* Navigation
** Helper Functions
#+begin_src emacs-lisp
@ -313,6 +370,7 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
'(
(helpful-mode :align right :select t :size 0.3 :popup t)
(help-mode :align right :select t :size 0.3 :popup t)
(compilation-mode :align right :select t :size 0.3 :popup t)
("*shell*" :align below :select t :size 0.3 :popup t)
("*eshell*" :align below :select t :size 0.3 :popup t)
("*vterm*" :align below :select t :size 0.3 :popup t)
@ -376,10 +434,16 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
(setq dired-open-extensions '(("png" . "sxiv")
("mkv" . "mpv")
("avi" . "mpv"))))
;; (eval-after-load 'evil
;; '(evil-define-key 'normal dired-mode-map (kbd "SPC") nil))
(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
#+end_src
#+RESULTS:
| all-the-icons-dired-mode | dired-extra-startup |
** Treemacs
#+begin_src emacs-lisp
(use-package treemacs
@ -400,6 +464,8 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear
(use-package all-the-icons)
(use-package treemacs-all-the-icons)
(use-package treemacs-evil)
#+end_src
** Which-key
#+begin_src emacs-lisp
@ -418,10 +484,13 @@ I know these could be bound on a per-package basis, but since this is my primary
#+begin_src emacs-lisp
(use-package general
:ensure t
:after nov evil evil-collection
:config
(general-create-definer general-definition
:keymaps '(normal insert visual emacs)
;; :keymaps '(normal insert visual emacs nov-mode-map nov-button-map dired-mode-map)
:states '(normal visual)
:keymaps 'override
:prefix "SPC"
:global-prefix "C-SPC")
@ -717,7 +786,8 @@ I know these could be bound on a per-package basis, but since this is my primary
(org-babel-do-load-languages
'org-babel-load-languages
'((emacs-lisp . t)
(python . t)))
(python . t)
(mermaid . t)))
(setq org-confirm-babel-evaluate nil)
@ -736,7 +806,8 @@ I know these could be bound on a per-package basis, but since this is my primary
:custom
(org-roam-directory "~/notes/roam")
:config
(org-roam-db-autosync-mode))
(org-roam-db-autosync-mode)
(setq org-link-frame-setup '((file . find-file))))
(use-package deft
:commands (deft)
@ -757,6 +828,12 @@ I know these could be bound on a per-package basis, but since this is my primary
org-roam-ui-open-on-start t))
(use-package ox-gfm) ; github-flavored-markdown exporter
(use-package ob-mermaid)
(setq ob-mermaid-cli-path "/usr/local/bin/mmdc")
(use-package org-download)
#+end_src
* Project management
#+begin_src emacs-lisp
@ -775,6 +852,7 @@ I know these could be bound on a per-package basis, but since this is my primary
#+begin_src emacs-lisp
(use-package consult
:bind (:map minibuffer-local-map ("C-r" . consult-history)))
(setq consult-rpigrep-args "rg --nul --line buffered --color=never --max-columns=1000 --path-separator / --smart-case --no-heading --with-filename --line-number --search-zip --hidden")
#+end_src
** Generic completion
Idk I think this came from the vertico readme
@ -838,6 +916,7 @@ Idk I think this came from the vertico readme
#+begin_src emacs-lisp
(use-package embark
:ensure t
:after evil evil-collection evil-org
:diminish eldoc-mode
:bind
(("C-." . embark-act) ;; pick some comfortable binding
@ -847,11 +926,12 @@ Idk I think this came from the vertico readme
;; Show the Embark target at point via Eldoc. You may adjust the Eldoc
;; strategy, if you want to see the documentation from multiple providers.
(add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
;; (add-hook 'eldoc-documentation-functions #'embark-eldoc-first-target)
(define-key evil-normal-state-map (kbd "C-.") 'embark-act)
(evil-define-key 'normal evil-normal-state-map (kbd "C-.") embark-act)
:config
(with-eval-after-load 'evil
(define-key evil-normal-state-map (kbd "C-.") 'embark-act))
;; Hide the mode line of the Embark live/completions buffers
(add-to-list 'display-buffer-alist
'("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*"
@ -903,6 +983,9 @@ Idk I think this came from the vertico readme
(advice-add #'embark-completing-read-prompter
:around #'embark-hide-which-key-indicator)
#+end_src
#+RESULTS:
** Snippets
#+begin_src emacs-lisp
(use-package yasnippet
@ -920,6 +1003,7 @@ Idk I think this came from the vertico readme
(setq lsp-keymap-prefix "C-c l")
:config
(lsp-enable-which-key-integration t)
(setq lsp-headerline-breadcrumb-enable nil)
:hook (terraform-mode . lsp-deferred)
:hook (rust-mode . lsp-deferred))
@ -957,6 +1041,11 @@ All lisp-family languages
:config
(lispyville-set-key-theme '(operators c-w additional)))
#+end_src
** Go
#+begin_src emacs-lisp
(use-package go-mode)
(add-hook 'go-mode-hook 'lsp-deferred)
#+end_src
* Markups
** Markdown
#+begin_src emacs-lisp
@ -988,6 +1077,36 @@ This is mostly lifted from the doom emacs config. Beancount-mode by default has
(add-hook 'beancount-mode-hook #'flymake-bean-check-enable)
#+end_src
** Epub
#+begin_src emacs-lisp
(use-package nov
:after evil evil-collection
:config
;; (define-key nov-button-map (kbd "SPC") nil)
;; (evil-define-key 'normal nov-mode-map (kbd "SPC") nil)
;; (evil-define-key 'normal nov-button-map (kbd "SPC") nil)
;; (define-key nov-mode-map (kbd "SPC") nil)
(setq nov-text-width 80))
(add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
#+end_src
* Containers
** Docker
#+begin_src emacs-lisp
(use-package dockerfile-mode)
(use-package docker-compose-mode)
;; (use-package docker)
;; Todo: lsp-docker? docker-tramp? docker-cli?
#+end_src
** Kubernetes
#+begin_src emacs-lisp
(use-package k8s-mode)
;; kubernetes
;; kubernetes-evil
;; kubernetes-helm
;; kubernetes-tramp
#+end_src
* Shells
** Enable fish completions
Uses the external fish program to provide fish-style completions to eshell etc
@ -1008,54 +1127,6 @@ Uses the external fish program to provide fish-style completions to eshell etc
(use-package git-timemachine)
#+end_src
* Evil
#+begin_src emacs-lisp
(use-package evil
:ensure t
:config
(global-set-key (kbd "<escape>") 'keyboard-escape-quit)
(define-key evil-normal-state-map (kbd "j") 'evil-next-visual-line)
(define-key evil-normal-state-map (kbd "k") 'evil-previous-visual-line)
(define-key evil-normal-state-map (kbd "ghp") 'git-gutter+-previous-hunk)
(define-key evil-normal-state-map (kbd "ghn") 'git-gutter+-next-hunk)
(define-key evil-normal-state-map (kbd "ghr") 'git-gutter+-revert-hunk)
(define-key evil-normal-state-map (kbd "ghs") 'git-gutter+-popup-hunk)
(define-key evil-normal-state-map (kbd "ghS") 'git-gutter+-stage-hunk)
(define-key evil-normal-state-map (kbd "gp") nil)
(define-key evil-normal-state-map (kbd "gpn") 'popper-cycle)
(define-key evil-normal-state-map (kbd "gpp") 'popper-cycle-backwards)
(define-key evil-normal-state-map (kbd "gpq") 'popper-kill-latest-popup)
(define-key evil-normal-state-map (kbd "gpt") 'popper-toggle-type)
(define-key evil-normal-state-map (kbd "gbn") 'projectile-next-project-buffer)
(define-key evil-normal-state-map (kbd "gbp") 'projectile-previous-project-buffer)
(evil-mode 1))
(use-package undo-tree
:ensure t
:after evil
:diminish
:config
(evil-set-undo-system 'undo-tree)
(global-undo-tree-mode 1))
(use-package evil-org
:ensure t
:after org
:hook (org-mode . (lambda () evil-org-mode)))
(use-package evil-collection
:after evil
:ensure t
:diminish evil-collection-unimpaired-mode
:init
:config
(setq evil-respect-visual-line-mode t)
(evil-collection-init))
(use-package evil-commentary
:config
(evil-commentary-mode))
#+end_src
* Web browsing and youtube
#+begin_src emacs-lisp
;; Using straight:
@ -1164,6 +1235,9 @@ Scrutinize which processes are gumming up emacs
- Set things which should be set before package install in :init
- Disable source editing issue
- Goes away when I run =(defun org-edit-src-code nil)=
- Go through AWB's notes about using gnus
- TODO aggregation
- Suppress evilmarkdown mode and org-roam-ui minor mode
** Terminals
- More terminals
@ -1176,10 +1250,15 @@ Scrutinize which processes are gumming up emacs
** Note taking
- deft
- org : roam2, hugo, pretty, dragndrop, bullet
- meetlog reference buffer
- work roam directory
- [[https://www.youtube.com/watch?v=3-sLBaJAtew][Dalies]] for scheduling things
- Fix org indentation stuff
** Lisp stuff
- paredit
- lispy
- no tabs for yaml-mode (wtf?)
** One-offs
- hl-todo
@ -1193,6 +1272,14 @@ Scrutinize which processes are gumming up emacs
- Undo-Tree, company, flycheck, which-key
- ignore case in imenu
- improve which-key visibility
- gpt popup
- org-roam-buffer popup
- conflicts with global popup buffers
- [[https://old.reddit.com/r/emacs/comments/o04it0/share_your_prettifysymbolsalist/][prettify-symbols-mode]]
** NFS stuff
- map music from nfs
- map books from nfs with nov.el
** LSP stuff
- look into treemacs integrations
@ -1207,6 +1294,20 @@ Scrutinize which processes are gumming up emacs
- get vertico as completion box
** Keybindings
- treemacs-open-other-window
- treemacs | to open in split
- init popup buffer binding? spc r i?
- org-roam buffer in popup (follow)
- create-tab-with-name function
- buffer to spc b b local, spc b B global
- do somthing useful with ','
- custom function for toggle between last 2 windows
- custom function to scroll-other-window using last 2 windows
- evil-define-key instead of define-key everywhere
- bind something to create file in dired / treemacs
- fix general prefix in treemacs mode
- fix vim-surround
- snippets help =spc h y=, helpful-symbol =spc h s=
- put general bindings in separate keymaps in separate sections
- map hyper bindings for buffer nav and jumping
- evil-org
@ -1242,6 +1343,7 @@ Scrutinize which processes are gumming up emacs
selected radio (See empv-radio-log-file and empv-radio-log-format
variables and their documentations).
** New plugins
- tramp
- k8s
@ -1276,10 +1378,3 @@ variables and their documentations).
- [[https://www.youtube.com/watch?v=0C16LLHGYzk&t=1882s][Converting a literate config to guix home]]
- [[https://www.youtube.com/playlist?list=PLEoMzSkcN8oM-kA19xOQc8s0gr0PpFGJQ][Emacs mail playlist]]
- [[https://www.youtube.com/watch?v=qk2Is_sC8Lk][Embark]]
** Clean up Org Roam
- Major mode notes master node
** Create yasnippets repo as per [[https://github.com/joaotavora/yasnippet#where-are-the-snippets][The docs]]