From 0ec73d6242582783ae1a9d457dfe04a5bc852199 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 30 Oct 2017 11:48:42 +1300 Subject: Move vim/after/ftplugin files into vim/ftplugin None of the settings in here need to be run after the core configuration files are loaded, so I'll put them in a slightly more accessible or logical place. This adds a new target `install-vim-ftplugin`, and makes that a prerequisite of the `install-vim` target. --- Makefile | 6 ++++++ vim/after/ftplugin/html.vim | 11 ----------- vim/after/ftplugin/mail.vim | 2 -- vim/after/ftplugin/perl.vim | 6 ------ vim/after/ftplugin/sh.vim | 11 ----------- vim/after/ftplugin/vim.vim | 4 ---- vim/ftplugin/html.vim | 11 +++++++++++ vim/ftplugin/mail.vim | 2 ++ vim/ftplugin/perl.vim | 6 ++++++ vim/ftplugin/sh.vim | 11 +++++++++++ vim/ftplugin/vim.vim | 4 ++++ 11 files changed, 40 insertions(+), 34 deletions(-) delete mode 100644 vim/after/ftplugin/html.vim delete mode 100644 vim/after/ftplugin/mail.vim delete mode 100644 vim/after/ftplugin/perl.vim delete mode 100644 vim/after/ftplugin/sh.vim delete mode 100644 vim/after/ftplugin/vim.vim create mode 100644 vim/ftplugin/html.vim create mode 100644 vim/ftplugin/mail.vim create mode 100644 vim/ftplugin/perl.vim create mode 100644 vim/ftplugin/sh.vim create mode 100644 vim/ftplugin/vim.vim diff --git a/Makefile b/Makefile index 3d04f3de..455a69d4 100644 --- a/Makefile +++ b/Makefile @@ -40,6 +40,7 @@ install-vim-bundle \ install-vim-config \ install-vim-ftdetect \ + install-vim-ftplugin \ install-vim-gui \ install-vim-gui-config \ install-vim-indent \ @@ -467,6 +468,7 @@ install-urxvt: urxvt/ext/select install-vim: install-vim-bundle \ install-vim-config \ install-vim-ftdetect \ + install-vim-ftplugin \ install-vim-indent install-vim-bundle: install-vim-config @@ -483,6 +485,10 @@ install-vim-ftdetect: mkdir -p -- $(HOME)/.vim/ftdetect cp -p -- vim/ftdetect/*.vim $(HOME)/.vim/ftdetect +install-vim-ftplugin: + mkdir -p -- $(HOME)/.vim/ftplugin + cp -p -- vim/ftplugin/*.vim $(HOME)/.vim/ftplugin + install-vim-indent: mkdir -p -- $(HOME)/.vim/indent cp -p -- vim/indent/*.vim $(HOME)/.vim/indent diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim deleted file mode 100644 index 38b71656..00000000 --- a/vim/after/ftplugin/html.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Run tidy -eq -utf8 on file for the current buffer -nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) - -" Make a bare URL into a link to itself -function! UrlLink() - normal yiW - execute "normal i0\">\" - normal E - execute "normal a\" -endfunction -nnoremap r :call UrlLink() diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim deleted file mode 100644 index 35432b96..00000000 --- a/vim/after/ftplugin/mail.vim +++ /dev/null @@ -1,2 +0,0 @@ -" Use trailing whitespace to denote continued paragraph -setlocal formatoptions+=w diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim deleted file mode 100644 index dad2ce35..00000000 --- a/vim/after/ftplugin/perl.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Run perl -c on file for the current buffer -nnoremap pc :exe "!perl -c " . shellescape(expand("%")) -" Run perlcritic on the file for the current buffer -nnoremap pl :exe "!perlcritic " . shellescape(expand("%")) -" Run the current buffer through perltidy -nnoremap pt :%!perltidy diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim deleted file mode 100644 index 2b73611e..00000000 --- a/vim/after/ftplugin/sh.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Default to POSIX shell, as I never write Bourne, and if I write Bash or Ksh -" it'll be denoted with either a shebang or an appropriate extension. At the -" time of writing, changing this also prompts sh.vim to set g:is_kornshell, -" which is absurd, and requires a bit more massaging in after/syntax/sh.vim to -" turn off some unwanted stuff. -let g:is_posix = 1 - -" Use han(1df) as a man(1) wrapper for Bash files if available -if exists('b:is_bash') && executable('han') - setlocal keywordprg=han -endif diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim deleted file mode 100644 index b958fe54..00000000 --- a/vim/after/ftplugin/vim.vim +++ /dev/null @@ -1,4 +0,0 @@ -" Observe VimL conventions for two-space indents -setlocal shiftwidth=2 -setlocal softtabstop=2 -setlocal tabstop=2 diff --git a/vim/ftplugin/html.vim b/vim/ftplugin/html.vim new file mode 100644 index 00000000..38b71656 --- /dev/null +++ b/vim/ftplugin/html.vim @@ -0,0 +1,11 @@ +" Run tidy -eq -utf8 on file for the current buffer +nnoremap v :exe "!tidy -eq -utf8 " . shellescape(expand("%")) + +" Make a bare URL into a link to itself +function! UrlLink() + normal yiW + execute "normal i0\">\" + normal E + execute "normal a\" +endfunction +nnoremap r :call UrlLink() diff --git a/vim/ftplugin/mail.vim b/vim/ftplugin/mail.vim new file mode 100644 index 00000000..35432b96 --- /dev/null +++ b/vim/ftplugin/mail.vim @@ -0,0 +1,2 @@ +" Use trailing whitespace to denote continued paragraph +setlocal formatoptions+=w diff --git a/vim/ftplugin/perl.vim b/vim/ftplugin/perl.vim new file mode 100644 index 00000000..dad2ce35 --- /dev/null +++ b/vim/ftplugin/perl.vim @@ -0,0 +1,6 @@ +" Run perl -c on file for the current buffer +nnoremap pc :exe "!perl -c " . shellescape(expand("%")) +" Run perlcritic on the file for the current buffer +nnoremap pl :exe "!perlcritic " . shellescape(expand("%")) +" Run the current buffer through perltidy +nnoremap pt :%!perltidy diff --git a/vim/ftplugin/sh.vim b/vim/ftplugin/sh.vim new file mode 100644 index 00000000..2b73611e --- /dev/null +++ b/vim/ftplugin/sh.vim @@ -0,0 +1,11 @@ +" Default to POSIX shell, as I never write Bourne, and if I write Bash or Ksh +" it'll be denoted with either a shebang or an appropriate extension. At the +" time of writing, changing this also prompts sh.vim to set g:is_kornshell, +" which is absurd, and requires a bit more massaging in after/syntax/sh.vim to +" turn off some unwanted stuff. +let g:is_posix = 1 + +" Use han(1df) as a man(1) wrapper for Bash files if available +if exists('b:is_bash') && executable('han') + setlocal keywordprg=han +endif diff --git a/vim/ftplugin/vim.vim b/vim/ftplugin/vim.vim new file mode 100644 index 00000000..b958fe54 --- /dev/null +++ b/vim/ftplugin/vim.vim @@ -0,0 +1,4 @@ +" Observe VimL conventions for two-space indents +setlocal shiftwidth=2 +setlocal softtabstop=2 +setlocal tabstop=2 -- cgit v1.2.3