Move filetype-related Vim hooks to separate files
authorSergey Matveev <stargrave@stargrave.org>
Mon, 2 Sep 2019 09:27:31 +0000 (12:27 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 2 Sep 2019 09:33:33 +0000 (12:33 +0300)
vim/.vim/ftdetect/conf.vim [new file with mode: 0644]
vim/.vim/ftdetect/python.vim [new file with mode: 0644]
vim/.vim/ftdetect/sql.vim [new file with mode: 0644]
vim/.vim/ftdetect/tex.vim [new file with mode: 0644]
vim/.vim/ftplugin/gitcommit/spell.vim [new file with mode: 0644]
vim/.vim/ftplugin/gitcommit/tw.vim [new file with mode: 0644]
vim/.vim/ftplugin/go/autos.vim
vim/.vim/ftplugin/texinfo/autos.vim [new file with mode: 0644]
vim/.vim/ftplugin/yaml/sw.vim [new file with mode: 0644]
vim/.vim/plugin/killsig.vim
vim/.vimrc

diff --git a/vim/.vim/ftdetect/conf.vim b/vim/.vim/ftdetect/conf.vim
new file mode 100644 (file)
index 0000000..9345bbd
--- /dev/null
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile *.conf setlocal noexpandtab
diff --git a/vim/.vim/ftdetect/python.vim b/vim/.vim/ftdetect/python.vim
new file mode 100644 (file)
index 0000000..182a76e
--- /dev/null
@@ -0,0 +1 @@
+autocmd BufRead,BufNewFile *.pyi setlocal filetype=python
diff --git a/vim/.vim/ftdetect/sql.vim b/vim/.vim/ftdetect/sql.vim
new file mode 100644 (file)
index 0000000..d8b8b37
--- /dev/null
@@ -0,0 +1 @@
+autocmd BufRead /tmp/psql.edit* setlocal filetype=sql
diff --git a/vim/.vim/ftdetect/tex.vim b/vim/.vim/ftdetect/tex.vim
new file mode 100644 (file)
index 0000000..19517da
--- /dev/null
@@ -0,0 +1,3 @@
+autocmd BufNewFile,BufRead *.tex abbreviate framedo \begin{frame}<CR>\frametitle{TODO}<CR>\end{frame}<ESC>k>>wwlcw
+autocmd BufNewFile,BufRead *.tex abbreviate itemdo \begin{itemize}<CR>\item <CR>\end{itemize}<ESC>k>>$a
+autocmd BufNewFile,BufRead *.tex abbreviate cnter \begin{center}<CR>\end{center}<ESC>k$o
diff --git a/vim/.vim/ftplugin/gitcommit/spell.vim b/vim/.vim/ftplugin/gitcommit/spell.vim
new file mode 100644 (file)
index 0000000..2ffef3c
--- /dev/null
@@ -0,0 +1 @@
+setlocal spell spelllang=ru,en_gb
diff --git a/vim/.vim/ftplugin/gitcommit/tw.vim b/vim/.vim/ftplugin/gitcommit/tw.vim
new file mode 100644 (file)
index 0000000..446f25e
--- /dev/null
@@ -0,0 +1 @@
+setlocal textwidth=72
index e5023b10014c883869b44cb4537f83bfcbc879c2..faad3c9728cef8e5e50dd693988f04fcd1a1c239 100644 (file)
@@ -1,2 +1,5 @@
+set noexpandtab
+let g:defsplit_shift=" "
+
 let @e = "^iif err = \eA; err != nil {\eo        "
 let @r = "oif err != nil {\r}\eO "
diff --git a/vim/.vim/ftplugin/texinfo/autos.vim b/vim/.vim/ftplugin/texinfo/autos.vim
new file mode 100644 (file)
index 0000000..d8a2d8a
--- /dev/null
@@ -0,0 +1 @@
+abbreviate \t @tab
diff --git a/vim/.vim/ftplugin/yaml/sw.vim b/vim/.vim/ftplugin/yaml/sw.vim
new file mode 100644 (file)
index 0000000..6f78fab
--- /dev/null
@@ -0,0 +1 @@
+setlocal shiftwidth=2
index d85742562c297e5876938a5ca855471cfbc4a700..d106b42111c9e096aed707d317e6404979bbb05e 100644 (file)
@@ -7,3 +7,4 @@ function! s:KillSignature()
 endfunction
 
 autocmd BufRead /tmp/mutt-* call s:KillSignature()
+autocmd BufRead /tmp/mutt-* setlocal textwidth=72
index 6d0607aa01ffbb1fceacfb3524717a17b723fa21..516e6701071ac61ce07fa3a2fb203e7e347b8633 100644 (file)
@@ -118,18 +118,6 @@ set formatoptions+=n
 " }}}
 
 autocmd BufEnter * let &titlestring = expand("%:t")
-autocmd BufRead /tmp/mutt-* setlocal textwidth=72
-autocmd BufRead,BufNewFile *.pyi setlocal filetype=python
-autocmd BufRead,BufNewFile *.conf setlocal noexpandtab
-autocmd BufRead,BufNewFile *.go setlocal noexpandtab
-autocmd BufRead,BufNewFile *.go let g:defsplit_shift=" "
-autocmd BufNewFile,BufRead *.tex abbreviate framedo \begin{frame}<CR>\frametitle{TODO}<CR>\end{frame}<ESC>k>>wwlcw
-autocmd BufNewFile,BufRead *.tex abbreviate itemdo \begin{itemize}<CR>\item <CR>\end{itemize}<ESC>k>>$a
-autocmd BufNewFile,BufRead *.tex abbreviate cnter \begin{center}<CR>\end{center}<ESC>k$o
-autocmd Filetype texinfo abbreviate \t @tab
-autocmd Filetype gitcommit setlocal textwidth=72
-autocmd BufRead /tmp/psql.edit* setlocal filetype=sql
-autocmd Filetype yaml setlocal shiftwidth=2
 
 set keywordprg=