Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VIM: Certain .c files opening without syntax highlighting

I have some .c files that don't automatically highlight in vim. This problem only recently started. I have not edited my .vimrc file:

set number
nnoremap <F2> :set nonumber!<CR>:set foldcolumn=0<CR>
set ignorecase
syntax on
filetype plugin indent on
nnoremap <C-H> :Hexmode<CR>
inoremap <C-H> <Esc>:Hexmode<CR>
vnoremap <C-H> :<C-U>Hexmode<CR>
au BufWinLeave * mkview
au BufWinEnter * silent loadview
set tabpagemax=15
set wrap

The weird thing is when I open a file that doesn't automatically highlight, and type :set syntax=C, it works, but if I reload my .vimrc file using :so ~/.vimrc the highlighting goes away. This doesn't happen with other .c files.

like image 344
dcpomero Avatar asked Jul 28 '11 17:07

dcpomero


1 Answers

Try to remove all files in ~/.vim/view (eventually make a backup before deleting it).

like image 66
neodelphi Avatar answered Oct 02 '22 20:10

neodelphi