diff options
authorTom Ryder <tom@sanctum.geek.nz>2018-08-22 22:22:43 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-08-22 22:22:43 +1200
commitc393832976769d7fde6c8353d26ed829e59d8d53 (patch)
parentMerge branch 'release/v1.58.0' (diff)
parentBump VERSION (diff)
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
9 files changed, 36 insertions, 11 deletions
diff --git a/.gitmodules b/.gitmodules
index 7bc3a80a..ebf3872a 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -44,6 +44,9 @@
[submodule "vim/bundle/redact_pass"]
path = vim/bundle/redact_pass
url = https://sanctum.geek.nz/code/vim-redact-pass.git
+[submodule "vim/bundle/replace_operator"]
+ path = vim/bundle/replace_operator
+ url = https://sanctum.geek.nz/code/vim-replace-operator.git
[submodule "vim/bundle/scroll_next"]
path = vim/bundle/scroll_next
url = https://sanctum.geek.nz/code/vim-scroll-next.git
diff --git a/README.md b/README.md
index eb8ccb94..93005f1c 100644
--- a/README.md
+++ b/README.md
@@ -167,9 +167,8 @@ based on context to include these elements in this order:
You can set `PROMPT_COLOR`, `PROMPT_PREFIX`, and `PROMPT_SUFFIX` too, which all
do about what you'd expect.
-If you start up Bash, Korn shell, or Z shell, and it detects that it's normally
-your `$SHELL` is one of the other two, the prompt will display an appropriate
+If you start up Bash, Korn shell, or Z shell, and it detects that it's not your
+login shell, the prompt will display an appropriate prefix.
This is all managed within the `prompt` function. There's some mildly hacky
logic on `tput` codes included such that it should work correctly for most
diff --git a/VERSION b/VERSION
index 217dab9c..b96a2579 100644
@@ -1,2 +1,2 @@
-tejr dotfiles v1.58.0
-Tue Aug 21 23:17:45 UTC 2018
+tejr dotfiles v1.59.0
+Wed Aug 22 10:22:43 UTC 2018
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')
-" 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
" 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
" 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')
" 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
diff --git a/vim/vimrc b/vim/vimrc
index c59e118e..02f992f3 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -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