I've done something similar before. I was learning Vim's fold commands. I just
stuffed my cheat sheet in a string that separated each line with a comma...
let g:foldcmds = split("zf (Plus a motion) Operator to create a fold.,zF Create a fold for [count] lines. Works like zf.,zd Delete one fold at the cursor.,zD Delete folds recursively at the cursor.,zE Eliminate all folds in the window.,zo Open one fold under the cursor.,",',')
(That's an abbreviated version.)
Alternatively, read the cheatsheet from a file:
let g:foldcmds = readfile('/path/to/file')
Each line in the file will get a line in the popup.
You'd call it like this for example...
:call popup_create(g:foldcmds, #{ title: ' Fold Commands ',
padding: [0,1,0,1], border: [], filter: 'popup_filter_yesno', close: 'click' })
Then I stuck it in a mapping...
nnoremap <silent> <leader>z :call popup_create(g:foldcmds, #{ title: ' Fold Commands ',
padding: [0,1,0,1], border: [], filter: 'popup_filter_yesno' })<CR>
Result:
Hit Esc or X to exit.