Cleaning up some keybinding stuff
This commit is contained in:
113
home.org
113
home.org
@@ -564,7 +564,32 @@ Emacs is a huge portion of this configuration, so although it's a home-manager "
|
|||||||
'';
|
'';
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
** Keybindings
|
||||||
|
These keybindings are scattered throughout this file, I'm collecting them all here to make it easier to track them.
|
||||||
|
|
||||||
|
| Key | Normal Key | Action | Mode |
|
||||||
|
| s-b | | [[id:6D1A8B35-3093-4DA6-A5AA-2A0D45112BAB][Switch project buffer]] | |
|
||||||
|
| s-B | | [[id:6D1A8B35-3093-4DA6-A5AA-2A0D45112BAB][Switch buffer]] | |
|
||||||
|
| s-f | C-x p f | [[id:A2F7FF5C-AFCC-44D4-9AA5-3498F6D6D5E0::workspace_keybinds][Open file in current project]] | |
|
||||||
|
| s-F | C-x p p | [[id:A2F7FF5C-AFCC-44D4-9AA5-3498F6D6D5E0::workspace_keybinds][Switch project]] | |
|
||||||
|
| S-s | C-x t RET | [[id:A2F7FF5C-AFCC-44D4-9AA5-3498F6D6D5E0::workspace_keybinds][Switch tab]] | |
|
||||||
|
| C-c a | | [[id:3B0BFCDC-DFD5-42A0-97D8-3B032B128AF7][Org agenda]] | |
|
||||||
|
| C-c A | | [[id:5CCB676B-9FF0-47B4-8AF2-10FD3899A646][Eglot code actions]] | prog |
|
||||||
|
| C-c c | | [[id:3B0BFCDC-DFD5-42A0-97D8-3B032B128AF7][Org capture]] | |
|
||||||
|
| C-c D | | [[id:5CCB676B-9FF0-47B4-8AF2-10FD3899A646][Show flymake diagnostics]] | prog |
|
||||||
|
| C-c h | | [[id:6D1A8B35-3093-4DA6-A5AA-2A0D45112BAB][Consult shell history]] | |
|
||||||
|
| C-c I | | [[id:5CCB676B-9FF0-47B4-8AF2-10FD3899A646][Eglot find implementation]] | prog |
|
||||||
|
| C-c l | | [[id:3B0BFCDC-DFD5-42A0-97D8-3B032B128AF7][Org store link]] | |
|
||||||
|
| C-c n | | [[id:3B0BFCDC-DFD5-42A0-97D8-3B032B128AF7][Org Roam prefix]] | |
|
||||||
|
| C-c R | | [[id:5CCB676B-9FF0-47B4-8AF2-10FD3899A646][Eglot rename]] | prog |
|
||||||
|
| C-c u | | [[id:5CCB676B-9FF0-47B4-8AF2-10FD3899A646][Cycle string inflection]] | various |
|
||||||
|
| C-c M-g | | [[id:4F426E77-CE03-4BF8-8D1B-7791C7C02B28][Magit file dispatch]] | |
|
||||||
|
|
||||||
|
|
||||||
** Global Settings
|
** Global Settings
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: A2F7FF5C-AFCC-44D4-9AA5-3498F6D6D5E0
|
||||||
|
:END:
|
||||||
|
|
||||||
These are just some general settings that apply everywhere. First, a few packages:
|
These are just some general settings that apply everywhere. First, a few packages:
|
||||||
|
|
||||||
@@ -692,11 +717,7 @@ Use variable-width fonts in text buffers. ~mixed-pitch-mode~ keeps most code blo
|
|||||||
|
|
||||||
Set up a few project- / workspace-related key bindings.
|
Set up a few project- / workspace-related key bindings.
|
||||||
|
|
||||||
| Key | Action |
|
#+name: workspace_keybinds
|
||||||
| s-f | Open file in current project (C-x p f) |
|
|
||||||
| s-F | Switch project (C-x p p) |
|
|
||||||
| S-s | Switch tab (C-x t RET) |
|
|
||||||
|
|
||||||
#+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config
|
#+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config
|
||||||
(bind-keys ("s-f" . project-find-file)
|
(bind-keys ("s-f" . project-find-file)
|
||||||
("s-F" . project-switch-project))
|
("s-F" . project-switch-project))
|
||||||
@@ -722,6 +743,16 @@ I'm trying this out. This disables visual selections. It's bold, which is why I
|
|||||||
(transient-mark-mode -1)
|
(transient-mark-mode -1)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
#+BEGIN_SRC elisp :noweb no :noweb-ref emacs_config
|
||||||
|
(use-package tab-bar
|
||||||
|
:config
|
||||||
|
(tab-bar-history-mode)
|
||||||
|
(defvar-keymap tab-bar-repeat-map
|
||||||
|
:repeat t
|
||||||
|
"<left>" #'tab-bar-history-back
|
||||||
|
"<right>" #'tab-bar-history-forward))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
** Editing
|
** Editing
|
||||||
|
|
||||||
This configuration affects general text editing, across all modes. First, some packages:
|
This configuration affects general text editing, across all modes. First, some packages:
|
||||||
@@ -819,6 +850,9 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Language Support
|
** Language Support
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 5CCB676B-9FF0-47B4-8AF2-10FD3899A646
|
||||||
|
:END:
|
||||||
|
|
||||||
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
||||||
consult-eglot
|
consult-eglot
|
||||||
@@ -837,6 +871,36 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
yaml-pro
|
yaml-pro
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
I had some weird problems with jsx code where the default M-q would just do a text fill rather than a re-indent. The solution seems to be to only do the ~syntax-ppss~ stuff if tree-sitter isn't available? It seems to work for now anyway...
|
||||||
|
|
||||||
|
#+BEGIN_SRC elisp :noweb-ref emacs_config
|
||||||
|
(use-package prog-mode
|
||||||
|
:config
|
||||||
|
(defun prog-fill-reindent-defun (&optional argument)
|
||||||
|
"Refill or reindent the paragraph or defun that contains point.
|
||||||
|
|
||||||
|
If the point is in a string or a comment, fill the paragraph that
|
||||||
|
contains point or follows point.
|
||||||
|
|
||||||
|
Otherwise, reindent the function definition that contains point
|
||||||
|
or follows point."
|
||||||
|
(interactive "P")
|
||||||
|
(save-excursion
|
||||||
|
(let ((treesit-text-node
|
||||||
|
(and (treesit-available-p)
|
||||||
|
(treesit-parser-list)
|
||||||
|
(treesit-node-match-p
|
||||||
|
(treesit-node-at (point)) 'text t))))
|
||||||
|
(if (or treesit-text-node
|
||||||
|
(and (not (and (treesit-available-p) (treesit-parser-list))) (nth 8 (syntax-ppss)))
|
||||||
|
(re-search-forward "\\s-*\\s<" (line-end-position) t))
|
||||||
|
(fill-paragraph argument (region-active-p))
|
||||||
|
(beginning-of-defun)
|
||||||
|
(let ((start (point)))
|
||||||
|
(end-of-defun)
|
||||||
|
(indent-region start (point) nil)))))))
|
||||||
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC elisp :noweb-ref emacs_config
|
#+BEGIN_SRC elisp :noweb-ref emacs_config
|
||||||
(use-package nix-mode
|
(use-package nix-mode
|
||||||
:mode "\\.nix\\'")
|
:mode "\\.nix\\'")
|
||||||
@@ -1039,6 +1103,9 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Magit
|
** Magit
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 4F426E77-CE03-4BF8-8D1B-7791C7C02B28
|
||||||
|
:END:
|
||||||
|
|
||||||
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
||||||
consult-gh
|
consult-gh
|
||||||
@@ -1073,6 +1140,9 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Vertico
|
** Vertico
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 6D1A8B35-3093-4DA6-A5AA-2A0D45112BAB
|
||||||
|
:END:
|
||||||
|
|
||||||
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
||||||
cape
|
cape
|
||||||
@@ -1088,15 +1158,16 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
#+BEGIN_SRC elisp :noweb-ref emacs_config
|
#+BEGIN_SRC elisp :noweb-ref emacs_config
|
||||||
(use-package consult
|
(use-package consult
|
||||||
:bind (
|
:bind (
|
||||||
("C-c M-x" . consult-mode-command)
|
;; ("C-c M-x" . consult-mode-command)
|
||||||
("C-c h" . consult-history)
|
("C-c h" . consult-history)
|
||||||
("C-c k" . consult-kmacro)
|
;; ("C-c k" . consult-kmacro)
|
||||||
("C-c m" . consult-man)
|
;; ("C-c m" . consult-man)
|
||||||
([remap Info-search] . consult-info)
|
;; ([remap Info-search] . consult-info)
|
||||||
|
|
||||||
("C-x M-:" . consult-complex-command)
|
;; ("C-x M-:" . consult-complex-command)
|
||||||
("C-x b" . consult-buffer)
|
("C-x b" . consult-buffer)
|
||||||
("s-b" . consult-buffer)
|
("s-b" . consult-project-buffer)
|
||||||
|
("s-B" . consult-buffer)
|
||||||
("C-x 4 b" . consult-buffer-other-window)
|
("C-x 4 b" . consult-buffer-other-window)
|
||||||
("C-x 5 b" . consult-buffer-other-frame)
|
("C-x 5 b" . consult-buffer-other-frame)
|
||||||
("C-x t b" . consult-buffer-other-tab)
|
("C-x t b" . consult-buffer-other-tab)
|
||||||
@@ -1193,9 +1264,13 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
** Org
|
** Org
|
||||||
|
:PROPERTIES:
|
||||||
|
:ID: 3B0BFCDC-DFD5-42A0-97D8-3B032B128AF7
|
||||||
|
:END:
|
||||||
|
|
||||||
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
#+BEGIN_SRC nix :noweb-ref emacs_packages
|
||||||
org-bullets
|
org-bullets
|
||||||
|
org-roam
|
||||||
verb
|
verb
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
@@ -1207,7 +1282,8 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
("C-c l" . org-store-link))
|
("C-c l" . org-store-link))
|
||||||
:config
|
:config
|
||||||
(add-hook 'org-mode-hook 'visual-line-mode)
|
(add-hook 'org-mode-hook 'visual-line-mode)
|
||||||
(setq org-todo-keywords
|
(setq org-link-keep-stored-after-insertion t
|
||||||
|
org-todo-keywords
|
||||||
'((sequence
|
'((sequence
|
||||||
"TODO(o)"
|
"TODO(o)"
|
||||||
"IN_PROGRESS(p!)"
|
"IN_PROGRESS(p!)"
|
||||||
@@ -1242,7 +1318,18 @@ I find Emacs to be almost unusable on a normal keyboard unless there's some way
|
|||||||
org-agenda-files '("~/org/todo.org")
|
org-agenda-files '("~/org/todo.org")
|
||||||
org-agenda-todo-ignore-scheduled 'future
|
org-agenda-todo-ignore-scheduled 'future
|
||||||
org-agenda-todo-ignore-with-date t
|
org-agenda-todo-ignore-with-date t
|
||||||
org-agenda-tags-todo-honor-ignore-options t))
|
org-agenda-tags-todo-honor-ignore-options t
|
||||||
|
org-id-link-to-org-use-id t))
|
||||||
|
|
||||||
|
(use-package org-roam
|
||||||
|
:bind (("C-c n l" . org-roam-buffer-toggle)
|
||||||
|
("C-c n f" . org-roam-node-find)
|
||||||
|
("C-c n g" . org-roam-graph)
|
||||||
|
("C-c n i" . org-roam-node-insert)
|
||||||
|
("C-c n c" . org-roam-capture))
|
||||||
|
:config
|
||||||
|
(setq org-roam-node-display-template (concat "${title:*} " (propertize "${tags:10}" 'face 'org-tag)))
|
||||||
|
(org-roam-db-autosync-mode))
|
||||||
|
|
||||||
(use-package org-bullets
|
(use-package org-bullets
|
||||||
:hook org-mode-hook)
|
:hook org-mode-hook)
|
||||||
|
|||||||
Reference in New Issue
Block a user