mirror of
https://github.com/posva/vim-vue.git
synced 2025-12-16 14:07:06 +08:00
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.
This commit is contained in:
16
readme.md
16
readme.md
@@ -58,22 +58,6 @@ Therefore you have to replace all your `jade` occurrences with `pug`. The new
|
|||||||
plugin for `pug` can be found on [the same repository](https://github.com/digitaltoad/vim-pug)
|
plugin for `pug` can be found on [the same repository](https://github.com/digitaltoad/vim-pug)
|
||||||
(the name has already been updated).
|
(the name has already been updated).
|
||||||
|
|
||||||
### My syntax highlighting stops working randomly
|
|
||||||
|
|
||||||
This is because Vim tries to highlight text in an efficient way. Especially in
|
|
||||||
files that include multiple languages, it can get confused. To work around
|
|
||||||
this, you can run `:syntax sync fromstart` when it happens.
|
|
||||||
|
|
||||||
You can also setup an autocmd for this, so that every time a Vue file is
|
|
||||||
opened, `:syntax sync fromstart` will be executed pre-emptively:
|
|
||||||
|
|
||||||
```vim
|
|
||||||
autocmd FileType vue syntax sync fromstart
|
|
||||||
```
|
|
||||||
|
|
||||||
See `:h :syn-sync-first` and [this article](http://vim.wikia.com/wiki/Fix_syntax_highlighting)
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
### How to use commenting functionality with multiple languages in Vue files?
|
### How to use commenting functionality with multiple languages in Vue files?
|
||||||
|
|
||||||
#### [tcomment](https://github.com/tomtom/tcomment_vim)
|
#### [tcomment](https://github.com/tomtom/tcomment_vim)
|
||||||
|
|||||||
@@ -73,4 +73,6 @@ syn keyword htmlSpecialTagName contained template
|
|||||||
syn keyword htmlArg contained scoped ts
|
syn keyword htmlArg contained scoped ts
|
||||||
syn match htmlArg "[@v:][-:.0-9_a-z]*\>" contained
|
syn match htmlArg "[@v:][-:.0-9_a-z]*\>" contained
|
||||||
|
|
||||||
|
syntax sync fromstart
|
||||||
|
|
||||||
let b:current_syntax = "vue"
|
let b:current_syntax = "vue"
|
||||||
|
|||||||
Reference in New Issue
Block a user