So recently I noticed my
autocmd FileType python setlocal foldmethod=indent is not working anymore. The version for my vim is 8.2
When I open a python file everything is working fine except the folding and
setlocal foldmethod? returns
verbose set ft? returns
filetype=python Last set from /usr/share/vim/vim82/filetype.vim line 1364
Which from this autocmd
au BufNewFile,BufRead *.py,*.pyw,.pythonstartup,.pythonrc setf python
verbose setlocal foldmethod? returns just
foldmethod=manual and not where it is last set.
set verbose=9 I do find the autocmd triggered and nothing else that sets the foldmethod.
Executing FileType Autocommands for "python" autocommand setlocal foldmethod=indent
Anything else I can check?
edit: I found the culprit
The problem was a faulty autocmd in my vimrc.
let g:my_coc_file_types = ['vim', 'sh', 'python', 'tex'] autocmd FileType * if index(g:my_coc_file_types, &filetype) == -1 | let b:coc_enabled=0
that has to end with
So the why and the how? Is that still an interesting question to be answered?