#============================================================ # Neovim Command Reference (Core Commands) #============================================================ #============================================================ # FILE & SESSION MANAGEMENT #============================================================ :w (write) Save current buffer :w Write to (does NOT rename buffer) :sav (saveas) Save to and rename current buffer :q (quit) Quit current window if no unsaved changes :q! Force quit (discard changes) :wq Write and quit current buffer :wqa Write and quit all buffers :qa Quit all windows :qa! Quit all without saving :e (edit) Edit in current window (new buffer) :e! Revert buffer to last saved version (discard changes) :enew Create new empty buffer :r (read) Read into current buffer after cursor :ter (terminal) Open terminal buffer :clo (close) Close current window #============================================================ # BUFFERS #============================================================ :ls (buffers) List open buffers :bn (bnext) Go to next buffer :bp (bprev) Go to previous buffer :b Go to buffer by number :b Go to buffer by (partial) name :bd (bdelete) [] Delete current (or given) buffer :bw (bwipeout) [] Delete buffer and remove from memory :bo (only) Close all windows except current :e # Edit alternate (previous) buffer :b# Switch to alternate buffer :b% Re-edit current buffer (no-op) :b$ Go to last buffer #============================================================ # WINDOWS (SPLITS) #============================================================ :sp (split) [] Split horizontally (optionally open ) :vsp (vsplit) [] Split vertically (optionally open ) :new Split with new empty buffer :vnew Vertical split with new empty buffer :close Close current window :only Keep only current window open #============================================================ # TABS #============================================================ :tabnew [] Open new tab (optionally edit ) :tabn (tabnext) Go to next tab :tabp (tabprev) Go to previous tab :tabm (tabmove) Move current tab to position :tabfirst Jump to first tab :tablast Jump to last tab :tabc (tabclose) Close current tab :tabo (tabonly) Close all other tabs :tabdo Execute in all tabs (e.g. :tabdo q) #============================================================ # REGISTERS, MARKS & HISTORY #============================================================ :reg (registers) Show register contents :marks Show all marks :ju (jumps) Show jump list :changes Show change list #============================================================ # SEARCH / GREP / QUICKFIX #============================================================ :g/{pattern}/d Delete all lines matching {pattern} :g!/{pattern}/d Delete all lines NOT matching {pattern} :vim /{pattern}/ **/* Search for {pattern} recursively in all files :cn (cnext) Jump to next quickfix entry :cp (cprevious) Jump to previous quickfix entry :cope (copen) Open quickfix window :ccl (cclose) Close quickfix window :cl (clist) List quickfix entries #============================================================ # DIFF MODE #============================================================ :diffthis Start diff mode for current window :diffo (diffoff) Turn off diff mode :diffu (diffupdate) Recalculate diff :diffg (diffget) Get changes from other window :diffpu (diffput) Send changes to other window #============================================================ # NOTES & SYMBOLS #============================================================ % Current buffer # Alternate (last visited) buffer $ Last buffer in list + Next buffer - Previous buffer " Most recently edited buffer (context dependent)