Skip to content

Instantly share code, notes, and snippets.

@cander
Last active December 7, 2022 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cander/4aeaf253729f170a0a3dba869fa1be39 to your computer and use it in GitHub Desktop.
Save cander/4aeaf253729f170a0a3dba869fa1be39 to your computer and use it in GitHub Desktop.
A personal cheat sheet for vim

Vim Cheat Sheet

FYI - this is not a general-purpose cheat sheet for vim. I've been using vim/vim for over 35 years.
So, this is more of list of random things in core-vim or various plugin-ins that I've recently started using or am strugging to remember when I need them.

Tags

Use exerberant ctags for best results. (It's not the default ctags program on MacOS.)

g-]          Search for the tag under the cursor and select between multiple possible matches.

Formatting

gq}          Format the rest of the current paragraph, wapping lines
gqG          Format the rest of the file

Ctrl-P

Ctrl-P provides fuzzy matching for file, path, and buffer names. Once it starts:

ctrl-r        Toggle regexp mode - useful when you want to make the matching less fuzzy to search for sequential characters.
ctrl-f ctrl-b Cycle through the modes - matching files, buffers, or MRU files
ctlr-d        Toggle between file name vs. path name matching
F5            Refresh the list of files - useful if you just moved a bunch of files around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment