开发者

Vim language support issues for web development

开发者 https://www.devze.com 2023-01-14 04:21 出处:网络
I am trying to use Vim for web development but having trouble dealing with multiple languages in the same file.I may have php, html, javascript, and css all in the same file, but Vim will base the ind

I am trying to use Vim for web development but having trouble dealing with multiple languages in the same file. I may have php, html, javascript, and css all in the same file, but Vim will base the indentation, coloring, plugins, etc. just based on one of the languages.

Know of any plugins or vimrc hacks to fix th开发者_如何学运维is? Thanks.


You can use the dotted 'filetype' syntax. For example, you can :set ft=html.php when you are working on a file containing both HTML and PHP code. I personally do this to activate snipMate's HTML and PHP snippets for the file being edited.


I am trying to use Vim for web development but having trouble dealing with multiple languages in the same file.

I have never tried that myself, but official VIM Wiki has the dedicate article for that: Different syntax highlighting within regions of a file.

0

精彩评论

暂无评论...
验证码 换一张
取 消