# How can I pop-up a cheat sheet in GVIM on command?

I know there are lots of cheat sheets for VIM out there, but I hate having to print out so many cheat sheets.

Is there a way I can pop-up a cheat sheet with a shortcut?

I am using GVIM on Windows, so I would prefer something pretty like this, but a text one would be fine too. I know VIM has a pretty extensive help system, but I haven't found anything that just lists common shortcuts quickly.

-

## 2 Answers

First, save the cheatsheet.gif somewhere on your computer.

On Windows (largely taken from 'How to easily open files and URLs from the [windows] command-line' and 'Execute external programs asynchronously under Windows'), you can use this ex command:

:!start cmd /c start C:\path\to\cheatsheet.gif


To turn this into a keymap, use something like:

:nnoremap <f5> :!start cmd /c start C:\path\to\cheatsheet.gif


To make it permanent, put that line in your vimrc (:e \$MYVIMRC), but don't include the colon at the very start of the line.

On Linux:

:!xdg-open /path/to/cheatsheet.gif &
:nnoremap <f5> :!xdg-open /path/to/cheatsheet.gif &


I can't recall off the top of my head what the OSX command for 'open with default application' is, but the vim command would just replace xdg-open with whatever that is.

All of these just open cheatsheet.gif with the default program you have set up for GIF images. See :h ! and (for Windows) :h !start.

-

No need for an external cheatsheet:

:viusage
:exusage


and:

:h quickref

-
While I much prefer having something internal, these are still too long to use for a quick reference. But great for when I'm working over ssh. –  Dan Feb 4 at 5:15