I'll be editing some .less files. Now, I want the filetype to be "less", but I want vim to do all inclusions of css and css3 plugins when opening a .less file.

There are times I'd like to be able to do this that may be less obvious as well, but if we can figure out the best method for this particular case, I can modify the technique for what I need.

Thoughts?

Thanks!

有帮助吗?

解决方案

To "inherit" filetype settings from another filetype, use this as a starting point; you can add customizations after it. Place it at ~/.vim/ftplugin/less.vim:

if exists('b:did_ftplugin') | finish | endif

runtime! ftplugin/css.vim
runtime! ftplugin/css_*.vim ftplugin/css/*.vim
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top