diff --git a/guix/init.org b/guix/init.org index 008249c..3d7945f 100644 --- a/guix/init.org +++ b/guix/init.org @@ -1,8 +1,8 @@ -#+title Ian's Emacs Config #+PROPERTY: header-args:emacs-lisp :tangle (if (eq system-type 'darwin) "~/dotfiles/guix/init.el" "~/.config/emacs/init.el") +#+OPTIONS: toc:nil title:nil #+EXPORT_FILE_NAME: ~/code/website/src/content/dotfiles/emacs.md -#+begin_src +#+BEGIN_EXPORT markdown +++ title = "Emacs Configuration" author = ["Ian Keane"] @@ -10,12 +10,13 @@ date = 2023-02-09 tags = ["Config", "Text editing"] description = 'My emacs configuration.' +++ -#+end_src - +#+END_EXPORT * Preamble My emacs configuration. It tangles to =.emacs.d/init.el= and exports to this markdown file on save. If you're viewing this in a repo, it's better to visit the website at . If you are viewing this on the website and want the repo, you can find it at . To see the hugo front-matter configuration, you'll have to view the raw code. +#+TOC: headlines 2 + * First things first ** Literate Config Setup To get started, run =C-c C-v t= @@ -31,7 +32,7 @@ To get started, run =C-c C-v t= (add-hook 'after-save-hook #'dotfiles/org-babel-tangle-config))) #+end_src ** Package initialization -- =TODO:= savehist mode doesn't seem to save the history correctly +=TODO:= savehist mode doesn't seem to save the history correctly #+begin_src emacs-lisp (require 'package) @@ -138,6 +139,12 @@ Eventually I'll set this up so that all these directories are set in the config (interactive) (load-file user-init-file)) #+end_src +** Evil-want-keybinding +Setting this in the :init of evil doesn't work for some reason. It has to be early in the file +=TODO:= find a better solution +#+begin_src emacs-lisp + (setq evil-want-keybinding nil) +#+end_src * Basic Appearance and Behaviors ** Font and Theme #+begin_src emacs-lisp @@ -207,6 +214,7 @@ Eventually I'll set this up so that all these directories are set in the config #+end_src ** Behavioral Tweaks #+begin_src emacs-lisp + (when IS-MACOS (setq mac-pass-command-to-system nil)) @@ -255,7 +263,9 @@ Eventually I'll set this up so that all these directories are set in the config (other-window 1)) #+end_src ** Windows and Workspaces -[[https://github.com/abo-abo/ace-window/issues/216][Credit]] for manual dispatch function. =TODO:= Window width controls +[[https://github.com/abo-abo/ace-window/issues/216][Credit]] for manual dispatch function. + +=TODO:= Window width controls #+begin_src emacs-lisp (use-package winner :after evil @@ -371,7 +381,7 @@ I know these could be bound on a per-package basis, but since this is my primary ;; Top level bindings "SPC" '(projectile-find-file :which-key "Find project file") "" '(ian/treemacs-open-current-or-jump :which-key "Find current file in sidebar") - "," '(+ivy/switch-workspace-buffer :which-key "Buffers (workspace)") + "," '(prochectile-ibuffer :which-key "Buffers (workspace)") "/" '(consult-ripgrep :which-key "Search project") ":" '(execute-extended-command :which-key "M-x") ";" '(eval-expression :which-key "Eval") @@ -379,7 +389,7 @@ I know these could be bound on a per-package basis, but since this is my primary "x" '(scratch-buffer :which-key "Scratch popup") "-" '(dired :which-key "Find Directory") "d" '(docker :which-key "Docker") - "i" '(ian/conditional-imenu :which-key "Imenu") ;; consult-outline? + "i" '(ian/conditional-imenu :which-key "Imenu") "w" '(ace-window :which-key "Window") "W" '(ace-window-manual-dispatch :which-key "Window (dispatch)") @@ -414,7 +424,8 @@ I know these could be bound on a per-package basis, but since this is my primary "cC" '(recompile :which-key "Recompile") "cd" '(+lookup/definition :which-key "Goto definition") "cr" '(+lookup/references :which-key "Goto references") - "ce" '(ian/eval-region-or-buffer :which-key "Eval buffer/region") + "ce" '(ian/eval-region-or-buffer :which-key "Eval buffer/region") + "cE" '(consult-flymake :which-key "Errors") ;; "cf" '(NOT A COMMAND (re-do) :which-key "Format buffer/region") "ci" '(+lookup/implementations :which-key "Find implementations") "cj" '(lsp-ivy-workspace-symbol :which-key "Goto symbol (curr. workspace)") @@ -422,6 +433,7 @@ I know these could be bound on a per-package basis, but since this is my primary "ck" '(+lookup/documentation :which-key "Jump to documentation") "cl" '(+default/lsp-command-map :which-key "LSP") "co" '(lsp-organize-imports :which-key "LSP organize imports") + "cp" '(completion-at-point :which-key "Completion at point") "cR" '(lsp-rename :which-key "LSP rename") "cs" '(+eval/send-region-to-repl :which-key "Send to repl") "ct" '(+lookup/type-definition :which-key "Find type definition") @@ -464,10 +476,11 @@ I know these could be bound on a per-package basis, but since this is my primary "gh" '(:ignore t :which-key "hunk") - "ghn" '(+vc-gutter/previous-hunk :which-key "jump to previous hunk") - "ghp" '(+vc-gutter/next-hunk :which-key "jump to next hunk") - "ghr" '(+vc-gutter/revert-hunk :which-key "revert hunk at point") - "ghs" '(+vc-gutter/stage-hunk :which-key "stage hunk at point") + "ghn" '(git-gutter+-previous-hunk :which-key "jump to previous hunk") + "ghp" '(git-gutter+-next-hunk :which-key "jump to next hunk") + "ghr" '(git-gutter+-revert-hunk :which-key "revert hunk at point") + "ghs" '(git-gutter+-popup-hunk :which-key "show hunk") + "ghS" '(git-gutter+-stage-hunk :which-key "stage hunk at point") "gl" '(:ignore t :which-key "list") "gli" '(forge-list-issues :which-key "list issues") @@ -499,6 +512,8 @@ I know these could be bound on a per-package basis, but since this is my primary "hl" '(view-lossage :which-key "View actions log") "hm" '(describe-mode :which-key "Describe mode") "ho" '(helpful-symbol :which-key "Describe symbol") + "hp" '(explain-pause-top :which-key "Processes") + "hs" '(yas-desrcibe-tables :which-key "Describe symbol") "hv" '(helpful-variable :which-key "Describe variable") "hx" '(helpful-command :which-key "Describe command") "hA" '(apropos-documentation :which-key "Apropos(documentation)") @@ -554,6 +569,7 @@ I know these could be bound on a per-package basis, but since this is my primary "nb" '(org-roam-buffer-display-dedicated :which-key "Launch roam buffer") "ns" '(org-roam-db-sync :which-key "Sync database") "nc" '(org-roam-capture :which-key "Capture to node") + "ni" '(org-roam-insert :which-key "Insert node at point") ;; Org mode "o" '(:ignore t :which-key "org") @@ -608,16 +624,17 @@ I know these could be bound on a per-package basis, but since this is my primary "v" '(:ignore t :which-key "visual/appearance") "vt" '(load-theme :which-key "load theme") + ;; TODO: maybe make this mode-specific stuff, not using workspaces ;; Workspaces - "TAB TAB" '(+workspace/display :which-key "Display tab bar") - "TAB d" '(+workspace/delete :which-key "Delete this workspace") - "TAB l" '(+workspace/load :which-key "Load workspace from file") - "TAB n" '(+workspace/new :which-key "New workspace") - "TAB N" '(+workspace/new-named :which-key "New named workspace") - "TAB r" '(+workspace/rename :which-key "Rename workspace") - "TAB R" '(+workspace/restore-last-session :which-key "Restore last session") - "TAB s" '(+workspace/save :which-key "Save workspace") - "TAB x" '(+workspace/kill-session :which-key "Delete session") + ;; "TAB TAB" '(+workspace/display :which-key "Display tab bar") + ;; "TAB d" '(+workspace/delete :which-key "Delete this workspace") + ;; "TAB l" '(+workspace/load :which-key "Load workspace from file") + ;; "TAB n" '(+workspace/new :which-key "New workspace") + ;; "TAB N" '(+workspace/new-named :which-key "New named workspace") + ;; "TAB r" '(+workspace/rename :which-key "Rename workspace") + ;; "TAB R" '(+workspace/restore-last-session :which-key "Restore last session") + ;; "TAB s" '(+workspace/save :which-key "Save workspace") + ;; "TAB x" '(+workspace/kill-session :which-key "Delete session") )) #+end_src @@ -845,10 +862,12 @@ All lisp-family languages #+begin_src emacs-lisp (use-package markdown-mode) (use-package evil-markdown - :mode ("\\.md\\'" . evil-markdown-mode)) + :after evil + :straight (evil-markdown :type git :host github :repo "somelauw/evil-markdown") + :mode ("\\.md\\'" . evil-markdown-mode)) (use-package json-mode) (use-package yaml-mode) -#+end_src + #+end_src ** Beancount This is mostly lifted from the doom emacs config. Beancount-mode by default has a pretty borked tab function. #+begin_src emacs-lisp @@ -895,6 +914,11 @@ Uses the external fish program to provide fish-style completions to eshell etc (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) (evil-mode 1)) (use-package undo-tree @@ -915,11 +939,9 @@ Uses the external fish program to provide fish-style completions to eshell etc :ensure t :diminish evil-collection-unimpaired-mode :init - (setq evil-want-C-u-scroll t) :config - (evil-collection-init) - (setq evil-want-C-i-jump t - evil-respect-visual-line-mode t)) + (setq evil-respect-visual-line-mode t) + (evil-collection-init)) (use-package evil-commentary :config @@ -952,6 +974,15 @@ Uses the external fish program to provide fish-style completions to eshell etc #+end_src +* Emacs Meta +** Explain-Pause +Scrutinize which processes are gumming up emacs +#+begin_src emacs-lisp +(use-package explain-pause-mode + :straight (explain-pause-mode :type git :host github :repo "lastquestion/explain-pause-mode") + :config + (explain-pause-mode)) +#+end_src * Todo ** General - Refactor to use use-package more effectively @@ -1006,11 +1037,14 @@ Uses the external fish program to provide fish-style completions to eshell etc - map hyper bindings for buffer nav and jumping - evil-org - map alignment functions in 'code'section -- define global meow-left and vim-left, swich contextually - fix c-u in evil mode - fix tab key - window size functions, winner undo/redo - map default-text-scale operations +- org-capture from string and org-ripgrep +- move spc p s back to spc p p +- explain-pause spc h p + - Want this for org-roam, don't want to rebind tab here - empv - map - configure