/emacs.d

Primary LanguageEmacs Lisp

Elisp Mode

  • Start REPL with ielm.
  • Execute expression in mini-buffer with M-:.
  • Debug config starting Emacs with: emacs --debug-init.
  • Reload config in current buffer with M-x eval-buffer.

Org Mode

Haskell Mode

  • Generate TAGS for all the project dependencies with codex update command and then load them with M-x visit-tags-table. Jump to tag is now possible with M-..

Color Themes

  • When switching between them, disable previous themes with M-x disable-theme to not have interference.

Tags

Annotations and Overlays

  • Mark a region with annotate-annotate
  • List annotations with annotate-show-annotation-summary
  • Disable with annotate-toggle-all-annotations-text
  • Overlay a symbol with symbol-overlay-put
  • Disable with symbol-overlay-remove-all

Merging changes

  • vdiff / ediff: to merge changes between different files
  • smerge-mode / smerge-ediff: to merge diff3 output from git

Spelling

  • Correct closest misspelled word with z =.
  • Change language with jinx-languages.
  • Enable text-mode to check the grammar with languagetool (run first systemctl start languagetool.service).

Tree-Sitter

  • Highlight nodes of the code with tree-sitter-query-builder. You can see the full code structure with tree-sitter-debug-mode. Highlight query example for Python:
(type (identifier) @var)
(return_statement (call (identifier)) @var)

GPT

  • Select a piece of text and call gpt-dwin or codegpt.

Jupyter Notebooks

Tabs

  • Select with: M-x tab-switch.

Emacs packages

  • Refresh repos with: package-refresh-contents.
  • Upgrade all new available versions with: package-list-packages and later press U x.

Saving/restoring sessions

  • Save current session (windows/buffers) with: desktop-save
  • Restore session with: desktop-change-dir

  • Use *-ts-mode in all the hooks for language modes.