I wanted to create a quick searchable Vim cheat sheet, and I decided to use a text file as the cheat sheet and then pipe that to a Rofi dmenu.
If you have Rofi installed you can try it out like this:
curl -s https://raw.githubusercontent.com/rdvm/rofi-vim/master/vimcheat | rofi -dmenu -i -font "mono 20" -columns 2 -width 100 -location 1 -lines 20 -bw 2 -yoffset -2Or if you have dmenu installed:
curl -s https://raw.githubusercontent.com/rdvm/rofi-vim/master/vimcheat | dmenu -i -l 30The rofi-vim file in this repository is the script I use on my system to
launch the cheat sheet. The structure of the script was copied from this
gist created
by @tadly for using Rofi as an emoji picker.
:grinning:
You can place the script somewhere in the $PATH on your system to be able to
call it from anywhere or by using a key-binding.
The script will download the cheat sheet file from this repo and cache it
locally so it only needs to be downloaded once. You can also use the
--download argument to refresh the cheat sheet in case it's changed. When
you run rofi-vim it will automatically fetch a fresh copy if the current
cached copy is more than 5 days old.
There is an optional --dvim argument if you want to use dmenu instead of
Rofi, and if no argument is supplied it will use Rofi by default.