From eb97e0710ca1dee99cba8f5c44d80b84b0310a62 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 19:52:37 +1300 Subject: Wrap Vim gitcommit autocmd clear in :execute Noticed that my b:undo_ftplugin script for this filetype was only getting halfway through its work, and stopping at this command. From `:help autocmd`: > Note: The ":autocmd" command can only be followed by another command when the > '|' appears before {cmd}. This works: > :augroup mine | au! BufRead | augroup END > But this sees "augroup" as part of the defined command: > :augroup mine | au! BufRead * | augroup END > :augroup mine | au BufRead * set tw=70 | augroup END > Instead you can put the group name into the command: > :au! mine BufRead * > :au mine BufRead * set tw=70 > Or use :execute: > :augroup mine | exe "au! BufRead *" | augroup END > :augroup mine | exe "au BufRead * set tw=70" | augroup END --- vim/after/ftplugin/gitcommit.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 2dc5fa37..0ba80c92 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -14,7 +14,7 @@ if has('autocmd') && exists('+cursorcolumn') autocmd CursorMoved,CursorMovedI \ let &l:colorcolumn = gitcommit#CursorColumn() augroup END - let b:undo_ftplugin .= '|autocmd! gitcommit' + let b:undo_ftplugin .= '|execute ''autocmd! gitcommit''' \ . '|augroup! gitcommit' endif -- cgit v1.2.3 From 59a0e5e3201c6041d3ca3da8efcb6e2b2b81fedd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 19:54:49 +1300 Subject: Restore value of 'colorcolumn' after ft=gitcommit --- vim/after/ftplugin/gitcommit.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 0ba80c92..18bacfb8 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -16,6 +16,7 @@ if has('autocmd') && exists('+cursorcolumn') augroup END let b:undo_ftplugin .= '|execute ''autocmd! gitcommit''' \ . '|augroup! gitcommit' + \ . '|setlocal colorcolumn<' endif " Stop here if the user doesn't want ftplugin mappings -- cgit v1.2.3 From 653b5bee4391d74be53b10b31ab39ba16411e63f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 19:57:10 +1300 Subject: Abbreviate Vim ft=html autocmd clearing --- vim/after/ftplugin/html.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 759d06bf..821ba280 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -16,7 +16,7 @@ augroup html_timestamp \| call html#TimestampUpdate() \|endif augroup END -let b:undo_ftplugin .= '|autocmd! html_timestamp BufWritePre ' +let b:undo_ftplugin .= '|autocmd! html_timestamp' " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_html_maps') -- cgit v1.2.3 From 46f7b5b6413c28b8d1ddbe9b9abe59d88a7ee153 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 19:58:05 +1300 Subject: Add timestamp augroup clearing to Vim ft=html --- vim/after/ftplugin/html.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 821ba280..46282f7f 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -17,6 +17,7 @@ augroup html_timestamp \|endif augroup END let b:undo_ftplugin .= '|autocmd! html_timestamp' + \ . '|augroup! htmltimestamp' " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_html_maps') -- cgit v1.2.3 From c921c0d016c9d52c74083baecde1e0fe0e2e61eb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 19:58:32 +1300 Subject: Wrap autocmd! clear for ft=mail in :execute See commit 0748687. --- vim/after/ftplugin/html.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 46282f7f..29128c03 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -16,8 +16,8 @@ augroup html_timestamp \| call html#TimestampUpdate() \|endif augroup END -let b:undo_ftplugin .= '|autocmd! html_timestamp' - \ . '|augroup! htmltimestamp' +let b:undo_ftplugin .= '|execute ''autocmd! html_timestamp''' + \ . '|augroup! html_timestamp' " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_html_maps') -- cgit v1.2.3 From add78dd0267a26936a964ea08eb0e1515457b90a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 20:07:09 +1300 Subject: Clear away stock ft=mail quoting maps --- vim/after/ftplugin/mail.vim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 688ca6eb..d93b230e 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -41,6 +41,13 @@ if exists('g:no_plugin_maps') || exists('g:no_mail_maps') finish endif +" Clear away the quoting maps that the stock mail.vim sets; they work fine, +" but we have nicer ones to define shortly +nunmap q +vunmap q +nunmap MailQuote +vunmap MailQuote + " Flag messages as important/unimportant nnoremap h \ :call mail#FlagImportant() -- cgit v1.2.3 From f3aa132a4f360dc4eea23dbf7fc3271823d64418 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 21:10:48 +1300 Subject: Add dummy function for HTML omnicompletion The function invoked to detect the HTML type for omnicompletion is pretty big, sets a few buffer variables that it doesn't arrange to clear, and I don't use it at all. Loading a dummy function in its place seems to be better. --- vim/autoload/htmlcomplete.vim | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 vim/autoload/htmlcomplete.vim diff --git a/vim/autoload/htmlcomplete.vim b/vim/autoload/htmlcomplete.vim new file mode 100644 index 00000000..d4e52cd6 --- /dev/null +++ b/vim/autoload/htmlcomplete.vim @@ -0,0 +1,5 @@ +" Override expensive HTML version detection for 'omnifunc', that I don't use +" and can't otherwise disable +function! htmlcomplete#DetectOmniFlavor() + return +endfunction -- cgit v1.2.3 From bc823fab3c7fdbb742fa0e2fb0e4cb19de1cf079 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 21:13:16 +1300 Subject: Simplify ft=sh subtype flag clearing These flags are also set and examined by the stock syntax for the "sh" filetype, so checking for whether they're set at runtime for the ftplugin just confuses things. Just clear them unconditionally instead. --- vim/after/ftplugin/sh.vim | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim index fdc42ccc..431e5037 100644 --- a/vim/after/ftplugin/sh.vim +++ b/vim/after/ftplugin/sh.vim @@ -34,14 +34,9 @@ if exists('b:is_posix') endif " Queue up undo commands to clear the shell language flags that we set for -" this buffer during filetype detection in filetype.vim -if exists('b:is_bash') - let b:undo_ftplugin .= '|unlet b:is_bash' -elseif exists('b:is_kornshell') - let b:undo_ftplugin .= '|unlet b:is_kornshell' -elseif exists('b:is_posix') - let b:undo_ftplugin .= '|unlet b:is_posix' -endif +" this buffer during filetype detection in filetype.vim, or that the stock +" syntax highlighting chose for us +let b:undo_ftplugin .= '|unlet! b:is_bash b:is_kornshell b:is_posix' " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_sh_maps') -- cgit v1.2.3 From cd85ca6e9516ebe8ec1d54253f08b2b0942d820f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 21:22:05 +1300 Subject: Adjust a vimrc comment for clarity --- vim/vimrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 25fe4e05..8673d51b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -185,9 +185,9 @@ set shortmess+=I " Prefix wrapped rows with three dots set showbreak=... -" New windows go below or to the right of a split -set splitbelow -set splitright +" New window positioning +set splitbelow " Below the current window, not above +set splitright " Right of the current window, not left " Give me a bit longer to complete mappings set timeoutlen=3000 -- cgit v1.2.3 From da5f6cc79e233f3241bd47a862769f8c438c5986 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 22:17:34 +1300 Subject: Set b:did_ftplugin flag in Vim ftplugins --- vim/ftplugin/awk.vim | 1 + vim/ftplugin/csv.vim | 1 + vim/ftplugin/password.vim | 1 + vim/ftplugin/sed.vim | 1 + vim/ftplugin/tmux.vim | 1 + vim/ftplugin/tsv.vim | 1 + 6 files changed, 6 insertions(+) diff --git a/vim/ftplugin/awk.vim b/vim/ftplugin/awk.vim index 350bc976..9627941d 100644 --- a/vim/ftplugin/awk.vim +++ b/vim/ftplugin/awk.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " Set comment formats setlocal comments=:# diff --git a/vim/ftplugin/csv.vim b/vim/ftplugin/csv.vim index 58edfffe..162da402 100644 --- a/vim/ftplugin/csv.vim +++ b/vim/ftplugin/csv.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " No autoformatting, literal tabs setlocal noautoindent diff --git a/vim/ftplugin/password.vim b/vim/ftplugin/password.vim index 04658423..28f5a5e9 100644 --- a/vim/ftplugin/password.vim +++ b/vim/ftplugin/password.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " No autoformatting setlocal formatoptions= diff --git a/vim/ftplugin/sed.vim b/vim/ftplugin/sed.vim index 350bc976..9627941d 100644 --- a/vim/ftplugin/sed.vim +++ b/vim/ftplugin/sed.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " Set comment formats setlocal comments=:# diff --git a/vim/ftplugin/tmux.vim b/vim/ftplugin/tmux.vim index 350bc976..9627941d 100644 --- a/vim/ftplugin/tmux.vim +++ b/vim/ftplugin/tmux.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " Set comment formats setlocal comments=:# diff --git a/vim/ftplugin/tsv.vim b/vim/ftplugin/tsv.vim index 58edfffe..162da402 100644 --- a/vim/ftplugin/tsv.vim +++ b/vim/ftplugin/tsv.vim @@ -2,6 +2,7 @@ if exists('b:did_ftplugin') finish endif +let b:did_ftplugin = 1 " No autoformatting, literal tabs setlocal noautoindent -- cgit v1.2.3 From 61ad1432240290f889ef11a4b527163cc8fff83d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:23:06 +1300 Subject: Simplify after/ftplugin for C Allow the cpp plugin to load this, since it's the same anyway, and push all the undo stuff together. --- vim/after/ftplugin/c.vim | 11 +++-------- vim/after/ftplugin/cpp.vim | 18 ------------------ 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 vim/after/ftplugin/cpp.vim diff --git a/vim/after/ftplugin/c.vim b/vim/after/ftplugin/c.vim index da34d269..ccc5b170 100644 --- a/vim/after/ftplugin/c.vim +++ b/vim/after/ftplugin/c.vim @@ -1,18 +1,13 @@ -" Extra configuration for C files -if &filetype !=# 'c' || v:version < 700 - finish -endif - " Include macros in completion setlocal complete+=d -let b:undo_ftplugin .= '|setlocal complete<' " Set include pattern setlocal include=^\\s*#\\s*include -let b:undo_ftplugin .= '|setlocal include<' " Include headers on UNIX if has('unix') setlocal path+=/usr/include - let b:undo_ftplugin .= '|setlocal path<' endif + +" Undo all of the above +let b:undo_ftplugin .= '|setlocal complete< include< path<' diff --git a/vim/after/ftplugin/cpp.vim b/vim/after/ftplugin/cpp.vim deleted file mode 100644 index 4042fb84..00000000 --- a/vim/after/ftplugin/cpp.vim +++ /dev/null @@ -1,18 +0,0 @@ -" Extra configuration for C++ files -if &filetype !=# 'cpp' || v:version < 700 - finish -endif - -" Include macros in completion -setlocal complete+=d -let b:undo_ftplugin .= '|setlocal complete<' - -" Set include pattern -setlocal include=^\\s*#\\s*include -let b:undo_ftplugin .= '|setlocal include<' - -" Include headers on UNIX -if has('unix') - setlocal path+=/usr/include - let b:undo_ftplugin .= '|setlocal path<' -endif -- cgit v1.2.3 From dc59d7e74635f9a56fef9049e34411d6ef535650 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:26:52 +1300 Subject: Remove boilerplate after/ftplugin load guards I'm likely going to move away from Vim 6.0 support, at least for all of this filetype stuff. We will keep the one filetype load guard we actually need, which is the HTML one, to stop plugins like markdown.vim from loading it. --- vim/after/ftplugin/diff.vim | 5 ----- vim/after/ftplugin/gitcommit.vim | 5 ----- vim/after/ftplugin/help.vim | 5 ----- vim/after/ftplugin/html.vim | 4 ++-- vim/after/ftplugin/mail.vim | 5 ----- vim/after/ftplugin/make.vim | 5 ----- vim/after/ftplugin/markdown.vim | 5 ----- vim/after/ftplugin/perl.vim | 5 ----- vim/after/ftplugin/php.vim | 5 ----- vim/after/ftplugin/sh.vim | 5 ----- vim/after/ftplugin/text.vim | 5 ----- vim/after/ftplugin/vim.vim | 5 ----- vim/after/ftplugin/zsh.vim | 5 ----- 13 files changed, 2 insertions(+), 62 deletions(-) diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim index a52b3fdd..15682e7b 100644 --- a/vim/after/ftplugin/diff.vim +++ b/vim/after/ftplugin/diff.vim @@ -1,8 +1,3 @@ -" Extra configuration for diffs -if &filetype !=# 'diff' || v:version < 700 || &compatible - finish -endif - " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_diff_maps') finish diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 18bacfb8..762df0ba 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -1,8 +1,3 @@ -" Extra configuration for Git commit messages -if &filetype !=# 'gitcommit' || v:version < 700 - finish -endif - " Make angle brackets behave like mail quotes setlocal comments+=n:> setlocal formatoptions+=coqr diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim index 71ad3a8d..ae032344 100644 --- a/vim/after/ftplugin/help.vim +++ b/vim/after/ftplugin/help.vim @@ -1,8 +1,3 @@ -" Extra configuration for Vim help files -if &filetype !=# 'help' || v:version < 700 - finish -endif - " This variable had the wrong name before Vim 7.1 if v:version == 700 && exists('b:undo_plugin') let b:undo_ftplugin = b:undo_plugin diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 29128c03..b5c387fb 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -1,5 +1,5 @@ -" Extra configuration for HTML files -if &filetype !=# 'html' || v:version < 700 || &compatible +" Don't load if the buffer is not actually HTML (e.g. Markdown) +if &filetype !=# 'html' finish endif diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index d93b230e..e8b64164 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -1,8 +1,3 @@ -" Extra configuration for mail messages -if &filetype !=# 'mail' || &compatible || v:version < 700 - finish -endif - " If something hasn't already moved the cursor, we'll move to an optimal point " to start writing if line('.') == 1 && col('.') == 1 diff --git a/vim/after/ftplugin/make.vim b/vim/after/ftplugin/make.vim index 3018e11b..353a0bbf 100644 --- a/vim/after/ftplugin/make.vim +++ b/vim/after/ftplugin/make.vim @@ -1,8 +1,3 @@ -" Extra configuration for Makefiles -if &filetype !=# 'make' || v:version < 700 - finish -endif - " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_make_maps') finish diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index cd8873b9..1a5a055b 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -1,8 +1,3 @@ -" Extra configuration for Markdown documents -if &filetype !=# 'markdown' || v:version < 700 - finish -endif - " Spellchecking features if has('spell') diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim index ee8da2a7..5dd2b7bb 100644 --- a/vim/after/ftplugin/perl.vim +++ b/vim/after/ftplugin/perl.vim @@ -1,8 +1,3 @@ -" Extra configuration for Perl filetypes -if &filetype !=# 'perl' || v:version < 700 || &compatible - finish -endif - " Use Perl itself for checking and Perl::Tidy for tidying compiler perl setlocal equalprg=perltidy diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim index 9b7c2bb0..172256db 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -1,8 +1,3 @@ -" Extra configuration for PHP scripts -if &filetype !=# 'php' || v:version < 700 || &compatible - finish -endif - " Use PHP itself for syntax checking compiler php let b:undo_ftplugin .= '|unlet b:current_compiler' diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim index 431e5037..6ee016a5 100644 --- a/vim/after/ftplugin/sh.vim +++ b/vim/after/ftplugin/sh.vim @@ -1,8 +1,3 @@ -" Extra configuration for shell script -if &filetype !=# 'sh' || v:version < 700 || &compatible - finish -endif - " Set comment formats setlocal comments=:# setlocal formatoptions+=or diff --git a/vim/after/ftplugin/text.vim b/vim/after/ftplugin/text.vim index 8341f72d..cda2891c 100644 --- a/vim/after/ftplugin/text.vim +++ b/vim/after/ftplugin/text.vim @@ -1,8 +1,3 @@ -" Extra configuration for text files -if &filetype !=# 'text' || v:version < 700 - finish -endif - " Spellcheck documents we're actually editing (not just viewing) if has('spell') && &modifiable && !&readonly setlocal spell diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim index 2fc5bd78..9f6245a5 100644 --- a/vim/after/ftplugin/vim.vim +++ b/vim/after/ftplugin/vim.vim @@ -1,8 +1,3 @@ -" Extra configuration for Vim scripts -if &filetype !=# 'vim' || v:version < 700 || &compatible - finish -endif - " Use Vint as a syntax checker if bufname('%') !=# 'command-line' compiler vint diff --git a/vim/after/ftplugin/zsh.vim b/vim/after/ftplugin/zsh.vim index 49736401..5aa2600a 100644 --- a/vim/after/ftplugin/zsh.vim +++ b/vim/after/ftplugin/zsh.vim @@ -1,8 +1,3 @@ -" Extra configuration for Z shell scripts -if &filetype !=# 'zsh' || v:version < 700 || &compatible - finish -endif - " Use Z shell itself as a syntax checker compiler zsh let b:undo_ftplugin .= '|unlet b:current_compiler' -- cgit v1.2.3 From 5f1f5b9de3d9ab80a0b5ecef4559b88990f42f4a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:29:09 +1300 Subject: Remove double-key mapping shortcuts I never use these anyway; I'm firmly in the habit of using underscores to represent the current line these days. --- vim/after/ftplugin/diff.vim | 2 -- vim/after/ftplugin/gitcommit.vim | 4 ---- vim/after/ftplugin/mail.vim | 4 ---- vim/after/ftplugin/markdown.vim | 4 ---- 4 files changed, 14 deletions(-) diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim index 15682e7b..1813e4b0 100644 --- a/vim/after/ftplugin/diff.vim +++ b/vim/after/ftplugin/diff.vim @@ -28,8 +28,6 @@ nmap p \ (DiffPrune) xmap p \ (DiffPrune) -nmap pp - \ (DiffPrune)_ let b:undo_ftplugin .= '|nunmap p' \ . '|xunmap p' \ . '|nunmap pp' diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 762df0ba..1a4c1b1b 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -22,8 +22,6 @@ endif " Quote operator nnoremap q \ quote#Quote() -nnoremap qq - \ quote#Quote().'_' xnoremap q \ quote#Quote() let b:undo_ftplugin .= '|nunmap q' @@ -33,8 +31,6 @@ let b:undo_ftplugin .= '|nunmap q' " Quote operator with reformatting nnoremap Q \ quote#QuoteReformat() -nnoremap QQ - \ quote#QuoteReformat().'_' xnoremap Q \ quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap Q' diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index e8b64164..74ec1699 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -54,8 +54,6 @@ let b:undo_ftplugin .= '|nunmap l' " Quote operator nnoremap q \ quote#Quote() -nnoremap qq - \ quote#Quote().'_' xnoremap q \ quote#Quote() let b:undo_ftplugin .= '|nunmap q' @@ -65,8 +63,6 @@ let b:undo_ftplugin .= '|nunmap q' " Quote operator with reformatting nnoremap Q \ quote#QuoteReformat() -nnoremap QQ - \ quote#QuoteReformat().'_' xnoremap Q \ quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap Q' diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index 1a5a055b..f129deba 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -24,8 +24,6 @@ endif " Quote operator nnoremap q \ quote#Quote() -nnoremap qq - \ quote#Quote().'_' xnoremap q \ quote#Quote() let b:undo_ftplugin .= '|nunmap q' @@ -35,8 +33,6 @@ let b:undo_ftplugin .= '|nunmap q' " Quote operator with reformatting nnoremap Q \ quote#QuoteReformat() -nnoremap QQ - \ quote#QuoteReformat().'_' xnoremap Q \ quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap Q' -- cgit v1.2.3 From 04cf824ac17f25ce36f04b5ab6c5e8befbe25e90 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:30:11 +1300 Subject: Add missing detail to a comment --- vim/after/ftplugin/diff.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim index 1813e4b0..123f0d0a 100644 --- a/vim/after/ftplugin/diff.vim +++ b/vim/after/ftplugin/diff.vim @@ -23,7 +23,7 @@ let b:undo_ftplugin .= '|nunmap [' \ . '|xunmap [' \ . '|xunmap ]' -" Set mappings +" Set mappings for diff pruning plugin nmap p \ (DiffPrune) xmap p -- cgit v1.2.3 From 381b85d5067f496d65faa9fab54752299f61ad98 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:36:46 +1300 Subject: Remove some overzealous b:undo_* setting It's not that these shouldn't be set, it's more that it's the wrong place to do it, especially before they've caused any actual problems. --- vim/after/ftplugin/php.vim | 6 ------ vim/after/ftplugin/vim.vim | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim index 172256db..688166ba 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -16,9 +16,3 @@ let b:undo_ftplugin .= '|setlocal keywordprg<' if exists('g:no_plugin_maps') || exists('g:no_php_maps') finish endif - -" Get rid of the core ftplugin's square-bracket maps on unload -let b:undo_ftplugin .= '|nunmap [[' - \ . '|ounmap [[' - \ . '|nunmap ]]' - \ . '|ounmap ]]' diff --git a/vim/after/ftplugin/vim.vim b/vim/after/ftplugin/vim.vim index 9f6245a5..a7a69993 100644 --- a/vim/after/ftplugin/vim.vim +++ b/vim/after/ftplugin/vim.vim @@ -14,20 +14,3 @@ endif nnoremap K \ :helpgrep let b:undo_ftplugin .= '|nunmap K' - -" Get rid of the core ftplugin's square-bracket maps on unload -" 8.1.273 updated the runtime files to include a fix for this -if v:version < 801 || v:version == 801 && !has('patch273') - let b:undo_ftplugin .= '|nunmap [[' - \ . '|vunmap [[' - \ . '|nunmap ]]' - \ . '|vunmap ]]' - \ . '|nunmap []' - \ . '|vunmap []' - \ . '|nunmap ][' - \ . '|vunmap ][' - \ . '|nunmap ]"' - \ . '|vunmap ]"' - \ . '|nunmap ["' - \ . '|vunmap ["' -endif -- cgit v1.2.3 From b202810bb1fa50905a5d7840d5fd4b00e34dbd8f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:41:00 +1300 Subject: Pare down after/indent scripts a fair bit More overzealous undo-setting. I should wait until it becomes an actual issue. --- vim/after/indent/awk.vim | 7 ------- vim/after/indent/html.vim | 3 +-- vim/after/indent/perl.vim | 9 --------- vim/after/indent/vim.vim | 20 ++++---------------- 4 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 vim/after/indent/awk.vim delete mode 100644 vim/after/indent/perl.vim diff --git a/vim/after/indent/awk.vim b/vim/after/indent/awk.vim deleted file mode 100644 index fc848d2a..00000000 --- a/vim/after/indent/awk.vim +++ /dev/null @@ -1,7 +0,0 @@ -" The stock AWK indenting is decent, but doesn't include an undo variable; -" this adds one, clearing away the sole global function too. -if !exists('b:undo_indent') - let b:undo_indent = 'unlet! b:did_indent' - let b:undo_indent = b:undo_indent . '|setlocal indentexpr< indentkeys<' - let b:undo_indent = b:undo_indent . '|delfunction! GetAwkIndent' -endif diff --git a/vim/after/indent/html.vim b/vim/after/indent/html.vim index 6eae00ac..df74b174 100644 --- a/vim/after/indent/html.vim +++ b/vim/after/indent/html.vim @@ -1,4 +1,3 @@ " Don't re-indent lines on right-angle-bracket or enter -setlocal indentkeys-=<>> -setlocal indentkeys-= +setlocal indentkeys-=<>>, let b:undo_ftplugin .= '|setlocal indentkeys<' diff --git a/vim/after/indent/perl.vim b/vim/after/indent/perl.vim deleted file mode 100644 index 6f97d979..00000000 --- a/vim/after/indent/perl.vim +++ /dev/null @@ -1,9 +0,0 @@ -" The stock Perl indenting is decent, but doesn't include an undo variable; -" this adds one -if !exists('b:undo_indent') - let b:undo_indent = 'unlet! b:did_indent' - let b:undo_indent = b:undo_indent . '|setlocal indentexpr< indentkeys<' - let b:undo_indent = b:undo_indent . '|unlet! b:indent_use_syntax' - let b:undo_indent = b:undo_indent . '|unlet! b:match_skip' - let b:undo_indent = b:undo_indent . '|unlet! b:match_words' -endif diff --git a/vim/after/indent/vim.vim b/vim/after/indent/vim.vim index 7e36c4cc..548d3e5c 100644 --- a/vim/after/indent/vim.vim +++ b/vim/after/indent/vim.vim @@ -1,20 +1,8 @@ " Observe VimL conventions for two-space indents setlocal shiftwidth=2 -if v:version > 703 || v:version == 703 && has('patch693') - setlocal softtabstop=-1 -else - setlocal softtabstop=2 -endif +setlocal softtabstop=2 +let b:undo_indent .= '|setlocal shiftwidth< softtabstop<' " Remove inapplicable defaults from 'indentkeys' -setlocal indentkeys-=0# -setlocal indentkeys-=0{ -setlocal indentkeys-=0} -setlocal indentkeys-=0) -setlocal indentkeys-=: - -" Commands to undo the above -if exists('b:undo_indent') - let b:undo_indent = b:undo_indent . '|setlocal shiftwidth<' - let b:undo_indent = b:undo_indent . '|setlocal softtabstop<' -endif +setlocal indentkeys-=0#,0{,0},0),: +let b:undo_indent .= '|setlocal indentkeys<' -- cgit v1.2.3 From 94a37ae9558292868ad00094ca1dfc278d8e9adb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:43:46 +1300 Subject: Remove some Vim syntax boilerplate --- vim/after/syntax/bindzone.vim | 6 ------ vim/after/syntax/gitcommit.vim | 6 ------ vim/after/syntax/messages.vim | 6 ------ 3 files changed, 18 deletions(-) diff --git a/vim/after/syntax/bindzone.vim b/vim/after/syntax/bindzone.vim index cc50638c..19989995 100644 --- a/vim/after/syntax/bindzone.vim +++ b/vim/after/syntax/bindzone.vim @@ -1,9 +1,3 @@ -" Don't try to make these corrections if running 'compatible' or if the -" runtime files are too old -if &compatible || v:version < 700 - finish -endif - " Highlight TLSA and SSHFP records correctly " syn keyword zoneRRType contained TLSA SSHFP nextgroup=zoneRData skipwhite diff --git a/vim/after/syntax/gitcommit.vim b/vim/after/syntax/gitcommit.vim index 2232e499..e47091f9 100644 --- a/vim/after/syntax/gitcommit.vim +++ b/vim/after/syntax/gitcommit.vim @@ -1,8 +1,2 @@ -" Don't try to make these corrections if running 'compatible' or if the -" runtime files are too old -if &compatible || v:version < 700 - finish -endif - " If my commit subject is too long, highlight it as an error. highlight link gitCommitOverflow Error diff --git a/vim/after/syntax/messages.vim b/vim/after/syntax/messages.vim index 75fe89b9..04faa607 100644 --- a/vim/after/syntax/messages.vim +++ b/vim/after/syntax/messages.vim @@ -1,9 +1,3 @@ -" Don't try to make these corrections if running 'compatible' or if the -" runtime files are too old -if &compatible || v:version < 700 - finish -endif - " The highlighting for errors in syslog/messages files is more often annoying " than useful, so just turn it off. syntax clear messagesError -- cgit v1.2.3 From 2f56e69e935e48c248b507cca9869d4ee53e6a97 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:50:21 +1300 Subject: Clear away a flag after HTML indent load --- vim/after/indent/html.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/after/indent/html.vim b/vim/after/indent/html.vim index df74b174..0309881c 100644 --- a/vim/after/indent/html.vim +++ b/vim/after/indent/html.vim @@ -1,3 +1,6 @@ +" Clear away the flag we set to indent after paragraphs +unlet g:html_indent_inctags + " Don't re-indent lines on right-angle-bracket or enter setlocal indentkeys-=<>>, let b:undo_ftplugin .= '|setlocal indentkeys<' -- cgit v1.2.3 From f0bcb51101807840770788229a2da7905370912f Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:52:03 +1300 Subject: Simplify a load guard for sh.vim syntax tweaks --- vim/after/syntax/sh.vim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index f02f30f5..872d659c 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -1,6 +1,5 @@ -" Don't try to make these corrections if running 'compatible' or if the -" runtime files are too old -if &compatible || v:version < 700 +" Don't try to make these corrections if the runtime files are too old +if v:version < 700 finish endif -- cgit v1.2.3 From 7fed281d49ee41a15a1c2c6e9d565e264a0abf1d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:57:13 +1300 Subject: Require Vim 7 for filetype and syntax highlights It's time! The rest of the vimrc can probably be allowed to load, though. --- vim/after/syntax/sh.vim | 5 ----- vim/filetype.vim | 9 +++------ vim/vimrc | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index 872d659c..bdedaf65 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -1,8 +1,3 @@ -" Don't try to make these corrections if the runtime files are too old -if v:version < 700 - finish -endif - " Remove g:is_posix if we resorted to it in order to get correct POSIX sh " highlighting with older Vim runtime files if exists('g:is_posix') diff --git a/vim/filetype.vim b/vim/filetype.vim index 4f3839ef..2e20b744 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -566,11 +566,8 @@ augroup filetypedetect \| runtime scripts.vim \|endif - " If supported, on leaving insert mode, check whether the first line was - " changed and looks like a shebang format, and if so, re-run filetype - " detection - if v:version > 700 - autocmd InsertLeave * call s:CheckShebang() - endif + " On leaving insert mode, check whether the first line was changed and looks + " like a shebang format, and if so, re-run filetype detection + autocmd InsertLeave * call s:CheckShebang() augroup END diff --git a/vim/vimrc b/vim/vimrc index 8673d51b..27c4d3e5 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -8,13 +8,13 @@ runtime system.vim " Load filetype settings, plugins, and maps -if has('autocmd') +if has('autocmd') && v:version >= 700 let g:maplocalleader = ',' filetype plugin indent on endif " Options dependent on the syntax feature -if has('syntax') +if has('syntax') && v:version >= 700 " Use syntax highlighting if !exists('g:syntax_on') -- cgit v1.2.3 From 3fcda2fcc5dc783e6e48710d928437c0ce4509cf Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 29 Nov 2018 23:58:12 +1300 Subject: Comment conditional set of (InsertCancel) --- vim/vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 27c4d3e5..d8832fb7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -223,7 +223,7 @@ nnoremap :nohlsearch vnoremap :nohlsearchgv " Remap insert Ctrl-C to undo the escaped insert operation -if &loadplugins +if &loadplugins " Don't break the key if we won't be getting the plugin imap (InsertCancel) endif -- cgit v1.2.3 From 877857a4b21229965e31f0e303e96e7ed0d1e1eb Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 00:06:39 +1300 Subject: Update make_target.vim to v1.2.0 --- vim/bundle/make_target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/make_target b/vim/bundle/make_target index f4fe9405..71a5fa55 160000 --- a/vim/bundle/make_target +++ b/vim/bundle/make_target @@ -1 +1 @@ -Subproject commit f4fe940526c9351990c9966eb6828f315c833117 +Subproject commit 71a5fa558b28e081bede012f075233924b0aee75 -- cgit v1.2.3 From 6805bb4d1233fcb7f1ddfb2ff03e12b1f6f0f750 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 30 Nov 2018 00:09:40 +1300 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 1f815a05..f8ed3c33 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.78.0 -Wed Nov 28 11:09:16 UTC 2018 +tejr dotfiles v2.0.0 +Thu Nov 29 11:09:35 UTC 2018 -- cgit v1.2.3