diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-08-22 22:22:43 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-08-22 22:22:43 +1200 |
commit | c393832976769d7fde6c8353d26ed829e59d8d53 (patch) | |
tree | e07454020ea5518037e7da5cfec5555a78e9a312 /vim | |
parent | Merge branch 'release/v1.58.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-1.59.0.tar.gz (sig) dotfiles-1.59.0.zip |
Merge branch 'release/v1.59.0'v1.59.0
* release/v1.59.0:
Bump VERSION
Add replace_operator.vim plugin and config
Adjust mappings for reloading vimrc and filetype
Fix a munted sentence
Add mail shortcut for flagging a message as urgent
Test for g:is_posix existence before purge
Add load guard to bindzone.vim syntax extensions
Diffstat (limited to 'vim')
-rw-r--r-- | vim/after/ftplugin/mail.vim | 5 | ||||
-rw-r--r-- | vim/after/syntax/bindzone.vim | 6 | ||||
-rw-r--r-- | vim/after/syntax/sh.vim | 4 | ||||
-rw-r--r-- | vim/autoload/mail.vim | 9 | ||||
m--------- | vim/bundle/replace_operator | 0 | ||||
-rw-r--r-- | vim/vimrc | 11 |
6 files changed, 29 insertions, 6 deletions
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index c3353cc7..4b6c827c 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -34,7 +34,10 @@ if exists('g:no_plugin_maps') || exists('g:no_mail_maps') finish endif -" Flag a message as unimportant +" Flag messages as important/unimportant +nnoremap <buffer> <LocalLeader>h + \ <C-U>:call mail#FlagImportant()<CR> +let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>h' nnoremap <buffer> <LocalLeader>l \ <C-U>:call mail#FlagUnimportant()<CR> let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>l' diff --git a/vim/after/syntax/bindzone.vim b/vim/after/syntax/bindzone.vim index 19989995..cc50638c 100644 --- a/vim/after/syntax/bindzone.vim +++ b/vim/after/syntax/bindzone.vim @@ -1,3 +1,9 @@ +" 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 " <https://github.com/vim/vim/issues/220> syn keyword zoneRRType contained TLSA SSHFP nextgroup=zoneRData skipwhite diff --git a/vim/after/syntax/sh.vim b/vim/after/syntax/sh.vim index 95b4517d..5c15be61 100644 --- a/vim/after/syntax/sh.vim +++ b/vim/after/syntax/sh.vim @@ -6,7 +6,9 @@ endif " Remove g:is_posix if we resorted to it in order to get correct POSIX sh " highlighting with older Vim runtime files -unlet! g:is_posix g:is_kornshell +if exists('g:is_posix') + unlet g:is_posix g:is_kornshell +endif " If we know we have another shell type, clear away the others completely, now " that core syntax/sh.vim is done prodding /bin/sh to determine the system diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim index 6bec6e55..baff4bbf 100644 --- a/vim/autoload/mail.vim +++ b/vim/autoload/mail.vim @@ -1,3 +1,12 @@ +" Flag a message as important +function! mail#FlagImportant() abort + call cursor(1, 1) + call search('^$') + - + call append(line('.'), 'X-Priority: 1') + call append(line('.'), 'Importance: High') +endfunction + " Flag a message as unimportant function! mail#FlagUnimportant() abort call cursor(1, 1) diff --git a/vim/bundle/replace_operator b/vim/bundle/replace_operator new file mode 160000 +Subproject 172fbc5f7e346c26c3cc64335de1e33347f7905 @@ -265,6 +265,8 @@ nnoremap <Bslash>D :read !date -u<CR> nnoremap <Bslash>e :<C-U>setlocal modifiable noreadonly<CR> " \f shows the current 'formatoptions' at a glance nnoremap <Bslash>f :<C-U>setlocal formatoptions?<CR> +" \F reloads filetype +nnoremap <Bslash>F :<C-U>doautocmd filetypedetect BufRead<CR> " \g changes directory to the current file's location nnoremap <Bslash>g :<C-U>cd %:h<CR>:pwd<CR> " \h toggles highlighting search results @@ -295,10 +297,11 @@ nmap <Bslash>O <Plug>(PasteOpenAbove) nnoremap <Bslash>p :<C-U>set paste! paste?<CR> " \q formats the current paragraph nnoremap <Bslash>q gqap -" \r reloads .vimrc -nnoremap <Bslash>r :<C-U>source $MYVIMRC<CR> -" \R reloads filetype -nnoremap <Bslash>R :<C-U>doautocmd filetypedetect BufRead<CR> +" \r acts as a replacement operator +nmap <Bslash>r <Plug>(ReplaceOperator) +xmap <Bslash>r <Plug>(ReplaceOperator) +" \R reloads ~/.vimrc +nnoremap <Bslash>R :<C-U>source $MYVIMRC<CR> " \s toggles spell checking nnoremap <Bslash>s :<C-U>setlocal spell! spell?<CR> " \t shows current filetype |