From d367763e6a99e79debfc4c6ed52964e6f1f20b25 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 19:32:19 +1200 Subject: Remove bell settings from .gvimrc Reflects changes made in commit 35ba8df. --- vim/gvimrc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vim/gvimrc b/vim/gvimrc index 1dca44e4..33301da8 100644 --- a/vim/gvimrc +++ b/vim/gvimrc @@ -13,8 +13,3 @@ set guioptions+=M " Don't load menu.vim (also set in .vimrc) " Don't use the mouse set mouse= - -" Stamp 'visualbell' back down again, if 'belloff' not available -if !exists('+belloff') - set visualbell t_vb= -endif -- cgit v1.2.3 From 2985baeea1e41f87eba6c695bed848493d3ac9c8 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 19:42:02 +1200 Subject: Change mail quoting to generic autoload function I intend to use it elsewhere. --- vim/after/ftplugin/mail.vim | 6 +++--- vim/autoload/mail.vim | 11 ----------- vim/autoload/quote.vim | 11 +++++++++++ 3 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 vim/autoload/mail.vim create mode 100644 vim/autoload/quote.vim diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index d22ec142..0867311a 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -21,9 +21,9 @@ endif " The quote mapping in the stock plugin is a good idea, but I prefer it to " work as a motion rather than quoting to the end of the buffer -nnoremap q mail#Quote() -nnoremap qq mail#Quote().'_' -xnoremap q mail#Quote() +nnoremap q quote#Quote() +nnoremap qq quote#Quote().'_' +xnoremap q quote#Quote() let b:undo_ftplugin .= '|nunmap q' \ . '|nunmap qq' \ . '|xunmap q' diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim deleted file mode 100644 index 4c21ae38..00000000 --- a/vim/autoload/mail.vim +++ /dev/null @@ -1,11 +0,0 @@ -" Quote lines in mail messages -function! mail#Quote() abort - set operatorfunc=mail#QuoteOpfunc - return 'g@' -endfunction -function! mail#QuoteOpfunc(type) abort - for l:li in range(line('''['), line(''']')) - let l:line = getline(l:li) - call setline(l:li, '>'.l:line) - endfor -endfunction diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim new file mode 100644 index 00000000..92de5035 --- /dev/null +++ b/vim/autoload/quote.vim @@ -0,0 +1,11 @@ +" Quote lines in mail and mail-based formats: Markdown, Git commits, etc +function! quote#Quote() abort + set operatorfunc=quote#QuoteOpfunc + return 'g@' +endfunction +function! quote#QuoteOpfunc(type) abort + for l:li in range(line('''['), line(''']')) + let l:line = getline(l:li) + call setline(l:li, '>'.l:line) + endfor +endfunction -- cgit v1.2.3 From 3102cf30db49602baa4e4e665622d91ff339ea1e Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:04:54 +1200 Subject: Expand and comment quoting functions --- vim/autoload/quote.vim | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim index 92de5035..6e943091 100644 --- a/vim/autoload/quote.vim +++ b/vim/autoload/quote.vim @@ -1,11 +1,30 @@ " Quote lines in mail and mail-based formats: Markdown, Git commits, etc + +" Operator function wrapper for the mapping to call function! quote#Quote() abort set operatorfunc=quote#QuoteOpfunc return 'g@' endfunction + +" Quoting operator function function! quote#QuoteOpfunc(type) abort + + " May as well make this configurable + let l:char = exists('b:quote_char') + \ ? b:quote_char + \ : '>' + + " Iterate over each matched line for l:li in range(line('''['), line(''']')) - let l:line = getline(l:li) - call setline(l:li, '>'.l:line) + + " Only add a space after the quote character if this line isn't already + " quoted with the same character + let l:cur = getline(l:li) + let l:new = stridx(l:cur, l:char) == 0 + \ ? l:char.l:cur + \ : l:char.' '.l:cur + call setline(l:li, l:new) + endfor + endfunction -- cgit v1.2.3 From cd5f438f5ecc65f05e92fb4d0d9ed33e3ef243e5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:05:12 +1200 Subject: Add mail quote maps for gitcommit and markdown --- vim/after/ftplugin/gitcommit.vim | 13 +++++++++++++ vim/after/ftplugin/markdown.vim | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 8e365d98..4f57a407 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -7,3 +7,16 @@ endif setlocal comments+=n:> setlocal formatoptions+=coqr let b:undo_ftplugin .= '|setlocal comments< formatoptions<' + +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_gitcommit_maps') + finish +endif + +" Mail quote mappings +nnoremap q quote#Quote() +nnoremap qq quote#Quote().'_' +xnoremap q quote#Quote() +let b:undo_ftplugin .= '|nunmap q' + \ . '|nunmap qq' + \ . '|xunmap q' diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index 63f3f062..26b42849 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -20,3 +20,16 @@ if has('spell') endif endif + +" Stop here if the user doesn't want ftplugin mappings +if exists('g:no_plugin_maps') || exists('g:no_markdown_maps') + finish +endif + +" Mail quote mappings +nnoremap q quote#Quote() +nnoremap qq quote#Quote().'_' +xnoremap q quote#Quote() +let b:undo_ftplugin .= '|nunmap q' + \ . '|nunmap qq' + \ . '|xunmap q' -- cgit v1.2.3 From efadde49f989a169bb34f1f7024ca661b5ae79cd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:41:33 +1200 Subject: Spin off vimrc_reload_filetype.vim --- .gitmodules | 3 +++ vim/bundle/vimrc_reload_filetype | 1 + vim/plugin/reload_vimrc_filetype.vim | 23 ----------------------- 3 files changed, 4 insertions(+), 23 deletions(-) create mode 160000 vim/bundle/vimrc_reload_filetype delete mode 100644 vim/plugin/reload_vimrc_filetype.vim diff --git a/.gitmodules b/.gitmodules index e52d990e..4565f637 100644 --- a/.gitmodules +++ b/.gitmodules @@ -71,3 +71,6 @@ [submodule "vim/bundle/digraph_search"] path = vim/bundle/digraph_search url = https://sanctum.geek.nz/code/vim-digraph-search.git +[submodule "vim/bundle/vimrc_reload_filetype"] + path = vim/bundle/vimrc_reload_filetype + url = https://sanctum.geek.nz/code/vim-vimrc-reload-filetype.git diff --git a/vim/bundle/vimrc_reload_filetype b/vim/bundle/vimrc_reload_filetype new file mode 160000 index 00000000..34f74601 --- /dev/null +++ b/vim/bundle/vimrc_reload_filetype @@ -0,0 +1 @@ +Subproject commit 34f746015a76fda53b70dda91f81edf41f75d472 diff --git a/vim/plugin/reload_vimrc_filetype.vim b/vim/plugin/reload_vimrc_filetype.vim deleted file mode 100644 index d4f853b8..00000000 --- a/vim/plugin/reload_vimrc_filetype.vim +++ /dev/null @@ -1,23 +0,0 @@ -" -" reload_vimrc_filetype.vim: Add hook to reload active buffer's filetype when -" vimrc reloaded, so that we don't end up indenting four spaces in an open -" VimL file, etc. Requires Vim 7.1 or 7.0 with patch 187 (SourceCmd event.) -" -" Author: Tom Ryder -" License: Same as Vim itself -" -if exists('g:loaded_reload_vimrc_filetype') || &compatible - finish -endif -if !has('autocmd') || v:version < 700 || v:version == 700 && !has('patch187') - finish -endif -let g:loaded_reload_vimrc_filetype = 1 - -" This SourceCmd intercepts :source for .vimrc -augroup reload_vimrc_filetype - autocmd SourceCmd $MYVIMRC - \ source - \|doautocmd filetypedetect BufRead - \|echomsg 'Reloaded vimrc: '.expand('') -augroup END -- cgit v1.2.3 From adb42d81e7753e9096810a1685ce16984e596afd Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:48:12 +1200 Subject: Revert "Remove :nohlsearch from vimrc" This reverts commit 8640888fdfdee047e4f40df4a1a89510330f1fe4. This is still necessary, and I'm not sure why I thought it wasn't... --- vim/vimrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index e76fe85e..93b437d7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -112,7 +112,8 @@ endif " Highlight settings for search if has('extra_search') - set hlsearch " Highlight completed searches + set hlsearch " Highlight completed searches... + nohlsearch " ...but clear it on startup or after re-sourcing set incsearch " Show matches as I type endif -- cgit v1.2.3 From e674c4cacba90d3cd64e2b3428eb790847ab8df5 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 14 Jul 2018 20:52:26 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 6e27dfbc..88dba5bf 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.29.0 -Sat Jul 14 07:27:12 UTC 2018 +tejr dotfiles v1.30.0 +Sat Jul 14 08:52:21 UTC 2018 -- cgit v1.2.3