Quantcast
Channel: syntax – Gea-Suan Lin's BLOG
Viewing all articles
Browse latest Browse all 10

Vim 的 syntax highlight 消失問題

$
0
0

算是個困擾頗久的問題,Vim 或是 Neovim 有時候 syntax highlight 會消失,通常是檔案比較大的時候會遇到,看起來像是 syntax highlight 演算法會從現在的位置往前一段距離開始掃,而非從頭掃所造成的。

剛好在 Plurk 上面有跟朋友討論到,在 https://www.plurk.com/p/3gf2e59yck 這邊可以看到對應的討論。

先說目前的解法是用 syntax sync fromstart,我是加到 .vimrc 裡面,在 BufEnter 的時候跑 (這邊拿 Neovim 的文件說明連結來用):

autocmd BufEnter * syntax sync fromstart

從字句的意思就可以看出來是從頭掃,但缺點就是對於比較大的檔案會開的比較慢...


Viewing all articles
Browse latest Browse all 10

Trending Articles