From b36260d015c805d9b056d7e5984fcc8e20e45839 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 15 Apr 2014 01:26:34 +0200 Subject: Change puppet vendor, closes #24 --- after/ftplugin/puppet.vim | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 after/ftplugin/puppet.vim (limited to 'after/ftplugin/puppet.vim') diff --git a/after/ftplugin/puppet.vim b/after/ftplugin/puppet.vim new file mode 100644 index 00000000..2bac2dc8 --- /dev/null +++ b/after/ftplugin/puppet.vim @@ -0,0 +1,11 @@ +inoremap > >:call puppetalign()A +function! s:puppetalign() + let p = '^\s*\w+\s*[=+]>.*$' + let lineContainsHashrocket = getline('.') =~# '^\s*\w+\s*[=+]>' + let hashrocketOnPrevLine = getline(line('.') - 1) =~# p + let hashrocketOnNextLine = getline(line('.') + 1) =~# p + if exists(':Tabularize') " && lineContainsHashrocket && (hashrocketOnPrevLine || hashrocketOnNextLine) + Tabularize /=>/l1 + normal! 0 + endif +endfunction -- cgit v1.2.3