1

I use vim. I have a requirement to use 80 or fewer columns. This fix from Vim 80 column layout concerns works great:

highlight OverLength ctermbg=red ctermfg=white guibg=#592929
match OverLength /\%81v.*/

The first file I open looks fine. But when I

:tabedit some/other/file

some/other/file doesn't have the highlight settings and I have to enter them manually. How do I keep the highlighting settings for files I :tabedit?

Community
  • 1
  • 1
Dave Aaron Smith
  • 4,349
  • 29
  • 37
  • Is: highlight OverLength ctermbg=red ctermfg=white guibg=#592929 match OverLength /\%81v.*/ in your vrc file? – Juan Besa Dec 28 '09 at 20:37

1 Answers1

1

Adding those two lines of code to ~/.vim/after/syntax/syncolor.vim (create if it doesn't exist) does the trick for me.

That's a great snippet, by the way.

ETA: it may be necessary to add this to your .vimrc file:

autocmd BufRead,BufNewFile (pattern) source ~/.vim/after/syntax/syncolor.vim

where (pattern) can be something like /home/foo/bar/**.

Jan Krüger
  • 15,896
  • 3
  • 54
  • 50
  • Thanks! I put those lines in ~/.vim/after/syntax/syncolor.vim and added autocmd BufRead,BufNewFile ** source ~/.vim/after/syntax/syncolor.vim to my ~/.vimrc – Dave Aaron Smith Dec 29 '09 at 17:00