Randy McMurchy wrote: > Randy McMurchy wrote these words on 02/11/13 12:55 CST: >> I just ran my script that cleans up extraneous spaces from blank lines and >> at the end of lines in all the .xml files. > > If you use Vim to edit the book's .xml, you can add the following lines > to your /etc/vimrc file and it will show in red any extraneous spaces in > the .xml. I find it handy as it makes it easy to keep the files clean. > > " Catch trailing whitespace and highlight them > highlight ForbiddenWhitespace ctermbg=red guibg=red > match ForbiddenWhitespace /\s\+$\|\t/ > " Do not highlight spaces at the end of line while typing on that line > autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@<!$/
I use the F<n> keys to turn these things on and off. Here is a simple example in my ~/.vimrc: nnoremap \tnum :set invnumber number?<CR> nmap <F5> \tnum nnoremap \tl :set invlist list?<CR> nmap <F2> \tl For me, F2 turns the list on and off and shows the EOL and makes that trailing whitespace fairly obvious. Of course it only matters in the <screen> sections. -- Bruce -- http://linuxfromscratch.org/mailman/listinfo/blfs-dev FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page