From 4bdb6ad08291627954b34b1b3387c9373de4ae2a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 17 Jul 2018 10:54:31 +1200 Subject: Don't quote first and last lines of range if blank This allows quoting paragraphs and blocks using { } and similar motions, doing what I mean. --- vim/autoload/quote.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vim/autoload/quote.vim b/vim/autoload/quote.vim index 26e95698..35df76a4 100644 --- a/vim/autoload/quote.vim +++ b/vim/autoload/quote.vim @@ -17,9 +17,16 @@ function! quote#QuoteOpfunc(type) abort " Iterate over each matched line for l:li in range(line('''['), line(''']')) + " Get current line text + let l:cur = getline(l:li) + + " Don't quote the first or last lines if they're blank + if !strlen(l:cur) && (l:li == line('''[') || l:li == line(''']')) + continue + endif + " 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 -- cgit v1.2.3 From a2f8dea21ad00790a39a47a58c183c4a4ba3f4a6 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 17 Jul 2018 11:30:37 +1200 Subject: Add my own ftplugin for awk An official one only got added in early 2016, and it does almost nothing; may as well implement my own instead. --- vim/ftplugin/awk.vim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 vim/ftplugin/awk.vim diff --git a/vim/ftplugin/awk.vim b/vim/ftplugin/awk.vim new file mode 100644 index 00000000..350bc976 --- /dev/null +++ b/vim/ftplugin/awk.vim @@ -0,0 +1,9 @@ +" Only do this when not yet done for this buffer +if exists('b:did_ftplugin') + finish +endif + +" Set comment formats +setlocal comments=:# +setlocal formatoptions+=or +let b:undo_ftplugin = 'setlocal comments< formatoptions<' -- cgit v1.2.3 From 69469b0f076053df4977404d5272f1a9373c3629 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 17 Jul 2018 15:58:30 +1200 Subject: Add handling for older sh.vim syntax g:is_posix --- vim/after/ftplugin/sh.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vim/after/ftplugin/sh.vim b/vim/after/ftplugin/sh.vim index 41b1796f..88254ea6 100644 --- a/vim/after/ftplugin/sh.vim +++ b/vim/after/ftplugin/sh.vim @@ -26,6 +26,11 @@ execute 'compiler '.b:sh_check_compiler let b:undo_ftplugin .= '|unlet b:current_compiler b:sh_check_compiler' \ . '|setlocal errorformat< makeprg<' +" Resort to g:is_posix for correct syntax on older runtime files +if b:is_posix && (v:version < 800 || v:version == 800 && !has('patch257')) + let g:is_posix = 1 +endif + " Stop here if the user doesn't want ftplugin mappings if exists('g:no_plugin_maps') || exists('g:no_sh_maps') finish -- cgit v1.2.3 From d24d4d32fb384c5a35dfa0f01c8da2d156386c98 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Tue, 17 Jul 2018 15:59:31 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b3e92d12..8f530b83 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v1.32.0 -Mon Jul 16 02:08:56 UTC 2018 +tejr dotfiles v1.33.0 +Tue Jul 17 03:59:26 UTC 2018 -- cgit v1.2.3