Compare commits

..

No commits in common. "7b76d45eb513f27cc83bdc598161d74bbabdf709" and "f78c81b21f2b94245502442eaabe7c74a23a92d7" have entirely different histories.

12 changed files with 388 additions and 476 deletions

View File

@ -73,9 +73,9 @@ focus the new window immediately.
(with-eval-after-load 'hydra
(defhydra windows-adjust-size ()
"
_t_: shrink
_c_: enlarge _r_: right
_s_: enlarge
_c_: enlarge _r_: right
_t_: shrink
"
("c" enlarge-window-horizontally)
("t" shrink-window)
@ -138,21 +138,3 @@ b s~, which bring the user directly to the ~*Messages*~ buffer and the
(interactive)
(switch-to-buffer "*scratch*"))
#+end_src
** Tangle all Emacs config files
#+begin_src emacs-lisp :results none
(defvar my/emacs-org-config-directory
(expand-file-name "org/config/docs/emacs" (getenv "HOME"))
"Location of my config as org files.")
(defun my/tangle-emacs-config ()
"Tangle all my Emacs config files from org files."
(interactive)
(let ((files (f-files my/emacs-org-config-directory
(lambda (file) (f-ext-p file "org"))
t))
(org-confirm-babel-evaluate nil))
(dolist (file files)
(message "Tangling %s" file)
(org-babel-tangle-file file))))
#+end_src

View File

@ -9,30 +9,21 @@ Undefining some stuff to make keybind prefixes work correctly.
#+name: general-keybindings-gen
#+header: :tangle no :exports none :results value :cache yes
#+begin_src emacs-lisp :var table=keybindings-apps prefix="a"
(mapconcat
(lambda (line)
(let* ((key (format "%s" (nth 0 line)))
#+begin_src emacs-lisp :var table=keybinds-windows prefix=""
(mapconcat (lambda (line)
(let* ((key (nth 0 line))
(function (nth 1 line))
(fn-nil-p (member function '("" "nil")))
(comment (or (nth 2 line) ""))
(comment-p (not (string= "" comment)))
(comment (cond ((nth 2 line) (concat " :wk \"" (nth 2 line) "\""))
(fn-nil-p " :wk t")
(t "")))
(package (or (nth 3 line) ""))
(package-p (not (string= "" (nth 3 line))))
(package (if package-p (concat " :package " (nth 3 line)) "")))
(format "\"%s\" %s"
(concat prefix key)
(if (or comment-p package-p)
(format "'(%s%s%s)"
(if (member function '("" "nil"))
":ignore t"
function)
(if comment-p comment "")
(if package-p package ""))
(concat "#'" function)))))
(package (or (nth 3 line) "")))
(format "\"%s%s\" %s"
prefix
key
(if (string= "" comment)
(if (member function '("" "nil")) "nil" (concat "#'" function))
(format "'(%s :wk %s%s)"
(if (member function '("" "nil")) ":ignore t" function)
(if (member function '("none" "nil")) "t" (concat "\"" comment "\""))
(if (string-blank-p package) "" (concat ":package " package)))))))
table
"\n")
#+end_src
@ -45,52 +36,60 @@ Undefining some stuff to make keybind prefixes work correctly.
(phundrak/evil
:packages '(counsel)
"U" '(evil-redo :package evil)
"U" #'evil-redo
"C-a" #'beginning-of-line
"C-e" #'end-of-line
"C-y" #'yank
"M-y" '(counsel-yank-pop :package counsel))
"M-y" #'counsel-yank-pop)
#+end_src
#+begin_src emacs-lisp :results none
#+begin_src emacs-lisp
(general-define-key
"<f5>" #'compile
"<f6>" #'recompile)
(phundrak/leader-key
"SPC" '(counsel-M-x :wk "M-x")
"'" '(shell-pop :package shell-pop)
"R" #'recompile
"u" #'universal-argument
"U" '(undo-tree-visualize :package undo-tree)
"'" #'shell-pop
<<general-keybindings-gen(table=keybindings-tabs, prefix="TAB ")>>
<<general-keybindings-gen(table=keybindings-apps, prefix="a")>>
<<general-keybindings-gen(table=keybindings-apps-shell, prefix="as")>>
<<general-keybindings-gen(table=keybindings-treemacs, prefix="at")>>
<<general-keybindings-gen(table=keybindings-buffers, prefix="b")>>
<<general-keybindings-gen(table=keybindings-code, prefix="c")>>
<<general-keybindings-gen(table=keybindings-errors, prefix="e")>>
<<keybindings-errors-extra>>
<<general-keybindings-gen(table=keybindings-files, prefix="f")>>
<<keybindings-files-extras>>
<<general-keybindings-gen(table=keybindings-git, prefix="g")>>
<<general-keybindings-gen(table=keybindings-help, prefix="h")>>
<<general-keybindings-gen(table=keybindings-insert, prefix="i")>>
<<general-keybindings-gen(table=keybindings-jump, prefix="j")>>
<<general-keybindings-gen(table=keybindings-language, prefix="l")>>
<<general-keybindings-gen(table=keybindings-media, prefix="m")>>
<<general-keybindings-gen(table=keybindings-org, prefix="o")>>
<<general-keybindings-gen(table=keybindings-refactor, prefix="r")>>
<<general-keybindings-gen(table=keybindings-toggle, prefix="t ")>>
<<general-keybindings-gen(table=keybindings-text, prefix="T")>>
<<general-keybindings-gen(table=keybindings-windows, prefix="w")>>
<<general-keybindings-gen(table=keybindings-quit, prefix="q")>>)
<<general-keybindings-gen(table=keybinds-tabs, prefix="TAB ")>>
<<general-keybindings-gen(table=keybinds-apps, prefix="a")>>
<<general-keybindings-gen(table=keybinds-apps-shell, prefix="as")>>
<<general-keybindings-gen(table=treemacs-keybinds, prefix="at")>>
<<general-keybindings-gen(table=keybinds-buffers, prefix="b")>>
"c" '(:ignore t :wk "code")
"cl" #'evilnc-comment-or-uncomment-lines
<<keybindings-flycheck>>
<<general-keybindings-gen(table=keybinds-files, prefix="f")>>
<<keybinds-specific-files>>
<<general-keybindings-gen(table=keybinds-help, prefix="h")>>
"i" '(:ignore t :wk "insert")
"iu" #'counsel-unicode-char
<<general-keybindings-gen(table=keybinds-jump, prefix="j")>>
<<general-keybindings-gen(table=keybinds-toggle, prefix="t ")>>
<<general-keybindings-gen(table=keybinds-text, prefix="T")>>
<<general-keybindings-gen(table=keybinds-windows, prefix="w")>>
<<general-keybindings-gen(table=keybinds-quit, prefix="q")>>
"u" #'universal-argument
"U" #'undo-tree-visualize)
#+end_src
** Apps
Here are my apps keybindings. Each one of them is prefixed by ~a~.
#+name: keybindings-apps
Here are my apps keybinds. Each one of them is prefixed by ~a~.
#+name: keybinds-apps
| Key | Function | Description | Package |
|-----+----------------------------+-------------+------------|
| | | apps | |
@ -99,24 +98,22 @@ Here are my apps keybindings. Each one of them is prefixed by ~a~.
| CC | calendar | | |
| Co | org-agenda | | org |
| Cs | org-caldav-sync | | org-caldav |
| d | docker | | docker |
| E | elfeed | | elfeed |
| d | docker | | |
| E | elfeed | | |
| e | | email | |
| ec | mu4e-compose-new | | mu4e |
| em | mu4e | | mu4e |
| k | keycast-mode | | keycast |
| K | keycast-log-mode | | keycast |
| ec | mu4e-compose-new | | |
| em | mu4e | | |
| k | keycast-mode | | |
| K | keycast-log-mode | | |
| m | | mastodon | |
| mm | mastodon | | mastodon |
| mn | mastodon-notifications-get | | mastodon |
| mt | mastodon-toot | | mastodon |
| T | tetris | | |
| S | screenshot | | screenshot |
| w | wttrin | | wttrin |
*** Shell apps
I also have two main shell-related functions, prefixed with ~as~.
#+name: keybindings-apps-shell
#+name: keybinds-apps-shell
| Key | Function | Description | Package |
|-----+-------------+-------------+-------------|
| | | shells | |
@ -124,81 +121,25 @@ I also have two main shell-related functions, prefixed with ~as~.
| v | vterm | | vterm |
| V | multi-vterm | | multi-vterm |
*** Treemacs
#+name: keybindings-treemacs
| Key | Function | Description | Package |
|-----+----------------------------------------+-------------+----------|
| | | treemacs | |
| c | | create | |
| cd | treemacs-create-dir | | treemacs |
| cf | treemacs-create-file | | treemacs |
| ci | treemacs-create-icon | | treemacs |
| ct | treemacs-create-theme | | treemacs |
| cw | treemacs-create-workspace | | treemacs |
| d | treemacs-delete-file | | treemacs |
| f | | files | |
| ff | treemacs-find-file | | treemacs |
| ft | treemacs-find-tag | | treemacs |
| l | | lsp | |
| ls | treemacs-expand-lsp-symbol | | treemacs |
| ld | treemacs-expand-lsp-treemacs-deps | | treemacs |
| lD | treemacs-collapse-lsp-treemacs-deps | | treemacs |
| lS | treemacs-collapse-lsp-symbol | | treemacs |
| p | | projects | |
| pa | treemacs-add-project-to-workspace | | treemacs |
| pf | treemacs-project-follow-mode | | treemacs |
| pn | treemacs-project-of-node | | treemacs |
| pp | treemacs-project-at-point | | treemacs |
| pr | treemacs-remove-project-from-workspace | | treemacs |
| pt | treemacs-move-project-down | | treemacs |
| ps | treemacs-move-project-up | | treemacs |
| r | | rename | |
| rf | treemacs-rename-file | | treemacs |
| rp | treemacs-rename-project | | treemacs |
| rr | treemacs-rename | | treemacs |
| rw | treemacs-rename-workspace | | treemacs |
| t | treemacs | | treemacs |
| T | | toggles | |
| Td | treemacs-toggle-show-dotfiles | | treemacs |
| Tn | treemacs-toggle-node | | treemacs |
| v | | visit node | |
| va | treemacs-visit-node-ace | | treemacs |
| vc | treemacs-visit-node-close-treemacs | | treemacs |
| vn | treemacs-visit-node-default | | treemacs |
| y | | yank | |
| ya | treemacs-copy-absolute-path-at-point | | treemacs |
| yp | treemacs-copy-project-path-at-point | | treemacs |
| yr | treemacs-copy-relative-path-at-point | | treemacs |
| yf | treemacs-copy-file | | treemacs |
** Buffers
My buffer-related keybindings are all prefixed by ~b~.
#+name: keybindings-buffers
| Key | Function | Description | Package |
|-----+------------------------------------+-------------+-----------|
| | | buffers | |
| b | bufler-switch-buffer | | bufler |
| B | bury-buffer | | |
| c | clone-indirect-buffer | | |
| C | clone-indirect-buffer-other-window | | |
| l | bufler | | bufler |
| d | kill-this-buffer | | |
| D | kill-buffer | | |
| h | dashboard-refresh-buffer | | dashboard |
| m | switch-to-messages-buffer | | |
| n | next-buffer | | |
| p | previous-buffer | | |
| r | counsel-buffer-or-recentf | | counsel |
| s | switch-to-scratch-buffer | | |
** Code
#+name: keybindings-code
| Key | Function | Description | Package |
|-----+-----------------------------------+-------------+---------------------|
| | | code | |
| l | evilnc-comment-or-uncomment-lines | | evil-nerd-commenter |
| n | hl-todo-next | | hl-todo |
| p | hl-todo-previous | | hl-todo |
My buffer-related keybinds are all prefixed by ~b~.
#+name: keybinds-buffers
| Key | Function | Description |
|-----+------------------------------------+-------------|
| | | buffers |
| b | bufler-switch-buffer | |
| B | bury-buffer | |
| c | clone-indirect-buffer | |
| C | clone-indirect-buffer-other-window | |
| l | bufler | |
| d | kill-this-buffer | |
| D | kill-buffer | |
| h | dashboard-refresh-buffer | |
| m | switch-to-messages-buffer | |
| n | next-buffer | |
| p | previous-buffer | |
| r | counsel-buffer-or-recentf | |
| s | switch-to-scratch-buffer | |
** Errors
#+begin_src emacs-lisp
@ -214,45 +155,39 @@ My buffer-related keybindings are all prefixed by ~b~.
("q" nil))
#+end_src
#+name: keybindings-errors
| Key | Function | Description | Package |
|-----+---------------------+----------------+---------|
| | | errors | |
| . | hydra-flycheck/body | hydra-flycheck | |
| l | counsel-flycheck | | counsel |
| F | flyspell-hydra/body | flyspell-hydra | |
#+name: keybindings-errors-extra
#+name: keybindings-flycheck
#+begin_src emacs-lisp :tangle no
"e" '(:ignore t :which-key "errors")
"e." '(hydra-flycheck/body :wk "hydra")
"el" #'counsel-flycheck
"ee" '(:keymap flycheck-command-map :package 'flycheck :wk "flycheck")
"ef" '(:keymap flyspell-mode-map :package 'flyspell :wk "flyspell")
"eF" #'flyspell-hydra/body
#+end_src
** Files
My keybindings for file manipulation are prefixed by ~f~.
#+name: keybindings-files
| Key | Function | Description | Package |
|-----+-------------------+-------------+------------------|
| | | files | |
| f | counsel-find-file | | counsel |
| F | quick-find-files | | quick-find-files |
| h | hexl-find-file | | |
| r | counsel-recentf | | counsel |
| s | save-buffer | | |
My keybinds for file manipulation are prefixed by ~f~.
#+name: keybinds-files
| Key | Function | Description |
|-----+-------------------+-------------|
| | | files |
| f | counsel-find-file | |
| F | quick-find-files | |
| h | hexl-find-file | |
| r | counsel-recentf | |
| s | save-buffer | |
I also have some keybindings dedicated to opening specific files.
#+name: keybindings-files-extras
I also have some keybinds dedicated to opening specific files.
#+name: keybinds-specific-files
#+begin_src emacs-lisp :tangle no
"fc" '((lambda ()
(interactive)
(quick-find-files nil "~/org/config/docs/emacs" "org"))
:wk "emacs config"
:package quick-find-files)
:wk "emacs config")
"fC" '((lambda ()
(interactive)
(quick-find-files nil "~/org/config/docs" "org"))
:wk "general config"
:package quick-find-files)
:wk "general config")
"fi" '((lambda ()
(interactive)
(find-file (concat user-emacs-directory "init.el")))
@ -262,49 +197,27 @@ I also have some keybindings dedicated to opening specific files.
(quick-find-files nil
(expand-file-name "lisp" user-emacs-directory)
"el"))
:which-key "elisp config"
:package quick-find-files)
:which-key "elisp config")
"fR" '((lambda ()
(interactive)
(counsel-find-file ""
(concat user-emacs-directory
(file-name-as-directory "straight")
(file-name-as-directory "repos"))))
:which-key "straight package"
:package counsel)
:which-key "straight package")
"fS" '((lambda ()
(interactive)
(find-file "~/org/config/stumpwm.org"))
:which-key "stumpwm.org")
#+end_src
** Git
#+name: keybindings-git
| Key | Function | Description | Package |
|-----+---------------------+-------------+---------|
| | | git | |
| b | magit-blame | | magit |
| c | magit-clone | | magit |
| d | magit-dispatch | | magit |
| i | magit-init | | magit |
| s | magit-status | | magit |
| l | magit-log | | magit |
| y | my/yadm | | magit |
| S | magit-stage-file | | magit |
| U | magit-unstage-file | | magit |
| f | | file | |
| fd | magit-diff | | magit |
| fc | magit-file-checkout | | magit |
| fl | magit-file-dispatch | | magit |
| fF | magit-find-file | | magit |
** Help
My keybindings for help are prefixed by ~h~.
#+name: keybindings-help
My keybinds for help are prefixed by ~h~.
#+name: keybinds-help
| Key | Function | Description |
|-----+--------------------------+-------------|
| | | help |
| k | which-key-show-top-level | which-key |
| k | which-key-show-top-level | |
| i | info | |
| I | info-display-manual | |
| d | | describe |
@ -319,125 +232,82 @@ My keybindings for help are prefixed by ~h~.
| ds | helpful-symbol | |
| dv | helpful-variable | |
** Insert
#+name: keybindings-insert
| Key | Function | Description | Package |
|-----+----------------------+-------------+-----------|
| | | insert | |
| u | counsel-unicode-char | | counsel |
| y | ivy-yasnippet | | yasnippet |
** Jump
My keybindings for jumping around are prefixed by ~j~.
#+name: keybindings-jump
| Key | Function | Description | Package |
|-----+-------------------------------+-------------+---------|
| | | jump | |
| C | | avy copy | |
| Cl | avy-copy-line | | avy |
| Cr | avy-copy-region | | avy |
| D | dired-jump-other-window | | |
| U | my/avy-open-url | open-url | avy |
| b | avy-pop-mark | | avy |
| c | evil-avy-goto-char-timer | | avy |
| d | dirvish-dwim | | dirvish |
| f | counsel-file-jump | | counsel |
| k | | avy kill | |
| kL | avy-kill-ring-save-whole-line | | avy |
| kR | avy-kill-ring-save-region | | avy |
| kl | avy-kill-whole-line | | avy |
| kr | avy-kill-region | | avy |
| l | avy-goto-line | | avy |
| m | | move | |
| ml | avy-move-line | | avy |
| mr | avy-move-region | | avy |
| mt | avy-transpose-lines-in-region | | avy |
| n | avy-next | | avy |
| p | avy-prev | | avy |
| u | my/avy-goto-url | goto-url | avy |
** Language
#+name: keybindings-language
| Key | Function | Description | Package |
|-----+----------------------------------+-------------+----------|
| | | language | |
| B | langtool-correct-buffer | | langtool |
| b | langtool-check-buffer | | langtool |
| c | langtool-check | | langtool |
| C | langtool-correct-at-point | | langtool |
| d | langtool-check-done | | langtool |
| l | langtool-switch-default-language | | langtool |
| p | langtool-show-message-at-point | | langtool |
| r | langtool-correct-region | | langtool |
** Media
#+name: keybindings-media
| Key | Function | Description | Package |
|-----+-----------------------------+----------------+---------|
| | | media | |
| . | hydra-media/body | hydra-media | emms |
| « | emms-player-mpd-previous | | emms |
| » | emms-player-mpd-next | | emms |
| c | emms-player-mpd-clear | | emms |
| e | | emms | |
| eb | emms-browser | | emms |
| ep | emms-playlist-mode-go | | emms |
| es | emms-player-mpd-show | | emms |
| p | my/mpc-toggle | mpd-play-pause | |
| s | emms-stop | | emms |
| u | | update | |
| um | emms-player-mpd-update-all | | emms |
| uc | emms-cache-set-from-mpd-all | | emm s |
My keybinds for jumping around are prefixed by ~j~.
#+name: keybinds-jump
| Key | Function | Description |
|-----+-------------------------+-------------|
| | | jump |
| f | counsel-file-jump | |
| d | dirvish-dwim | |
| D | dired-jump-other-window | |
** Project
My keybindings for my projects are prefixed by ~p~.
#+name: keybindings-project
| Key | Function | Description | Package |
|-----+--------------------------------------------+-------------+------------|
| | | project | |
| ! | projectile-run-shell-command-in-root | | projectile |
| & | projectile-run-async-shell-command-in-root | | projectile |
| b | counsel-projectile-switch-to-buffer | | counsel |
| c | counsel-projectile | | counsel |
| d | counsel-projectile-find-dir | | counsel |
| e | projectile-edit-dir-locals | | projectile |
| f | counsel-projectile-find-file | | counsel |
| g | projectile-find-tag | | projectile |
| k | project-kill-buffers | | |
| p | counsel-projectile-switch-project | | cousel |
| v | projectile-vc | | projectile |
My keybinds for my projects are prefixed by ~p~.
#+name: keybinds-project
| Key | Function | Description |
|-----+--------------------------------------------+-------------|
| | | project |
| ! | projectile-run-shell-command-in-root | |
| & | projectile-run-async-shell-command-in-root | |
| b | counsel-projectile-switch-to-buffer | |
| c | counsel-projectile | |
| d | counsel-projectile-find-dir | |
| e | projectile-edit-dir-locals | |
| f | counsel-projectile-find-file | |
| g | projectile-find-tag | |
| k | project-kill-buffers | |
| p | counsel-projectile-switch-project | |
| t | ivy-magit-todos | |
| v | projectile-vc | |
** Refactor
#+name: keybindings-refactor
| Key | Function | Description | Package |
|-----+----------------------------------+-----------------+------------------|
| | | refactor | |
| i | evil-iedit-state/iedit-mode | iedit-mode | evil-iedit-state |
| q | evil-iedit-state/quit-iedit-mode | quit-iedit-mode | evil-iedit-state |
*** Treemacs
** Org
#+name: keybindings-org
| Key | Function | Description | Package |
|-----+--------------------------------+-------------+----------|
| | | org | |
| c | org-capture | | org |
| r | | roam | |
| rb | org-mark-ring-goto | back | org-roam |
| rB | org-roam-buffer-toggle | | org-roam |
| rn | | nodes | |
| rnf | org-roam-node-find | | org-roam |
| rni | org-roam-node-insert | | org-roam |
| rno | org-roam-node-open | | org-roam |
| rnr | org-roam-node-random | | org-roam |
| rnv | org-roam-node-visit | | org-roam |
| rs | | sync | |
| rsa | org-roam-db-autosync-mode | | org-roam |
| rsc | org-roam-db-clear-all | | org-roam |
| rsd | org-roam-db-diagnose-node | | org-roam |
| rss | org-roam-db-sync | | org-roam |
| ru | | ui | |
| rua | org-roam-ui-add-to-local-graph | | org-roam |
| ruo | org-roam-ui-open | | org-roam |
#+name: treemacs-keybinds
| Key | Function | Description |
|-----+----------------------------------------+-------------|
| | | treemacs |
| c | | create |
| cd | treemacs-create-dir | |
| cf | treemacs-create-file | |
| ci | treemacs-create-icon | |
| ct | treemacs-create-theme | |
| cw | treemacs-create-workspace | |
| d | treemacs-delete-file | |
| f | | files |
| ff | treemacs-find-file | |
| ft | treemacs-find-tag | |
| l | | lsp |
| ls | treemacs-expand-lsp-symbol | |
| ld | treemacs-expand-lsp-treemacs-deps | |
| lD | treemacs-collapse-lsp-treemacs-deps | |
| lS | treemacs-collapse-lsp-symbol | |
| p | | projects |
| pa | treemacs-add-project-to-workspace | |
| pf | treemacs-project-follow-mode | |
| pn | treemacs-project-of-node | |
| pp | treemacs-project-at-point | |
| pr | treemacs-remove-project-from-workspace | |
| pt | treemacs-move-project-down | |
| ps | treemacs-move-project-up | |
| r | | rename |
| rf | treemacs-rename-file | |
| rp | treemacs-rename-project | |
| rr | treemacs-rename | |
| rw | treemacs-rename-workspace | |
| t | treemacs | |
| T | | toggles |
| Td | treemacs-toggle-show-dotfiles | |
| Tn | treemacs-toggle-node | |
| v | | visit node |
| va | treemacs-visit-node-ace | |
| vc | treemacs-visit-node-close-treemacs | |
| vn | treemacs-visit-node-default | |
| y | | yank |
| ya | treemacs-copy-absolute-path-at-point | |
| yp | treemacs-copy-project-path-at-point | |
| yr | treemacs-copy-relative-path-at-point | |
| yf | treemacs-copy-file | |
** Tabs
Emacs has native tabs available, which can be interesting when working
@ -445,8 +315,8 @@ on multiple projects at once between which we may want to switch. Tabs
allow the user not to have multiple frames while keeping the
advantages of having multiple frames.
My keybindings are prefixed by ~SPC TAB~.
#+name: keybindings-tabs
My keybinds are prefixed by ~SPC TAB~.
#+name: keybinds-tabs
| Key | Function | Description |
|-----+--------------+-------------|
| | | tabs |
@ -462,20 +332,18 @@ My keybindings are prefixed by ~SPC TAB~.
** Text
The prefix here is ~T~.
#+name: keybindings-text
| Key | Function | Description | Package |
|-----+----------------------+-------------+----------------------|
| | | text | |
| e | string-edit-at-point | | string-edit-at-point |
| u | downcase-region | | |
| U | upcase-region | | |
| z | hydra-zoom/body | | |
*** TODO Rewrite hydra-zoom :noexport:
#+name: keybinds-text
| Key | Function | Description |
|-----+----------------------+-------------|
| | | text |
| e | string-edit-at-point | |
| u | downcase-region | |
| U | upcase-region | |
| z | hydra-zoom/body | |
** Toggles
My toggle keybindings are prefixed by ~t~.
#+name: keybindings-toggle
My toggle keybinds are prefixed by ~t~.
#+name: keybinds-toggle
| Key | Function | Description |
|-----+---------------------------------------+--------------|
| | | toggles |
@ -489,44 +357,42 @@ My toggle keybindings are prefixed by ~t~.
| it | toggle-input-method | |
| is | set-input-method | |
*** TODO Rewrite =my/modify-frame-alpha-background/body= :noexport:
** Windows
A couple of keybindings are hidden from which-key, otherwise theres not
A couple of keybinds are hidden from which-key, otherwise theres not
much to say. The prefix here is ~w~.
#+name: keybindings-windows
| Key | Function | Description | Package |
|-----+-------------------------------+-------------+----------------|
| | | windows | |
| c | evil-window-left | | evil |
| t | evil-window-down | | evil |
| s | evil-window-up | | evil |
| r | evil-window-right | | evil |
| . | windows-adjust-size/body | | |
| - | split-window-below-and-focus | | |
| / | split-window-right-and-focus | | |
| $ | winum-select-window-by-number | | winum |
| 0 | winum-select-window-0-or-10 | none | winum |
| 1 | winum-select-window-1 | none | winum |
| 2 | winum-select-window-2 | none | winum |
| 3 | winum-select-window-3 | none | winum |
| 4 | winum-select-window-4 | none | winum |
| 5 | winum-select-window-5 | none | winum |
| 6 | winum-select-window-6 | none | winum |
| 7 | winum-select-window-7 | none | winum |
| 8 | winum-select-window-8 | none | winum |
| 9 | winum-select-window-9 | none | winum |
| b | kill-buffer-and-delete-window | | |
| d | delete-window | | |
| o | other-window | | |
| D | delete-other-windows | | |
| w | | writeroom | |
| w. | writeroom-buffer-width/body | | writeroom-mode |
| ww | writeroom-mode | | writeroom-mode |
#+name: keybinds-windows
| Key | Function | Description |
|-----+-------------------------------+-------------|
| | | windows |
| c | evil-window-left | |
| t | evil-window-down | |
| s | evil-window-up | |
| r | evil-window-right | |
| . | windows-adjust-size/body | |
| - | split-window-below-and-focus | |
| / | split-window-right-and-focus | |
| $ | winum-select-window-by-number | |
| 0 | winum-select-window-0-or-10 | none |
| 1 | winum-select-window-1 | none |
| 2 | winum-select-window-2 | none |
| 3 | winum-select-window-3 | none |
| 4 | winum-select-window-4 | none |
| 5 | winum-select-window-5 | none |
| 6 | winum-select-window-6 | none |
| 7 | winum-select-window-7 | none |
| 8 | winum-select-window-8 | none |
| 9 | winum-select-window-9 | none |
| b | kill-buffer-and-delete-window | |
| d | delete-window | |
| o | other-window | |
| D | delete-other-windows | |
| w | | writeroom |
| w. | writeroom-buffer-width/body | |
| ww | writeroom-mode | |
** Quit
Why would I ever use any of these keybindings? They are prefixed with ~q~.
#+name: keybindings-quit
Why would I ever use any of these keybinds? They are prefixed with ~q~.
#+name: keybinds-quit
| Key | Function | Description |
|-----+----------------------------+-------------|
| | | quit |

View File

@ -1112,9 +1112,6 @@ configuration [[file:mpd.org][here]]).
<<emms-search-set-variable>>
<<emms-media-hydra>>
(defun my/mpc-toggle ()
(interactive)
(shell-command-and-echo "mpc toggle"))
(defun emms-player-toggle-pause ()
(interactive)
(shell-command-and-echo "mpc toggle"))
@ -1156,7 +1153,27 @@ configuration [[file:mpd.org][here]]).
:packages 'emms
"d" #'emms-playlist-mode-kill-track
"p" #'emms-playlist-mode-play-smart
"q" #'kill-this-buffer))
"q" #'kill-this-buffer)
(phundrak/leader-key
:infix "m"
:packages 'emms
"" '(:ignore t :which-key "media")
"." #'hydra-media/body
"«" #'emms-player-mpd-previous
"»" #'emms-player-mpd-next
"c" #'emms-player-mpd-clear
"e" '(:ignore t :which-key "emms")
"eb" #'emms-browser
"ep" #'emms-playlist-mode-go
"es" #'emms-player-mpd-show
"p" '((lambda ()
(interactive)
(shell-command-and-echo "mpc toggle"))
:which-key "mpc toggle")
"s" #'emms-stop
"u" '(:ignore t :which-key "update")
"um" #'emms-player-mpd-update-all
"uc" #'emms-cache-set-from-mpd-all))
#+end_src
*** Finding files from EMMS
@ -1384,7 +1401,25 @@ doing and what Git is doing! In short, I absolutely love it!
:packages 'magit
"," #'with-editor-finish
"k" #'with-editor-cancel
"a" #'with-editor-cancel))
"a" #'with-editor-cancel)
(phundrak/leader-key
:infix "g"
:packages 'magit
"" '(:ignore t :wk "git")
"b" #'magit-blame
"c" #'magit-clone
"d" #'magit-dispatch
"i" #'magit-init
"s" #'magit-status
"l" #'magit-log
"y" #'my/yadm
"S" #'magit-stage-file
"U" #'magit-unstage-file
"f" '(:ignore t :wk "file")
"fd" #'magit-diff
"fc" #'magit-file-checkout
"fl" #'magit-file-dispatch
"fF" #'magit-find-file))
#+end_src
There is currently a bug in Emacs TRAMP as described in issue [[https://github.com/magit/magit/issues/4720][#4720]] of
@ -1440,7 +1475,14 @@ keywords in a buffer. Lets enable this mode globally.
(use-package hl-todo
:defer t
:straight (:build t)
:init (global-hl-todo-mode 1))
:init (global-hl-todo-mode 1)
:general
(phundrak/leader-key
:packages '(hl-todo)
:infix "c"
"" '(:ignore t :which-key "todos")
"n" #'hl-todo-next
"p" #'hl-todo-previous))
#+end_src
We can now configure properly =magit-todos=. Notice my custom function
@ -1575,7 +1617,12 @@ look nice.
:type git
:host github
:repo "tecosaur/screenshot")
:config (load-file (locate-library "screenshot.el")))
:config (load-file (locate-library "screenshot.el"))
:general
(phundrak/leader-key
:infix "a"
:packages '(screenshot)
"S" #'screenshot))
#+end_src
** Shells
@ -1626,17 +1673,6 @@ issue.
"p" #'multi-vterm-prev))
#+end_src
Another really neat package is =eshell-vterm= which allows to use vterm
to run visual commands when in Eshell.
#+begin_src emacs-lisp
(use-package eshell-vterm
:after eshell
:straight (:build t)
:config
(eshell-vterm-mode)
(defalias 'eshell/v 'eshell-exec-visual))
#+end_src
** XWidgets Webkit Browser
I used to use the xwidgets webkit browser in order to view or preview
HTML files from Emacs, but it seems the Cairo background transparency

View File

@ -301,5 +301,10 @@ youre not sure or if you dont remember what your snippet is.
(use-package ivy-yasnippet
:defer t
:after (ivy yasnippet)
:straight (:build t))
:straight (:build t)
:general
(phundrak/leader-key
:infix "i"
:packages 'ivy-yasnippet
"y" #'ivy-yasnippet))
#+end_src

View File

@ -75,6 +75,11 @@ compatibility package that adds states for iedit.
iedit-only-at-symbol-boundaries t
iedit-toggle-key-default nil)
:general
(phundrak/leader-key
:infix "r"
:packages '(iedit evil-iedit-state)
"" '(:ignore t :which-key "refactor")
"i" #'evil-iedit-state/iedit-mode)
(general-define-key
:keymaps 'evil-iedit-state-map
"c" nil

View File

@ -170,6 +170,8 @@ compilation buffer, as well as enable some syntax highlighting.
"r" nil
"R" #'recompile
"h" nil)
(phundrak/leader-key
"R" #'recompile)
:config
(setq compilation-scroll-output t))
#+end_src

View File

@ -49,6 +49,31 @@ it bépo-compatible.
:pakages 'avy
"gc" #'evil-avy-goto-char-timer
"gl" #'evil-avy-goto-line)
(phundrak/leader-key
:packages 'avy
:infix "j"
"b" #'avy-pop-mark
"c" #'evil-avy-goto-char-timer
"l" #'avy-goto-line)
(phundrak/leader-key
:packages 'avy
:infix "A"
"c" '(:ignore t :which-key "copy")
"cl" #'avy-copy-line
"cr" #'avy-copy-region
"k" '(:ignore t :which-key "kill")
"kl" #'avy-kill-whole-line
"kL" #'avy-kill-ring-save-whole-line
"kr" #'avy-kill-region
"kR" #'avy-kill-ring-save-region
"m" '(:ignore t :which-key "move")
"ml" #'avy-move-line
"mr" #'avy-move-region
"mt" #'avy-transpose-lines-in-region
"n" #'avy-next
"p" #'avy-prev
"u" #'my/avy-goto-url
"U" #'my/avy-open-url)
(phundrak/major-leader-key
:packages '(avy org)
:keymaps 'org-mode-map

View File

@ -327,6 +327,17 @@ specified org files which are described below.
(defvar org-worldbuilding-file "~/org/worldbuilding.org")
#+end_src
Let me describe a keybind to invoke org-capture from anywhere within
Emacs.
#+name: org-capture-keybinds
#+begin_src emacs-lisp :tangle no
(phundrak/leader-key
:packages 'org
:infix "o"
"" '(:ignore t :which-key "org")
"c" #'org-capture)
#+end_src
When ~org-capture~ is invoked, it will ask which template we wish to
use. In the table [[org-capture-shortcuts-table]], the /key/ column
represents which keychord we need to hit, titled with /name/, we need to
@ -1049,6 +1060,26 @@ management system based on org-mode.
:config
(org-roam-db-autosync-mode 1)
:general
(phundrak/leader-key
:packages '(org org-roam)
:infix "o"
"r" '(:ignore t :which-key "roam")
"rb" '(org-mark-ring-goto :which-key "back")
"rB" #'org-roam-buffer-toggle
"rn" '(:ignore t :which-key "nodes")
"rnf" #'org-roam-node-find
"rni" #'org-roam-node-insert
"rno" #'org-roam-node-open
"rnr" #'org-roam-node-random
"rnv" #'org-roam-node-visit
"rs" '(:ignore t :which-key "sync")
"rsa" #'org-roam-db-autosync-mode
"rsc" #'org-roam-db-clear-all
"rsd" #'org-roam-db-diagnose-node
"rss" #'org-roam-db-sync
"ru" '(:ignore t :which-key "ui")
"rua" #'org-roam-ui-add-to-local-graph
"ruo" #'org-roam-ui-open)
(phundrak/major-leader-key
:keymaps 'org-mode-map
:packages '(org org-roam)

View File

@ -338,7 +338,20 @@ in quite a few languages.
:config
(setq langtool-java-classpath (string-join '("/usr/share/languagetool"
"/usr/share/java/languagetool/*")
":")))
":"))
:general
(phundrak/leader-key
:packages 'langtool
:infix "l"
"" '(:ignore t :which-key "LangTool")
"B" #'langtool-correct-buffer
"b" #'langtool-check-buffer
"c" #'langtool-check
"C" #'langtool-correct-at-point
"d" #'langtool-check-done
"l" #'langtool-switch-default-language
"p" #'langtool-show-message-at-point
"r" #'langtool-correct-region))
#+end_src
Finally, =writegood-mode= detects some simple general rules when writing
@ -795,17 +808,6 @@ When editing some scripts though, I need to use the built-in ~shell-mode~.
:mode "\\.yaml\\'")
#+end_src
*** yuck
This is one of the two file formats used by [[https://github.com/elkowar/eww/][eww]]s configuration, a
Lisp-like language. Therefore, it will also use [[file:./editing.md#parinfer][parinfer]] to manage its
parenthesis.
#+begin_src emacs-lisp
(use-package yuck-mode
:straight (:build t)
:defer t
:hook ((yuck-mode . parinfer-rust-mode)))
#+end_src
** General Programming Languages
*** C/C++
I know, I know, C and C++ no longer are closely related languages,

View File

@ -40,11 +40,6 @@ for fish.
direnv hook fish | source
#+end_src
I also use [[https://github.com/elkowar/eww/][eww]] for some widgets, lets load its shell completions.
#+begin_src fish
eww shell-completions --shell fish | source
#+end_src
Since I dont really have a better place on this website to put it,
here is my direnv configuration located at
=$HOME/.config/direnv/direnv.toml=.

View File

@ -40,43 +40,9 @@ input {
We can then set the monitors used. If =HDMI-A-1= is not found when
Hyprland launches, it will simply ignore it. And at worst, I can use
[[https://github.com/artizirk/wdisplays][wdisplays]] to manually set the position of my screens.
#+name: monitors-table
| Monitor name | Resolution | Refresh rate (Hz) | Position |
|--------------+------------+-------------------+----------|
| HDMI-A-1 | 2560x1080 | | 0x0 |
| eDP-1 | 1920x1080 | 120 | 2560x0 |
#+name: gen-monitors
#+begin_src emacs-lisp :var table=monitors-table :exports results :tangle no :wrap "src conf" :cache yes
(let ((normalize-value (lambda (value)
(or (if (numberp value)
(number-to-string value)
value)
""))))
(mapconcat (lambda (line)
(let* ((monitor (funcall normalize-value (nth 0 line)))
(resolution (funcall normalize-value (nth 1 line)))
(refresh-rate (funcall normalize-value (nth 2 line)))
(refresh-rate (if (string= "" refresh-rate) "" (concat "@" refresh-rate)))
(position (funcall normalize-value (nth 3 line)))
(scale (funcall normalize-value (nth 4 line)))
(scale (if (string= "" scale) "1" scale)))
(format "monitor = %s, %s%s, %s, %s"
monitor
resolution
refresh-rate
position
scale)))
table
"\n"))
#+end_src
This translates into the following configuration:
#+RESULTS[7a1e8ae4a77d335ec873de9ef0536bb45c84f2a0]: gen-monitors
#+begin_src conf
monitor = HDMI-A-1, 2560x1080, 0x0, 1
monitor = eDP-1, 1920x1080@120, 2560x0, 1
monitor = eDP-1, 1920x1080, 2560x0, 1
#+end_src
** Visual configuration
@ -190,15 +156,9 @@ Having a working policy kit is generally a good idea.
exec-once = xfce-polkit
#+end_src
Now, lets launch the notification daemon [[https://github.com/ErikReider/SwayNotificationCenter][swaync]].
Now, lets launch the notification daemon [[https://dunst-project.org/][dunst]].
#+begin_src conf
exec-once = swaync
#+end_src
Lets also launch [[https://sr.ht/~kennylevinsen/wlsunset/][wlsunset]]. Ill very vagely aim at Paris with the
longitude and latitude.
#+begin_src conf
exec-once = wlsunset -l 48.5 -L 2.2 -d 1500
exec-once = dunst
#+end_src
Lets launch some apps and their applet. Here, were launching the
@ -427,12 +387,12 @@ what most of these do.
Here are the keybinding for the screenshot submap
#+name: screenshot-submap
| Modifiers | Key | Action | Argument | Submap |
|-----------+-------+--------+--------------------+--------|
|-----------+-------+--------+-----------------+--------|
| | Print | exec | =screenshot= | reset |
| | d | exec | =screenshot -d 3= | reset |
| Shift | d | exec | =screenshot -sced 3= | reset |
| | e | exec | =screenshot -sec= | reset |
| | c | exec | =screenshot -c= | reset |
| | s | exec | =screenshot -s= | reset |
| | g | exec | =screenshot -g= | reset |
| | d | exec | =screenshot -d 3= | reset |
| Shift | s | exec | =screenshot -sc= | reset |
*** Windows

View File

@ -234,6 +234,20 @@ UNREAD=$(mu find "flag:unread AND (maildir:/Inbox OR maildir:/Junk)" | wc -l)
printf "^f2^f0%s" "$UNREAD"
#+end_src
*** Post scrot script
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :tangle ~/.local/bin/post-scrot
:END:
It is possible to call a script on the resulting image of a ~scrot~
command. Not only do I want to move them to a specific directory, I
also want to be able to see them in ~nsxiv~ (a replacement for ~sxiv~) in
case I want to edit the image, copy it or simply delete it (sometimes
I take screenshots by accident).
#+begin_src sh
mv "$@" ~/Pictures/Screenshots/
nsxiv -abfs f "$HOME/Pictures/Screenshots/$*"
#+end_src
*** screenshot
:PROPERTIES:
:HEADER-ARGS: :shebang "#!/usr/bin/env sh" :mkdirp yes :tangle ~/.local/bin/screenshot
@ -255,7 +269,7 @@ OUTFILE_BASE="$HOME/Pictures/Screenshots/Screenshot_$(date +%Y%m%d)_$(date +%H%M
OUTFILE="$OUTFILE_BASE.png"
SUFFIX=0
while getopts ':cd:egs' OPTION; do
while getopts ':cd:gs' OPTION; do
case "$OPTION" in
c )
COPY="yes"
@ -263,9 +277,6 @@ while getopts ':cd:egs' OPTION; do
d )
DELAY="$OPTARG"
;;
e )
EDIT="yes"
;;
g )
GIMP="yes"
;;
@ -273,29 +284,21 @@ while getopts ':cd:egs' OPTION; do
SELECT="yes"
;;
? )
echo "Usage: $(basename "$0") [-c] [-d DELAY] [-e] [-g] [-s]"
echo "Usage: $(basename "$0") [-c] [-d DELAY] [-g] [-s]"
exit 1
;;
esac
done
if [ "$SELECT" = "yes" ]
then AREA="$(slurp)"
fi
if [ -n "$DELAY" ]
then sleep "$DELAY"
fi
if [ "$SELECT" = "yes" ]
then grim -g "$AREA" "$OUTFILE"
then grim -g "$(slurp)" "$OUTFILE"
else grim "$OUTFILE"
fi
if [ "$EDIT" = "yes" ]
then swappy -f "$OUTFILE" -o "$OUTFILE"
fi
if [ "$GIMP" = "yes" ]
then gimp "$OUTFILE"
fi