Skip to content

Commit c424294

Browse files
author
Adriaan Zonnenberg
committed
set "syntax sync fromstart" by default
Instead of setting it by default, I initially only added this as a tip to the readme, because it is said to be slower. However, I don't really notice a performance difference, and when the highlighting isn't working reliably without it, I think it's better to just include it by default.
1 parent fcdc2d2 commit c424294

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

readme.md

-16
Original file line numberDiff line numberDiff line change
@@ -58,22 +58,6 @@ Therefore you have to replace all your `jade` occurrences with `pug`. The new
5858
plugin for `pug` can be found on [the same repository](https://github.com/digitaltoad/vim-pug)
5959
(the name has already been updated).
6060

61-
### My syntax highlighting stops working randomly
62-
63-
This is because Vim tries to highlight text in an efficient way. Especially in
64-
files that include multiple languages, it can get confused. To work around
65-
this, you can run `:syntax sync fromstart` when it happens.
66-
67-
You can also setup an autocmd for this, so that every time a Vue file is
68-
opened, `:syntax sync fromstart` will be executed pre-emptively:
69-
70-
```vim
71-
autocmd FileType vue syntax sync fromstart
72-
```
73-
74-
See `:h :syn-sync-first` and [this article](http://vim.wikia.com/wiki/Fix_syntax_highlighting)
75-
for more details.
76-
7761
### How to use commenting functionality with multiple languages in Vue files?
7862

7963
#### [tcomment](https://github.com/tomtom/tcomment_vim)

syntax/vue.vim

+2
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ syn keyword htmlSpecialTagName contained template
7373
syn keyword htmlArg contained scoped ts
7474
syn match htmlArg "[@v:][-:.0-9_a-z]*\>" contained
7575

76+
syntax sync fromstart
77+
7678
let b:current_syntax = "vue"

0 commit comments

Comments
 (0)