paperlined.org
apps > vim
document updated 6 hours ago, on Nov 6, 2024

recipes for specific Vim highlights

in log files, highlight all warnings and errors

call clearmatches() |   call matchadd('ErrorMsg', '\cerror\|failure\|failed\|fail') |   call matchadd('Search', '\cwarning\|warn')

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