Doom Emacs
February 4, 2025 |
permanent
tags :
Emacs #
Common #
SPC-u :: universal arguments
Search #
- g s SPC
- “characters”
from the location type “g s SPC “characters” and things to copy
- SPC '
- -> resume search
- SPC s
- prefix command
- d: directory
- p: project
- m: bookmark
- t: dictionary
- T: thesaurus
- m: bookmarks
- s: in buffer
- o: online
- O: search in all online
- i: consult-imenu
Jump #
- SPC Enter
- bookmarks list
Windows #
- SPC-w-Co or Cw-Co
- Delete Other Windows
- SPC-w SPC-q
- delete current window
- SPC-w c
- close current window
Folding #
- z - m
- fold
- z - r
- unfold
- z - R
- unfold all
- z - c
- close
- z - o
- open
Files & Buffers #
- SPC .
- find file current directory
- SPC ,
- switch buffer
- SPC b k
- kill buffer
- SPC f s
- save file
- SPC f r
- recent files
Project #
- SPC p p
- switch project
- SPC p f
- find file in project
Code/Text #
- SPC c f
- format buffer
- SPC c k
- documentation
- gc
- comment/uncomment
Help #
- SPC h k
- keybinding help
- SPC h v
- describe variable
- SPC h f
- describe function
- SPC h d
- prefix for doom help
Workspaces #
TAB
- TAB .
- switch
- TAB 0
- last workspace
- TAB S
- auto save current session
- TAB s
- Save workspace to file
git #
prefix key: g
- g
- status
- c
- create
- t
- time-machine
- b
- switch branch
- B
- git blame (annotate code lines with authors)
- @
- Magit Forge
Org Mode #
SPC m :: org mode shortcuts
SPC m b :: org Tables shortcuts
Motions #
g : goto or jump
- gj/gk
- same level jump
- gh/gl
- different level
Structural Editing #
- insert new heading after subree
- C-RET
- promote/demote heading
- M-h/l or M-Left/Right
- move subtree/list item up/down
- M-j/k
- move list item up/down but not sub tree
- M-S-j/k
Some advanced editing with Evil Mode #
e -> element R -> subtree
- select an element
- vae
- delete an element
- dae
- select a subtree
- vaR
- delete subtree
- daR
- yank subtree
- yiR
- yank subtree
- yiR
- yank around subtree
- yaR
Inserting Snippets #
- SPC-i-s
- select and insert the snippet
TODO #
TODO :
Tables #
- Creating a table
- use |
- forward/backword
- Tab/S-Tab
- New row
- Tab at the end column
Make org table headline- SPC m b -
SPC m b (org table) - Duplicate a filed in the cell below
- S-RET
One Two Three A word 2nd Word 3rd Word Another word Another word Another word Yet another word Yet another word Yet another
Table motion #
- move current row UP
- M-k
- move current row Down
- M-j
- Move current column LEFT
- M-h
- Move current column Right
- M-l
- Insert new Column
- SPC m b i c
- Delete current Column
- SPC m b d c
- Insert new Row
- SPC m b i r
- Delete current Row
- SPC m b d r
Doom Emacs Commands #
Update packages only #
doom sync -u
Update packages with native compilation #
build the all the packages native compilation, .elc, for performance
doom sync --aot --rebuild
To upgrade the doom emacs #
doom upgrade
Org Tree Slide Mode #
- org-tree-slide-mode -> SPC t p
- C - >(<) -> to move next and back
Folding #
Consult outline #
spc-c-m-o: `consult-outline`- shows the folded outline in a better way, jumps while scrolling through
spc-c-m-l: `lsp outline`spc-c-m-i: `imenu`