Razor .cshtml syntax highlighting for vim?

2019-04-03 19:20发布

I'm looking for a .cshtml vim syntax file. Are there any projects that haven't made it to www.vim.org?

5条回答
我命由我不由天
2楼-- · 2019-04-03 19:47

Settled with adding this to .vimrc

" add html syntax to dotnet razor files
autocmd BufNewFile,BufRead *.cshtml set syntax=html
查看更多
乱世女痞
3楼-- · 2019-04-03 19:51

this guy has razor support planned, but is not yet there. However, it does add some features to the existing c# support. https://github.com/OrangeT/vim-csharp

查看更多
狗以群分
4楼-- · 2019-04-03 19:51

Russ Martinez (or maybe Daniel Dabrowski's) cshtml.vim file seems to be a candidate. It's not perfect, but at least it's a start. https://bitbucket.org/rod/dotfiles/src/8aaae8635165/vim/syntax/cshtml.vim

查看更多
我只想做你的唯一
5楼-- · 2019-04-03 19:52

":setf html" solves the 80% part :)

查看更多
6楼-- · 2019-04-03 19:59

You can find nice vim-razor plugin in https://github.com/adamclerk/vim-razor

$ cd ~/.vim/bundle
$ git clone https://github.com/adamclerk/vim-razor
查看更多
登录 后发表回答