When I execute Rmodel, Rcontroller and others in Vim. I see only white text.
But when I go to next buffer and then go back by :bn and :bl, colors are working.
This is my .vim folder https://github.com/regedarek/dotvim
When I execute Rmodel, Rcontroller and others in Vim. I see only white text.
But when I go to next buffer and then go back by :bn and :bl, colors are working.
This is my .vim folder https://github.com/regedarek/dotvim
Use :syntax sync fromstart
I got that tip from http://vim.wikia.com/wiki/Fix_syntax_highlighting
That article also suggests creating a mapping for that command e.g. to map F12:
noremap <F12> <Esc>:syntax sync fromstart<CR>
inoremap <F12> <C-o>:syntax sync fromstart<CR>
autocmd BufEnter,InsertLeave * :syntax sync fromstart to force a syntax sync after I enter a buffer. The syntax sync is also triggered when there's an InsertLeave event happening.filetype=sh or syntax=sh for bash and like, not bash. Took me sometime to figure that one out.:do Syntax equivalent of :doautocmd Syntax which is just a little shorter so you don't have to bind it (at least I don't have to call this command that often so I just type it). I mostly use it in some files that contain regexes which cause the syntax highlight to break when I open the file via netrw.Try:
:e
If you have no unsaved changes to the file.
Or:
:syn off | syn on
nmap <F6> :Rmodel|e<CR>gg``:syn off | syn on changes the colourscheme for me, which is annoyingSometimes syntax is OK, but all that is getting broken are foldings. In that case zx helps alot.
From VIM documentation:
zx
Update folds: Undo manually opened and closed folds: re-apply 'foldlevel', then do "zv": View cursor line. Also forces recomputing folds. This is useful when using 'foldexpr' and the buffer is changed in a way that results in folds not to be updated properly.
Another option is:
doautocmd Syntax
syntax sync fromstart did nothing, nor did anything else!):do SyntaxYou can also try:
CTRL-L
From the VIM docs (:h CTRL-L):
Clear and redraw the screen. The redraw may happen later, after processing typeahead.