1
One way to go with it is to use the vim syntax highlighting mechanisms to do that. The first thing to do is to add set filetype=cowfortune to your function:
function Cow()
enew
set filetype=cowfortune
setlocal bufhidden=wipe
for line in split(system('ls -l'), '\n')
call append('$', ' ' . l:line)
endfor
setlocal ...
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
highlight × 199syntax-highlighting × 49
search × 28
vimrc × 20
colorscheme × 17
vimscript × 13
color × 12
regular-expression × 11
autocmd × 7
neovim × 6
terminal × 6
folding × 6
key-bindings × 5
command-line × 5
gvim × 5
spell-checking × 4
whitespace × 4
delimiter-matching × 4
cursorline × 4
highlighting × 4
cursor-movement × 3
cursor-motions × 3
statusline × 3
vimdiff × 3
line-numbers × 3