https://github.com/gn0/vim-cheatsheet
Plugin for toggling a popup window with a buffer-specific cheatsheet
https://github.com/gn0/vim-cheatsheet
vim
Last synced: 9 months ago
JSON representation
Plugin for toggling a popup window with a buffer-specific cheatsheet
- Host: GitHub
- URL: https://github.com/gn0/vim-cheatsheet
- Owner: gn0
- License: cc0-1.0
- Created: 2025-07-19T02:49:12.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-19T02:50:58.000Z (11 months ago)
- Last Synced: 2025-07-19T07:51:48.605Z (11 months ago)
- Topics: vim
- Language: Vim Script
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING.txt
Awesome Lists containing this project
README
# vim-cheatsheet
A Vim/Neovim plugin that toggles a popup window with custom content that you set for the buffer.
Motivating use case: forgetting whether `$<` or `$^` is the variable that contains all prerequisites of a recipe in a [Makefile](https://www.gnu.org/software/make/manual/html_node/Introduction.html).
With vim-cheatsheet, I can toggle a reminder when I am editing a Makefile:
```vim
autocmd FileType make
\ let b:cheatsheet_title = "Makefile reminders" |
\ let b:cheatsheet_lines = [
\ "$< first prerequisite",
\ "$^ all prerequisites",
\ ]
```

By default, the toggle switch is mapped to `C`.
You can override this by setting `g:cheatsheet_no_mappings`:
```vim
let g:cheatsheet_no_mappings = v:true
" Bind the toggle to `g?` instead:
nmap g? ToggleCheatsheet
```
## Installation
Use your Vim package manager, or install it manually in Vim:
```
$ mkdir -p ~/.vim/pack/gn0/start
$ cd ~/.vim/pack/gn0/start
$ git clone https://github.com/gn0/vim-cheatsheet.git
$ vim -u NONE -c "helptags vim-cheatsheet/doc" -c q
```
Or in Neovim:
```
$ mkdir -p ~/.config/nvim/pack/gn0/start
$ cd ~/.config/nvim/pack/gn0/start
$ git clone https://github.com/gn0/vim-cheatsheet.git
$ nvim -u NONE -c "helptags vim-cheatsheet/doc" -c q
```
## License
vim-cheatsheet is distributed under [CC0](https://creativecommons.org/public-domain/cc0/).