From d5e8135cac05c9508d10e043126e862eece76e06 Mon Sep 17 00:00:00 2001 From: druckdev <63563978+druckdev@users.noreply.github.com> Date: Wed, 23 Sep 2020 01:16:17 +0200 Subject: [PATCH] vim: Move language specific bits into ftplugin/ Move stuff for specific languages executed by autocommands into own filetype plugins to keep the vimrc cleaner. --- .config/vim/ftplugin/gitcommit.vim | 4 ++++ .config/vim/ftplugin/zsh.vim | 2 ++ .config/vim/vimrc | 9 --------- 3 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 .config/vim/ftplugin/gitcommit.vim create mode 100644 .config/vim/ftplugin/zsh.vim diff --git a/.config/vim/ftplugin/gitcommit.vim b/.config/vim/ftplugin/gitcommit.vim new file mode 100644 index 0000000..7fa569f --- /dev/null +++ b/.config/vim/ftplugin/gitcommit.vim @@ -0,0 +1,4 @@ +" Shorter lines. Subject should be max 50 and body max 72 +setlocal colorcolumn=50,72 +" Spell checking always enabled +setlocal spell spelllang=en_us diff --git a/.config/vim/ftplugin/zsh.vim b/.config/vim/ftplugin/zsh.vim new file mode 100644 index 0000000..d1acc99 --- /dev/null +++ b/.config/vim/ftplugin/zsh.vim @@ -0,0 +1,2 @@ +" zshOption is a huge regex that leads to massive lags when scrolling +syntax clear zshOption diff --git a/.config/vim/vimrc b/.config/vim/vimrc index a4509b0..c5d39cb 100644 --- a/.config/vim/vimrc +++ b/.config/vim/vimrc @@ -108,15 +108,6 @@ if (has('nvim')) endif " Autocommands ################################################################# -" Shorter lines in git commits -autocmd filetype gitcommit set colorcolumn=50,72 -" Spell checking in git commits -autocmd filetype gitcommit set spell spelllang=en_us - -" zshOption is a huge regex that leads to massive lags when scrolling -" Be sure to disable it after activating syntax highlighting -autocmd filetype zsh syntax clear zshOption - " Highlight trailing whitespaces " (https://vim.fandom.com/wiki/Highlight_unwanted_spaces) " Create highlight group