I have a listchars
setting in my .vimrc, which shows some characters, but not all. Sometimes I would like to see it differently. I could map two key combos to the two settings and change between them that way, but it would be better if I could toggle between the two with only one combo. How would that be possible?
Add a comment
|
1 Answer
Something like this:
let lc1='tab:»-,trail:·,nbsp:×,eol:$'
let lc2='tab:<->,trail:X,nbsp:_,eol:/'
function ChgListchars()
if &listchars == g:lc1
let &listchars = g:lc2
else
let &listchars = g:lc1
endif
endfunction
nnoremap <F9> :call ChgListchars()<CR>