Syntax highlight for Sass is not working in Vim

2019-04-11 00:19发布

I just downloaded a Vim plugin for Sass syntax highlight.

The instructions say:

install details put it into syntax directory and add sass filetype

au! BufRead,BufNewFile *.sass
setfiletype sass

in your filetype.vim

I already placed sass.vim in vimfiles/syntax/ (using windows).

And created a filetype.vim file with the code above (au! Buf...) in all the following directories:

  • vimfiles/
  • vimfiles/ftdetect
  • vimfiles/ftplugins

but no one worked (I even typed the au! Buf... code in my vimrc).

My .sass files still looking like this:

alt text http://img193.imageshack.us/img193/4791/sassi.png

any suggestions?

1条回答
forever°为你锁心
2楼-- · 2019-04-11 00:31

I don't know an easy fix, but try checking some vim settings with the following commands:

  • Does enabling syntax explicitly fix your problem? :syntax enable
  • Is filetype detection on? :filetype
  • Does vim recognize this as a sass file? :set filetype?
  • Check to make sure your script directories are in the runtime path :set runtimepath?
  • Does manually loading the syntax file change anything? :runtime! vimfiles/syntax/sass.vim
  • Also check if syntax highlighting works for other filetypes.
查看更多
登录 后发表回答