Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vim: no highlighting at startup

Tags:

vim

I am using vim together with NERDTree and MiniBufExplorer. My colorscheme is peaksea. If I start vim, no syntax is highlighted in the first buffer. The other buffers have syntax highlighted. I have "syntax enable" in my vimrc. If I type :edit the syntax gets highlighted. So I tried

autocmd VimEnter * edit

but still nothing is highlighted. Did anyone encounter a similar problem or has anyone an idea how to fix this?

like image 890
pfnuesel Avatar asked Mar 17 '26 04:03

pfnuesel


1 Answers

I remapped F12 to redo my syntax highlighting in case it gets messed up:

nnoremap <F12> :syntax sync fromstart<cr>

Maybe you can just run it as an autocmd event in your vimrc based on reading a new buffer?

autocmd BufReadPost * :syntax sync fromstart
like image 117
mattb Avatar answered Mar 20 '26 07:03

mattb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!