Joh*_*han 12 vim syntax-highlighting arduino
如何让 vim 自动在 Arduino 文件 (.ino/.pde) 上应用 c++ 语法高亮?
或者vim语法高亮怎么知道什么是c++文件?我怎么能告诉他被称为 .ino 和 .pde 的文件也是 c++ 文件。
Tho*_*hor 17
将这样的内容添加到~/.vimrc:
autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp
Run Code Online (Sandbox Code Playgroud)
或者更准确地说,到~/.vim/ftdetect/cpp.vim.