diff options
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | vim/after/ftplugin/gitcommit.vim | 6 | ||||
-rw-r--r-- | vim/after/ftplugin/mail.vim | 8 | ||||
-rw-r--r-- | vim/after/ftplugin/markdown.vim | 6 | ||||
-rw-r--r-- | vim/autoload/quote.vim | 12 | ||||
-rw-r--r-- | vim/filetype.vim | 2 | ||||
-rw-r--r-- | vim/plugin/wildignore.vim | 6 | ||||
-rw-r--r-- | vim/vimrc | 2 |
8 files changed, 37 insertions, 9 deletions
@@ -1,2 +1,2 @@ -tejr dotfiles v1.31.0 -Sun Jul 15 21:22:13 UTC 2018 +tejr dotfiles v1.32.0 +Mon Jul 16 02:08:56 UTC 2018 diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim index 7fab5a92..5699188d 100644 --- a/vim/after/ftplugin/gitcommit.vim +++ b/vim/after/ftplugin/gitcommit.vim @@ -27,6 +27,12 @@ endif nnoremap <buffer> <expr> <LocalLeader>q quote#Quote() nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_' xnoremap <buffer> <expr> <LocalLeader>q quote#Quote() +nnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() +nnoremap <buffer> <expr> <LocalLeader>QQ quote#QuoteReformat().'_' +xnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q' \ . '|nunmap <buffer> <LocalLeader>qq' \ . '|xunmap <buffer> <LocalLeader>q' + \ . '|nunmap <buffer> <LocalLeader>Q' + \ . '|nunmap <buffer> <LocalLeader>QQ' + \ . '|xunmap <buffer> <LocalLeader>Q' diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index 3e3a08c5..74261d8c 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -7,7 +7,7 @@ endif " the first entirely blank line, if something hasn't already moved us from the " start of the file if line('.') == 1 && col('.') == 1 - call search('^$', 'c') + call search('\m^$', 'c') endif " Add a space to the end of wrapped lines for format-flowed mail @@ -24,6 +24,12 @@ endif nnoremap <buffer> <expr> <LocalLeader>q quote#Quote() nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_' xnoremap <buffer> <expr> <LocalLeader>q quote#Quote() +nnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() +nnoremap <buffer> <expr> <LocalLeader>QQ quote#QuoteReformat().'_' +xnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q' \ . '|nunmap <buffer> <LocalLeader>qq' \ . '|xunmap <buffer> <LocalLeader>q' + \ . '|nunmap <buffer> <LocalLeader>Q' + \ . '|nunmap <buffer> <LocalLeader>QQ' + \ . '|xunmap <buffer> <LocalLeader>Q' diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim index 38f2a8b9..a5c80ca9 100644 --- a/vim/after/ftplugin/markdown.vim +++ b/vim/after/ftplugin/markdown.vim @@ -30,6 +30,12 @@ endif nnoremap <buffer> <expr> <LocalLeader>q quote#Quote() nnoremap <buffer> <expr> <LocalLeader>qq quote#Quote().'_' xnoremap <buffer> <expr> <LocalLeader>q quote#Quote() +nnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() +nnoremap <buffer> <expr> <LocalLeader>QQ quote#QuoteReformat().'_' +xnoremap <buffer> <expr> <LocalLeader>Q quote#QuoteReformat() let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q' \ . '|nunmap <buffer> <LocalLeader>qq' \ . '|xunmap <buffer> <LocalLeader>q' + \ . '|nunmap <buffer> <LocalLeader>Q' + \ . '|nunmap <buffer> <LocalLeader>QQ' + \ . '|xunmap <buffer> <LocalLeader>Q' diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim index 6e943091..26e95698 100644 --- a/vim/autoload/quote.vim +++ b/vim/autoload/quote.vim @@ -28,3 +28,15 @@ function! quote#QuoteOpfunc(type) abort endfor endfunction + +" Tack on reformatting the edited text afterwards +function! quote#QuoteReformat() abort + set operatorfunc=quote#QuoteReformatOpfunc + return 'g@' +endfunction + +" Wrapper operator function to reformat quoted text afterwards +function! quote#QuoteReformatOpfunc(type) abort + call quote#QuoteOpfunc(a:type) + normal! '[gq'] +endfunction diff --git a/vim/filetype.vim b/vim/filetype.vim index 00e47c0c..0ff4cf76 100644 --- a/vim/filetype.vim +++ b/vim/filetype.vim @@ -231,7 +231,7 @@ augroup filetypedetect \ ?*.markdown \,?*.md \ setfiletype markdown - " Add automatic commands to detect .muttrc files + " Mutt configuration files autocmd BufNewFile,BufRead \ Muttrc \,*/.muttrc.d/*.rc diff --git a/vim/plugin/wildignore.vim b/vim/plugin/wildignore.vim index fb190bce..b87b62b1 100644 --- a/vim/plugin/wildignore.vim +++ b/vim/plugin/wildignore.vim @@ -1,6 +1,6 @@ -" Don't complete certain files that I'm not likely to want to manipulate -" from within Vim; this is kind of expensive to reload, so I've made it a -" plugin with a load guard +" Don't complete certain files that I'm not likely to want to manipulate from +" within Vim; this is kind of expensive to reload, so I've made it a plugin +" with a load guard if v:version < 700 || !has('wildignore') finish endif @@ -170,8 +170,6 @@ nnoremap <silent> <C-L> :<C-U>nohlsearch<CR><C-L> vnoremap <silent> <C-L> :<C-U>nohlsearch<CR>gv<C-L> " Remap insert Ctrl-C to undo the escaped insert operation -" Default to not-quite-correct vim-tiny-compatible map if no plugin -inoremap <Plug>(InsertCancel) <Esc>u imap <C-C> <Plug>(InsertCancel) " Map double Ctrl-K in insert mode to search digraph names |