aboutsummaryrefslogtreecommitdiff
path: root/vim.dot.link/filetype.vim
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2024-07-28 09:44:08 -0300
committerSilvio Rhatto <rhatto@riseup.net>2024-07-28 09:44:08 -0300
commit23e4d875310c6520782d1605b8c3909053d58442 (patch)
tree48887e79bfceea13356fbf993c2169c17697d58c /vim.dot.link/filetype.vim
parentcbd12218a4f578b415d5a7da40275ad450e0ec64 (diff)
downloadvim-23e4d875310c6520782d1605b8c3909053d58442.tar.gz
vim-23e4d875310c6520782d1605b8c3909053d58442.tar.bz2
Fix: consolidate filetype handling
Diffstat (limited to 'vim.dot.link/filetype.vim')
-rw-r--r--vim.dot.link/filetype.vim62
1 files changed, 54 insertions, 8 deletions
diff --git a/vim.dot.link/filetype.vim b/vim.dot.link/filetype.vim
index 2b958bc..6401d41 100644
--- a/vim.dot.link/filetype.vim
+++ b/vim.dot.link/filetype.vim
@@ -4,20 +4,66 @@ if exists("did_load_filetypes")
finish
endif
-" markdown filetype file
-
+" Markdown
augroup markdown
- au! BufRead,BufNewFile *.mkd setfiletype mkd
+ " File extensions
+ autocmd!
+ autocmd BufRead,BufNewFile *.md setfiletype markdown
+ autocmd BufRead,BufNewFile *.mkd setfiletype markdown
+ autocmd BufRead,BufNewFile *.md setfiletype markdown
+ autocmd BufRead,BufNewFile *.mdwn setfiletype ikiwiki
+
+ " Markdown configuration
+ "
+ " 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
+ autocmd FileType markdown set foldexpr=NestedMarkdownFolds()
+ autocmd FileType markdown set autoindent smartindent tabstop=2 softtabstop=2 shiftwidth=2 expandtab formatoptions=tcroqn2 comments=n:>
augroup END
-" detect puppet filetypes
+" Python
+augroup python
+ autocmd!
+ autocmd BufRead *.py setfiletype python
+ autocmd FileType python set autoindent smartindent tabstop=4 softtabstop=4 shiftwidth=4 expandtab
+augroup END
-augroup filetypedetect
- au! BufRead,BufNewFile *.pp setfiletype puppet
+" Puppet
+augroup puppet
+ autocmd BufRead,BufNewFile *.pp setfiletype puppet
augroup END
-" detect drupal modules
+" 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
augroup filetypedetect
- au! BufRead,BufNewFile *.module setfiletype php
+ 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