如何让Vim识别Podfile和podspec文件(一些没有扩展名的文件)为ruby文件,这样vim就可以进行语法高亮。
oogrdqng1#
将此添加到.vimrc:
.vimrc
autocmd BufNewFile,BufRead Podfile,*.podspec set filetype=ruby
这一行指示Vim将Podfiles和扩展名为.podspec的文件视为Ruby文件,以便它们继承Ruby语法突出显示。
Podfiles
.podspec
gk7wooem2#
对于NeoVim / Lua:
local auto_command_on = vim.api.nvim_create_autocmd auto_command_on({ "BufRead", "BufNewFile" }, { pattern = { "*.podspec", "Podfile" }, command = "set filetype=ruby", })
当你打开/创建一个“.podspec”或“Podfile”时,neovim会将该文件视为ruby文件
2条答案
按热度按时间oogrdqng1#
将此添加到
.vimrc
:这一行指示Vim将
Podfiles
和扩展名为.podspec
的文件视为Ruby文件,以便它们继承Ruby语法突出显示。gk7wooem2#
对于NeoVim / Lua:
当你打开/创建一个“.podspec”或“Podfile”时,neovim会将该文件视为ruby文件