Friday, June 30, 2006

highligting tabs and trailing spaces

Add the following to .vimrc:

highlight SpecialKey ctermfg=DarkGray
set listchars=tab:»-,trail:~
set list


That makes something like that:

map <silent> <F7> :exec ":e ".(expand("%") =~ ".h$"
\ ? glob(substitute(expand("%"), ".h$", ".cpp", ""))
\ : substitute(expand("%"), "\\.cpp$", ".h", ""));<CR>

to be displayed that way:
map <silent> <F7> :exec ":e ".(expand("%") =~ ".h$"~
»-------\»------? glob(substitute(expand("%"), ".h$", ".cpp", ""))
»-------\»------: substitute(expand("%"), "\\.cpp$", ".h", ""))<CR>


Tabs are now plainly visible and also public enemy trailing space on first line became apparent.

P.S. Nice character '»' requires set encoding=utf-8. That looks great with "Andale Mono" and "Black Bold" color set in PuTTY to (39,39,39).

Edit1:

to

No comments: