" Vim support file to detect file types if exists("did_load_filetypes") finish endif " Markdown augroup markdown " Markdown configuration without vim-markdown plugin " " Include folding setup: " https://github.com/masukomi/vim-markdown-folding " " Alternative folding method: " https://codereview.stackexchange.com/questions/202620/vim-plugin-for-folding-markdown-lists " " Seem like this things should be set during BufRead or BufNewFile; they're " not working when set during the FileType event. autocmd! autocmd BufRead,BufNewFile *.md set filetype=markdown foldexpr=NestedMarkdownFolds() autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:> autocmd BufRead,BufNewFile *.mdwn set filetype=ikiwiki foldexpr=NestedMarkdownFolds() " Markdown configuration with vim-markdown plugin "autocmd! "autocmd BufRead,BufNewFile *.md set autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:> "let g:vim_markdown_new_list_item_indent = 2 "let g:vim_markdown_folding_style_pythonic = 1 "let g:vim_markdown_folding_level = 1 "let g:vim_markdown_auto_insert_bullets = 0 "let g:vim_markdown_new_list_item_indent = 0 augroup END " Python augroup python autocmd! autocmd BufRead *.py setfiletype python autocmd FileType python set autoindent smartindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab augroup END " Puppet augroup puppet autocmd! autocmd BufRead,BufNewFile *.pp setfiletype puppet augroup END " PHP augroup php autocmd! autocmd BufRead,BufNewFile *.php setfiletype php autocmd FileType php let php_sql_query=1 augroup END " Drupal *.module and *.install files. if has("autocmd") augroup module autocmd! autocmd BufRead,BufNewFile *.profile setfiletype php autocmd BufRead,BufNewFile *.module setfiletype php autocmd BufRead,BufNewFile *.install setfiletype php autocmd BufRead,BufNewFile *.test setfiletype php augroup END endif " Mail " " Workaround for mail editing. There must be a plugin enabling autoindent in " mail composition, which is annoying. augroup mail autocmd! autocmd FileType mail set noautoindent augroup END " Other filetypes " " According to ":help BufRead", this augroup is also evaluated also on " ":filetype detect". augroup filetypedetect autocmd! autocmd BufRead,BufNewFile kvmxfile setfiletype sh autocmd BufRead,BufNewFile Vagrantfile setfiletype ruby autocmd BufRead,BufNewFile *.vue setfiletype html autocmd BufRead,BufNewFile *.thtml setfiletype php autocmd BufRead,BufNewFile *.rem setfiletype remind autocmd BufRead,BufNewFile *.trac setfiletype tracwiki autocmd BufRead,BufNewFile *.tracwiki setfiletype tracwiki augroup END