diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-04-15 01:26:34 +0200 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-04-15 01:26:34 +0200 |
commit | b36260d015c805d9b056d7e5984fcc8e20e45839 (patch) | |
tree | 69c9fb818b5b58e894246ad7c99fa483a60d9766 /after/ftplugin/puppet.vim | |
parent | 6c198a3ca9c392069c119282b702028fbfb5edf3 (diff) | |
download | vim-polyglot-b36260d015c805d9b056d7e5984fcc8e20e45839.tar.gz vim-polyglot-b36260d015c805d9b056d7e5984fcc8e20e45839.zip |
Change puppet vendor, closes #24
Diffstat (limited to 'after/ftplugin/puppet.vim')
-rw-r--r-- | after/ftplugin/puppet.vim | 11 |
1 files changed, 11 insertions, 0 deletions
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 <buffer> <silent> > ><Esc>:call <SID>puppetalign()<CR>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 |