Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

No need for an external cheatsheet:

:viusage
:exusage

and:

:h quickref
share|improve this answer
    
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.