How do I launch a GDB session in Vim with the built-in termdebug plugin?
:packadd termdebug | Termdebug
For quick debugging without leaving Vim, the built-in termdebug plugin wires a GDB session directly into your editing workflow.
:packadd termdebug | Termdebug
For quick debugging without leaving Vim, the built-in termdebug plugin wires a GDB session directly into your editing workflow.
:setlocal winfixwidth
When you use a sidebar-style split for file trees, docs, or logs, automatic window equalization can constantly resize it.
:set jumpoptions=stack,view
By default, jump navigation can feel lossy in long files: you jump back, but folds, topline, and viewport context do not always match what you were looking at b
:cexpr system('rg --vimgrep "TODO"')
When you already know you want an external search tool, :cexpr lets you import results directly into quickfix without opening a terminal buffer or shelling out
:bufdo if &buftype ==# '' | update | endif
bufdo is powerful for multi-buffer automation, but a naive write pass can error on special buffers (help, terminal, quickfix, prompts).
buffers-windows #buffers #windows #ex-commands #automation #workflow
:let @q .= "j^"
Live macro recording is fast, but adjusting the tail of a macro by re-recording can be risky once it already works in most places.
macros #macros #registers #automation #normal-mode #workflow
:history :
When you work with long substitution pipelines or multi-part Ex commands, digging through all history (:history) adds noise.
:keepjumps normal! gg=G<CR>
Whole-buffer reindent is common, but doing it naively can pollute your jumplist and break navigation flow during review.
:windo lcd %:p:h<CR>
When multiple splits point at files from different projects, relative-path commands can become inconsistent and error-prone.
:redir @a | messages | redir END<CR>
When debugging a session or building repeatable edits, it is useful to turn command output into editable text.
:set makeprg=python3\ %
Setting makeprg to include % lets :make always execute the file you're currently editing.
:e $MYVIMRC
The :e $MYVIMRC command opens your Vim or Neovim configuration file instantly, no matter where it lives.
:DiffOrig
:DiffOrig opens a side-by-side split comparing your current (unsaved) buffer against the version on disk.
buffers-windows #diff #buffers #editing #workflow #buffers-windows
:w ++p
Neovim's :w ++p flag automatically creates any missing intermediate directories when writing a file.
:cd -
The :cd - command switches Vim's global working directory back to the previous one, just like cd - in the shell.
:let @q = @:
The : register always holds the last Ex command you ran.
:set sessionoptions
The sessionoptions option (abbreviated ssop) is a comma-separated list of flags that determine what :mksession stores in the session file.
buffers-windows #buffers-windows #config #workflow #sessions
:packadd termdebug
Vim ships with a built-in termdebug plugin that integrates GDB directly into the editor.
:ls +
The :ls command (or :buffers) supports filter flags that narrow the buffer list to specific states.
qq;.q then @q or @@
The dot command (.