我希望对具有.ott扩展名的文件进行语法高亮显示(使用奥特-维姆),但在打开文件时不会得到任何颜色,即使设置了filetype=ott。手动重新设置set filetype=ott确实再次启用了颜色。
奇怪的是,当我将ftdetect/ott.vim中的扩展名更改为*.ott以外的内容时,文件打开时也会出现颜色。
*.ott扩展名有什么特殊之处,还是与其他文件格式有冲突?
au BufRead,BufNewFile *.ott set filetype=ott
" a.ott does not get highlighted
" Replace *.ott with *.ot, then a.ot gets highlighted发布于 2022-07-20 16:43:18
这与使用vim (/usr/share/vim/current/plugin/zipPlugin.vim)分发的/usr/share/vim/current/plugin/zipPlugin.vim冲突,并将.ott文件识别为zip存档。将该扩展从zipPlugin识别的扩展中删除
" ~/.vimrc
let g:zipPlugin_ext='*.zip' https://stackoverflow.com/questions/73015643
复制相似问题