Skip to content
OSTnmPublic

About

An Emacs configuration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

My Emacs Configuration

GitHub last commit Emacs 30.2 License

Terminal-oriented Emacs configuration for C/C++, Python, Go, Rust, TypeScript, YANG, YAML, Meson, and CMake development. It is optimized for tmux sessions and LSP-based navigation.

Screenshot

Highlights

  • Vertico, Orderless, Marginalia, and Consult for minibuffer completion and search
  • Company and Yasnippet for in-buffer completion
  • lsp-mode with deferred startup for clangd, basedpyright, rust-analyzer, and other language servers
  • One xref-backed jump history shared by LSP and common navigation commands
  • Flycheck diagnostics supplied by LSP
  • Undo Tree, Smartparens, Multiple Cursors, and Move Text
  • Window Numbering with a local Emacs 30 compatibility version
  • Nerd Icons in completion, Dired, Ibuffer, grep, and xref results
  • Clipetty integration for terminal and tmux clipboard access
  • TRAMP support for remote development

Configuration Layout

File Purpose
init.el Bootstrap package loading, executable paths, temporary files, and the Emacs server
lisp/init-packages.el Package declarations and programming tools
lisp/init-better-defaults.el Editing defaults, helper commands, and unified jump history
lisp/init-keybindings.el Global and LSP key bindings
lisp/init-ui.el Theme-independent UI and font-lock customization
lisp/init-org.el Org mode, capture, Babel, and LaTeX settings
lisp/init-custom.el Customize-generated settings and selected packages

Completion and Search

The completion stack uses:

External search commands use rg and fd.

Programming and LSP

lsp-mode starts with lsp-deferred in supported programming buffers. Semantic tokens, lenses, and file watchers are disabled to keep large source trees responsive. Completion uses CAPF through Company, and diagnostics are displayed through Flycheck.

After changing a language server or its workspace configuration, restart the LSP workspace with:

M-x lsp-workspace-restart

Unified Jump History

LSP already records destinations in xref history. Other navigation commands, including Consult, Imenu, bookmarks, function/variable lookup, Occur, and next-error, add their origins to the same history only when a jump actually occurs. Failed or cancelled commands do not add entries.

Key Action
M-j Jump backward
M-k Jump forward
M-n Find LSP definition
M-m Find LSP references
M-p Search LSP workspace symbols

Key Bindings

Search and navigation

Key Command
M-s o consult-line
C-x b consult-buffer
M-g g consult-goto-line
M-y consult-yank-pop
C-x c i consult-imenu-multi
C-x C-d consult-fd
C-x C-g consult-grep
C-x C-r consult-ripgrep
C-c l LSP command map

Editing and help

Key Command
F2 Open ~/.emacs.d/init.el
C-M-p / C-M-n Move five lines backward/forward
C-M-\ Indent the active region or entire buffer
C-c C-c Edit selected lines with Multiple Cursors
C-h C-f Find function definition
C-h C-v Find variable definition
C-h C-k Find the function bound to a key

Helper Commands

Command Description
ostnm/cflow-function Generate a C call graph for a function
ostnm/bing-dict-ee Insert an English explanation using bin/translate.py
ostnm/indent-region-or-buffer Indent the active region or the entire buffer
ostnm/hidden-dos-eol Hide carriage-return characters
ostnm/remove-dos-eol Remove carriage-return characters
ostnm/delete-trailing-whitespace Clean matching files under a directory

Dependencies

  • Emacs 30.2
  • rg (ripgrep)
  • fd
  • clangd
  • cflow
  • tmux for terminal clipboard integration
  • Python 3 with requests and beautifulsoup4 for bin/translate.py
  • Inconsolata and a Nerd Font in graphical/terminal environments respectively

Packages declared with use-package :ensure t are installed from GNU ELPA, NonGNU ELPA, or MELPA.

About

An Emacs configuration

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages