aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-17 15:59:39 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-17 15:59:39 +1200
commita9e59520d7efade3aeed9977cc64b32004af7dcb (patch)
tree60e323e2f45c2964966e366ea1ce47d38d945151
parentMerge branch 'release/v1.32.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-1.33.0.tar.gz (sig)
dotfiles-1.33.0.zip
Merge branch 'release/v1.33.0'v1.33.0
* release/v1.33.0: Bump VERSION Add handling for older sh.vim syntax g:is_posix Add my own ftplugin for awk Don't quote first and last lines of range if blank
-rw-r--r--VERSION4
-rw-r--r--vim/after/ftplugin/sh.vim5
-rw-r--r--vim/autoload/quote.vim9
-rw-r--r--vim/ftplugin/awk.vim9
4 files changed, 24 insertions, 3 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
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
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
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<'