Here is a sample of my .vimrc, that doesn't do a thing (the autocmd does not work) when I open a .md or .tex file, but works fine for .py files:
augroup filetype_python autocmd FileType python nnoremap <buffer> <localleader>c I#<esc> autocmd FileType python set nu autocmd FileType python :iabbrev <buffer> iff if:<left> autocmd FileType python :iabbrev <buffer> forr for:<left> autocmd FileType python :iabbrev <buffer> while while:<left> autocmd BufWritePre,BufRead *.py :normal gg=G augroup END augroup filetype_tex autocmd FileType tex set nu augroup END augroup filetype_markdown autocmd FileType markdown onoremap i= :<c-u>execute "normal! ?^==\\+$\r:nohlsearch\rkvg_"<cr> autocmd FileType markdown onoremap i- :<c-u>execute "normal! ?^--\\+$\r:nohlsearch\rkvg_"<cr> augroup END
As if Vim didn't know about markdown and tex (but it's supposed to, I checked the list of all known FileTypes and they were there)... Any ideas ?
Thanks in advance !