Thanks @danidiaz and @Jake,
You both seem to be heading down similar paths and I had not even thought of doing it that way.
Here's what I came up with as a 2D
.vimrc comment display format directly in the
.vimrc file. Let me know what you think.
"= GENERIC CLIPBOARD YANK <F2>y (Y for Yank)
"= Yank the entire contents of the file into the clipboard; quit without saving.
"define F2 followed by y to be:
"| Go to line 1.
"| | From there, into the * buffer (system clipboard),
"| | | yank to the end of the file.
"| | | | Go to sleep for 1 second (to allow the clipboard to be updated).
"| | | | | Quit without saving the file.
"| | | | | |
map #2y 1G"*yG1gs:q!<CR>
I've flagged two lines above with
"= at the beginning of each, so that they can become the User Help. Then a grep command could search for
"^\"= ". Here's the command I used.
grep -B 1 -E "^\"= " ~/.vimrc
I'm not sure if the
-E for Extended Regular Expressions is needed and I like the
-B 1 to include one line previous to a matching sequence, so in the
.vimrc fragment above, I have an explicitly empty comment line.
I can easily make a shell script for that and execute it with a
! command inside
vim. I'm looking at how I might do that easily from inside
vim, without the shell command, but that's a little lower priority.