Reputation: 1268
I want to have 2 space indents for my .jade files when I edit them in vim. I downloaded config files for .jade processing in vim, but they do not seem to work. All of the folders are located in /home/name/.vim and each folder has jade.vim config files. They do not work though. Do I need to change the main .vimrc in /home/name?
Edit:
autocmd BufRead,BufNewFile *.html setlocal ft=html
autocmd BufRead,BufNewFile *.js setlocal ft=js
autocmd BufRead,BufNewFile *.jade setlocal ft=jade
autocmd BufRead,BufNewFile *.css setlocal ft=css
autocmd FileType html :setlocal sw=2 ts=2 sts=2
autocmd FileType js :setlocal sw=2 ts=2 sts=2
autocmd FileType jade :setlocal sw=2 ts=2 sts=2
autocmd FileType css :setlocal sw=2 ts=2 sts=2
When I use the above, I get the two spaces for a tab for .js files. But, then there is no syntax highlighting (I haven't tried the .html and .css files, but I assume the same would happen). I just want to override the tab spaces for these files but nothing else. The jade file works well, though. Now, the jade file has syntax highlighting.
Upvotes: 2
Views: 1033
Reputation: 40927
If I had to guess, I'd say your .jade
files are not being detected properly and thus not having the jade
filetype set. Try adding the following in your .vimrc
before the other autocmds above.
autocmd BufRead,BufNewFile *.jade setlocal ft=jade
You can also confirm my theory by opening up a .jade
file and running :echo &ft
. If whatever output you get is not jade
then my theory is correct.
Upvotes: 4