Emacs - shivamvats/notes GitHub Wiki
- Switching between different distributions: Chemacs
-
No such file sqlite: delete~/.config/.local/straight/*/sqlitedirectory.
- Switch to
lisp-interaction-modeto be able to run lisp code. - Go to the ending paran and run
C-x C-eto evaluate the code and show the result in the bottom buffer. - Run
ielmto enter elisp interactively.
-
(setq var t)sets the valuetto the variablevar. -
(fun t)calls the functionfoowith the parametert.
-
Modes
-
Major Mode: Determines the behavior of shortcuts, highlighting, etc. It is often determined by the filetype. Can also be changed, e.g.
M-x org-mode. - Minor Mode: Controls smaller features like linting and auto-complete. You can enable multiple of these at a time.
-
Major Mode: Determines the behavior of shortcuts, highlighting, etc. It is often determined by the filetype. Can also be changed, e.g.
-
Hook: A hook is a Lisp variable that contains a list of functions that are run on well defined occasions, like, when exiting Emacs or initializing a major mode. The
add-hookcommand adds a function to a hook:(add-hook 'text-mode-hook 'auto-fill-mode) -
Shortcut Prefixes:
-
M-xcall a command by name -
C-xcall a globally useful command -
C-ccall major-mode specific command -
C-u n M-x foocall a command foo with the argumentn
-
-
Buffers:
-
C-b Ncreate new empty buffer -
C-x bshow all buffers -
C-x 1close all buffers except the current one -
C-x 2orC-x 3horizontal (or vertical) split
-
-
M-x describe-bindingsdescribe all keybindings -
C-y: paste stuff (works for pasting a link from the clipboard in org mode) -
M-$: fix spelling of word under cursor
-
<leader>.: Search for file -
<leader>/: Search for reference in project -
C-p: Search for file in project
-
,p: prefix for projectile-
,pp: switch to known project -
,pa: add new project
-
-
,/: search for text in all project files
-
treemacs: file explorer on the side
-
S-M-RET: Insert a todo below the current line. -
C-c C-t: Change the done status of a todo. -
M-RET: Insert a new heading, item or row. -
M-RIGHT: Demote one level. -
C-c .: Insert date and add to agenda -
C-c !: Insert date but don't add to agenda -
org-tree-to-indirect-bufferor,bs: View only the current subtree in a new buffer. -
C-c ,: Add priority to TODO. -
C-c C-x C-t: Switch date format -
org-store-link: Copy the location of a subheading -
org-insert-link: Insert the copied link -
C-c C-a:org-attachcan attach files to tasks. -
-
C-c |: Insert new table -
<W>: Add in a row to specify width of each column -
TABorRETorC-c C-c: Realign table -
C-c TAB: Shrink/expand column
-
-
C-c C-fandC-c C-b: Go to next/previous heading at the same level -
C-c C-u: Go to higher heading level
-
\,:org-switchbswitches to another org buffer.
-
C-c a: Select agenda view -
C-c / t: View a sparse todo tree of the current file -
S-TABto toggle the level of file outline -
zcandzOto fold or expand a subtree -
C-C C-x a: archive a sub-tree -
C-c C-x C-v: inline mode for images -
-
C-c C-x C-c: Open column view -
S-<left>orS-<right>: To cycle through allowed values of an entry
-
-
M-x org-id-get-create: Add an id to a header that can be referenced.
- To add a TODO to your schedule, you need to
org-schedule <,ds>ororg-deadline <,dd>it. -
C-c C-x C-i: Start the clock for a task. -
C-c C-x C-o: Stop the clock for a task.
-
C-c M-w: refile a sub-tree -
C-c c: Select capture template
- Preferences
-
SPC a o j: Base command
Using doom's org-biblio package along with zotero's better bibtex plugin for reference management. See tutorial for details.
-
org-cite-insertor\@to insert a citation. -
citar-open-entryto open reference in zotero -
citar-opento open reference -
citar-open-notesor,nbto open or create paper org-roam note