From 5a25d075ad3f26bcdc14e39b75c1f893fcc79eef Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 1 Jul 2018 23:51:04 +1200 Subject: Move plugin-specific settings into ~/.vim/plugin Makes way more sense--these files won't get loaded by definition unless plugins are enabled, and dist.vim will still be in time to stop the distributed plugins from loading. --- vim/plugin/dist.vim | 16 ++++++++++++++++ vim/plugin/macros.vim | 5 ----- vim/plugin/matchit.vim | 6 ++++++ vim/vimrc | 27 --------------------------- 4 files changed, 22 insertions(+), 32 deletions(-) create mode 100644 vim/plugin/dist.vim delete mode 100644 vim/plugin/macros.vim create mode 100644 vim/plugin/matchit.vim diff --git a/vim/plugin/dist.vim b/vim/plugin/dist.vim new file mode 100644 index 00000000..53962c93 --- /dev/null +++ b/vim/plugin/dist.vim @@ -0,0 +1,16 @@ +" Skip loading some plugins: +" I manage plugins myself with Git and a Makefile +let g:loaded_getscriptPlugin = 1 +let g:loaded_vimballPlugin = 1 +" Vim is the wrong tool for reading archives or compressed text +let g:loaded_gzip = 1 +let g:loaded_tarPlugin = 1 +let g:loaded_zipPlugin = 1 +" I prefer filtering text with Unix tools +let g:loaded_logiPat = 1 +" The shell, tab completion, and 'wildmenu' are good enough +let g:loaded_netrwPlugin = 1 +" I don't use Vim servers +let g:loaded_rrhelper = 1 +" I don't need extra spelling files +let g:loaded_spellfile_plugin = 1 diff --git a/vim/plugin/macros.vim b/vim/plugin/macros.vim deleted file mode 100644 index 585eedc8..00000000 --- a/vim/plugin/macros.vim +++ /dev/null @@ -1,5 +0,0 @@ -" If we don't have packages (Vim < 8.0), try to load matchit.vim from the -" older macros location in the distributed runtime instead -if !has('packages') - silent! runtime macros/matchit.vim -endif diff --git a/vim/plugin/matchit.vim b/vim/plugin/matchit.vim new file mode 100644 index 00000000..31e6e37d --- /dev/null +++ b/vim/plugin/matchit.vim @@ -0,0 +1,6 @@ +" Get matchit.vim, one way or another +if has('packages') && !has('nvim') + packadd! matchit +else + silent! runtime macros/matchit.vim +endif diff --git a/vim/vimrc b/vim/vimrc index b35c5404..52b1a378 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -264,32 +264,5 @@ nmap x StripTrailingWhitespace " \z sets NZ English spelling (compare \u) nnoremap z :setlocal spelllang=en_nz -" Settings for plugins -if &loadplugins - - " Add packaged matchit.vim, if supported - if has('packages') && !has('nvim') - packadd! matchit - endif - - " Skip loading some plugins: - " I manage plugins myself with Git and a Makefile - let g:loaded_getscriptPlugin = 1 - let g:loaded_vimballPlugin = 1 - " Vim is the wrong tool for reading archives or compressed text - let g:loaded_gzip = 1 - let g:loaded_tarPlugin = 1 - let g:loaded_zipPlugin = 1 - " I prefer filtering text with Unix tools - let g:loaded_logiPat = 1 - " The shell, tab completion, and 'wildmenu' are good enough - let g:loaded_netrwPlugin = 1 - " I don't use Vim servers - let g:loaded_rrhelper = 1 - " I don't need extra spelling files - let g:loaded_spellfile_plugin = 1 - -endif - " Source any .vim files from ~/.vim/config runtime! config/*.vim -- cgit v1.2.3