From 652634143a78e262f0e26a10f253d2385fb44a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Mon, 11 Mar 2019 12:58:55 +0100 Subject: Refactor file type configuration to the ftplugin --- .vim/ftplugin/README | 14 ++++++++++++++ .vim/ftplugin/c.vim | 1 + .vim/ftplugin/cpp.vim | 1 + .vim/ftplugin/gitcommit.vim | 1 + .vim/ftplugin/python.vim | 3 +++ .vim/ftplugin/text.vim | 1 + .vim/ftplugin/yaml.vim | 1 + .vimrc | 13 ------------- 8 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 .vim/ftplugin/README create mode 100644 .vim/ftplugin/c.vim create mode 100644 .vim/ftplugin/cpp.vim create mode 100644 .vim/ftplugin/gitcommit.vim create mode 100644 .vim/ftplugin/python.vim create mode 100644 .vim/ftplugin/text.vim create mode 100644 .vim/ftplugin/yaml.vim diff --git a/.vim/ftplugin/README b/.vim/ftplugin/README new file mode 100644 index 0000000..10327fb --- /dev/null +++ b/.vim/ftplugin/README @@ -0,0 +1,14 @@ +To detect file type use + +``` +set ft +``` + +in buffer. + + +You can define your own filetype in .vim/ftdetect directory: + +``` +au BufRead,BufNewFile *[cC]onffile,*.cf set filetype=conffile +``` diff --git a/.vim/ftplugin/c.vim b/.vim/ftplugin/c.vim new file mode 100644 index 0000000..7c98e62 --- /dev/null +++ b/.vim/ftplugin/c.vim @@ -0,0 +1 @@ +set spell spelllang=en diff --git a/.vim/ftplugin/cpp.vim b/.vim/ftplugin/cpp.vim new file mode 100644 index 0000000..7c98e62 --- /dev/null +++ b/.vim/ftplugin/cpp.vim @@ -0,0 +1 @@ +set spell spelllang=en diff --git a/.vim/ftplugin/gitcommit.vim b/.vim/ftplugin/gitcommit.vim new file mode 100644 index 0000000..bea0581 --- /dev/null +++ b/.vim/ftplugin/gitcommit.vim @@ -0,0 +1 @@ +set spell spelllang=en textwidth=80 diff --git a/.vim/ftplugin/python.vim b/.vim/ftplugin/python.vim new file mode 100644 index 0000000..ef4e184 --- /dev/null +++ b/.vim/ftplugin/python.vim @@ -0,0 +1,3 @@ +let b:ale_linters = ['pyls'] + +set expandtab tabstop=4 shiftwidth=4 spell spelllang=en diff --git a/.vim/ftplugin/text.vim b/.vim/ftplugin/text.vim new file mode 100644 index 0000000..7fa0bd3 --- /dev/null +++ b/.vim/ftplugin/text.vim @@ -0,0 +1 @@ +set spell expandtab spelllang=cs diff --git a/.vim/ftplugin/yaml.vim b/.vim/ftplugin/yaml.vim new file mode 100644 index 0000000..510b376 --- /dev/null +++ b/.vim/ftplugin/yaml.vim @@ -0,0 +1 @@ +set expandtab tabstop=2 shiftwidth=2 spell spelllang=en diff --git a/.vimrc b/.vimrc index c98899b..a1ca3bc 100644 --- a/.vimrc +++ b/.vimrc @@ -116,19 +116,6 @@ colorscheme dorticek au BufEnter * match RedundantSpaces /\s\+$\| \+\ze\t/ highlight RedundantSpaces ctermbg=red guibg=red -" ======================= -" autocommand definitions -" ======================= -au BufRead *COMMIT_EDITMSG set spell spelllang=en textwidth=80 -au BufRead *TAG_EDITMSG set spell spelllang=en textwidth=80 -au BufRead *.c set spell spelllang=en -au BufRead *.cpp set spell spelllang=en -au BufRead *.h set spell spelllang=en -au BufRead *.txt set spell expandtab spelllang=cs -au BufRead *.yml set expandtab tabstop=2 shiftwidth=2 spell spelllang=en -au BufRead *.kv set expandtab tabstop=4 shiftwidth=4 spell spelllang=en -au Filetype python setlocal expandtab tabstop=4 shiftwidth=4 spell spelllang=en - " =========== " key hacking " =========== -- cgit v1.2.3