1

I'd like to have syntax highlighting on files with the .ott extension (using ott-vim), but I am not getting any colors when opening a file, even though filetype=ott is set. Re-setting set filetype=ott manually does enable the colors again.

Oddly enough, I also get colors on file opening when I change the extension in ftdetect/ott.vim to something other than *.ott.

Is there something special about the *.ott extension, or some clash with another file format?

au BufRead,BufNewFile *.ott set filetype=ott
" a.ott does not get highlighted
" Replace *.ott with *.ot, then a.ot gets highlighted
Li-yao Xia
  • 31,896
  • 2
  • 33
  • 56
  • The plugin seems to work fine in 9.0.54, 8.2.4113, and 8.2.3455 so the autocommand in `ftdetect/ott.vim` is fine. Your problem is thus elsewhere and you should use their issue tracker. – romainl Jul 18 '22 at 05:34
  • I don't doubt the cause could be specific to my config and to ott, but advice on how to debug autocmd issues would still be helpful, which doesn't have to be specific to my situation. If I knew how to troubleshoot this I wouldn't be asking the question. – Li-yao Xia Jul 18 '22 at 08:54
  • I am not sure what you want. "How to troubleshoot possible autocommand-related issues?" is a very different question than the one you asked. – romainl Jul 18 '22 at 09:11
  • https://vi.stackexchange.com – Rob Jul 18 '22 at 10:19

1 Answers1

2

This is a conflict with the zipPlugin that is distributed with vim (/usr/share/vim/current/plugin/zipPlugin.vim), and which recognizes a .ott file as a zip archive. Hacky fix to remove that extension from those recognized by zipPlugin:

" ~/.vimrc
let g:zipPlugin_ext='*.zip' 
Li-yao Xia
  • 31,896
  • 2
  • 33
  • 56