Reset Vim syntax highlighting
Ever got irritated when Vim fails to properly highlight syntax in complex file opened in the middle? For example, when you re-open HTML file with a huge <script>
block, and Vim doesn't know that it is script, because its begining is far, far away:
It is very annoying to scrool up and back down to make Vim catch it! No need to do this anymore! This SO answer reveals the fix:
:syn sync fromstart
...aaand....
So, why not make a map in your vimrc?
nmap <C-s> :syn sync fromstart<CR>
Now Control+S will Sync your Syntax.
Read that SO answer for more details on this command.
Written by Ivan Novikov
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#