Below is a collection of keyboard shortcuts using The ultimate vim configuration with these custom settings .As this is a cheat sheet, it will be updated over time to include new keyboard shortcuts and to maintain existing ones.

Surrounding Text

  • ds" : delete surrounding double quote
  • cs"' : change surrounding double quote to single quote
  • cst<h2> : change surround tag to <h2>
  • ysiw " : surround the inner words with double quotes

Basic Text Manipulation

  • gc : comment/uncomment code (must be in visual mode)
  • gcc : comment/uncomment code
  • ciw : “change inner word”; use instead of “change word”
  • cit : change text inside tags
  • gUiw : upper case word
  • ,<cr> : disable highlights
  • ys3w] : put brackets around next 3 words
  • ,enter : clear enter
  • YY : copy to clipboard

Navigating File System

  • ,nn : use NERD tree to navigate filesystem and open files
  • ,nb : open NERD tree from bookmark
  • ,g : search pattern through files
  • ,f : open recently-opened files
  • gx : open link under the cursor in web browser
  • ,w : fast save of buffer

Managing Tabs and Windows

  • tn : new tab
  • to : close all windows except current
  • tc : close tab
  • ab> : next tab
  • <shift><tab> : previous tab

Advanced Selections

  • : -8,-6co. : copy relative line numbers -8 through -6 to where the cursor is at

Editing Modes

  • ,z : removes all distractions and centers text while editing markdown and text files

vimtek

  • \ll : start compiling the document
  • \lv : open pdf viewer and/or do forward searching
  • \lC : clean up all generated files from compile