From e56640efe743b45077f1580caa23a0f934b49770 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 11:36:28 +1200 Subject: Add load guard to bindzone.vim syntax extensions --- vim/after/syntax/bindzone.vim | 6 ++++++ 1 file changed, 6 insertions(+) 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 " syn keyword zoneRRType contained TLSA SSHFP nextgroup=zoneRData skipwhite -- cgit v1.2.3 From 8a78723bd3146fe9acc1289667cfb12587ccdab3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 11:38:59 +1200 Subject: Test for g:is_posix existence before purge --- vim/after/syntax/sh.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3 From 320169d17759f10e84f836ad41b879f5fe8a7bd1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 13:10:37 +1200 Subject: Add mail shortcut for flagging a message as urgent --- vim/after/ftplugin/mail.vim | 5 ++++- vim/autoload/mail.vim | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) 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 h + \ :call mail#FlagImportant() +let b:undo_ftplugin .= '|nunmap h' nnoremap l \ :call mail#FlagUnimportant() let b:undo_ftplugin .= '|nunmap l' 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) -- cgit v1.2.3 From 8ffac1827b02e27f03399b30c7a90929aaeb7ca9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 20:26:12 +1200 Subject: Fix a munted sentence --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 -prefix. +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 -- cgit v1.2.3 From 411f2ae54847a0008138a5b3c4b5e2279b3b6f93 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 22:21:16 +1200 Subject: Adjust mappings for reloading vimrc and filetype This is to make room for a new \r mapping, shortly. --- vim/vimrc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index c59e118e..faaa438c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -265,6 +265,8 @@ nnoremap D :read !date -u nnoremap e :setlocal modifiable noreadonly " \f shows the current 'formatoptions' at a glance nnoremap f :setlocal formatoptions? +" \F reloads filetype +nnoremap F :doautocmd filetypedetect BufRead " \g changes directory to the current file's location nnoremap g :cd %:h:pwd " \h toggles highlighting search results @@ -295,10 +297,8 @@ nmap O (PasteOpenAbove) nnoremap p :set paste! paste? " \q formats the current paragraph nnoremap q gqap -" \r reloads .vimrc -nnoremap r :source $MYVIMRC -" \R reloads filetype -nnoremap R :doautocmd filetypedetect BufRead +" \R reloads ~/.vimrc +nnoremap R :source $MYVIMRC " \s toggles spell checking nnoremap s :setlocal spell! spell? " \t shows current filetype -- cgit v1.2.3 From d7372cfa35f593af7e157d87d1c6fef1b007b52d Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 22:22:23 +1200 Subject: Add replace_operator.vim plugin and config --- .gitmodules | 3 +++ vim/bundle/replace_operator | 1 + vim/vimrc | 3 +++ 3 files changed, 7 insertions(+) create mode 160000 vim/bundle/replace_operator 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/vim/bundle/replace_operator b/vim/bundle/replace_operator new file mode 160000 index 00000000..172fbc5f --- /dev/null +++ b/vim/bundle/replace_operator @@ -0,0 +1 @@ +Subproject commit 172fbc5f7e346c26c3cc64335de1e33347f79058 diff --git a/vim/vimrc b/vim/vimrc index faaa438c..02f992f3 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -297,6 +297,9 @@ nmap O (PasteOpenAbove) nnoremap p :set paste! paste? " \q formats the current paragraph nnoremap q gqap +" \r acts as a replacement operator +nmap r (ReplaceOperator) +xmap r (ReplaceOperator) " \R reloads ~/.vimrc nnoremap R :source $MYVIMRC " \s toggles spell checking -- cgit v1.2.3 From 82f81b8bcd79ab67c6977d1414c73755f51c79b6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 22 Aug 2018 22:22:43 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 217dab9c..b96a2579 100644 --- a/VERSION +++ b/VERSION @@ -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 -- cgit v1.2.3