paperlined.org
apps > vim
document updated a month ago, on Aug 12, 2024

recipes for specific Vim highlights

intersperse command-line commands with other text

Sometimes I have a long list of commands that are intended to be cut-n-pasted into the command line, one at a time. But sometimes there will be explanatory text interspersed. To clearly distinguish between the text intended for computer consumption and the text intended for human consumption, I signify which are command-line commands by appending a single space to those lines. Then I add this at the top:

type ,S on the next line to enable hilighting of the command-line commands in this document:
    call clearmatches() |  call matchadd('ColorColumn', '^[ \t]*\zs.*[^ ] $')

REPLACE ME