diff --git a/.gitignore b/.gitignore index 1157d2a..5fdae22 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/guix/init.org b/guix/init.org index f46f1ef..e72daaa 100644 --- a/guix/init.org +++ b/guix/init.org @@ -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 @@ -198,10 +200,12 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear ;; turn off number mode in some contexts (dolist (mode - '(org-mode-hook - term-mode-hook - eshell-mode-hook - treemacs-mode-hook)) + '(org-mode-hook + term-mode-hook + eshell-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 "") '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) @@ -360,11 +418,11 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear (defun my-dired-init () "Bunch of stuff to run for dired, either immediately or when it's loaded." (define-key dired-mode-map [remap dired-find-file] - 'dired-single-buffer) + 'dired-single-buffer) (define-key dired-mode-map [remap dired-mouse-find-file-other-window] - 'dired-single-buffer-mouse) + 'dired-single-buffer-mouse) (define-key dired-mode-map [remap dired-up-directory] - 'dired-single-up-directory)) + 'dired-single-up-directory)) ;; if dired's already loaded, then the keymap will be bound (if (boundp 'dired-mode-map) @@ -374,12 +432,18 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear (use-package dired-open :config (setq dired-open-extensions '(("png" . "sxiv") - ("mkv" . "mpv") - ("avi" . "mpv")))) + ("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 @@ -394,12 +458,14 @@ Setting this in the :init of evil doesn't work for some reason. It has to be ear to the treemacs window" (interactive) (if - (not(eq (treemacs-current-visibility) 'visible)) - (treemacs-find-file)) + (not(eq (treemacs-current-visibility) 'visible)) + (treemacs-find-file)) (treemacs-select-window)) (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,14 +806,15 @@ 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) :config (setq deft-directory "~/notes/deft" - deft-extensions '("org" "txt") - deft-recursive t)) + deft-extensions '("org" "txt") + deft-recursive t)) (use-package ox-hugo :after ox) @@ -752,11 +823,17 @@ I know these could be bound on a per-package basis, but since this is my primary :after org-roam :config (setq org-roam-ui-sync-theme t - org-roam-ui-follow t - org-roam-ui-update-on-save t - org-roam-ui-open-on-start t)) + org-roam-ui-follow t + org-roam-ui-update-on-save t + 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 @@ -773,8 +850,9 @@ I know these could be bound on a per-package basis, but since this is my primary #+end_src ** Consult #+begin_src emacs-lisp -(use-package consult - :bind (:map minibuffer-local-map ("C-r" . consult-history))) + (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,16 +926,17 @@ 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\\)\\*" - nil - (window-parameters (mode-line-format . none))))) + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) ;; Consult users will also want the embark-consult package. (use-package embark-consult @@ -872,37 +952,40 @@ Idk I think this came from the vertico readme targets." (lambda (&optional keymap targets prefix) (if (null keymap) - (which-key--hide-popup-ignore-command) - (which-key--show-keymap - (if (eq (plist-get (car targets) :type) 'embark-become) - "Become" - (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) - ((and (pred keymapp) km) km) - (_ (key-binding prefix 'accept-default))) - keymap) - nil nil t (lambda (binding) - (not (string-suffix-p "-argument" (cdr binding)))))))) + (which-key--hide-popup-ignore-command) + (which-key--show-keymap + (if (eq (plist-get (car targets) :type) 'embark-become) + "Become" + (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) + ((and (pred keymapp) km) km) + (_ (key-binding prefix 'accept-default))) + keymap) + nil nil t (lambda (binding) + (not (string-suffix-p "-argument" (cdr binding)))))))) (setq embark-indicators - '(embark-which-key-indicator - embark-highlight-indicator - embark-isearch-highlight-indicator)) + '(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))) + (remq #'embark-which-key-indicator embark-indicators))) (apply fn args))) (advice-add #'embark-completing-read-prompter - :around #'embark-hide-which-key-indicator) + :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 "") '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,7 +1235,10 @@ 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 - emacs-fish-completions @@ -1176,11 +1250,16 @@ 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 - persistent undo @@ -1193,7 +1272,15 @@ 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 - consider eglot @@ -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]]