From b36260d015c805d9b056d7e5984fcc8e20e45839 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 15 Apr 2014 01:26:34 +0200 Subject: [PATCH] Change puppet vendor, closes #24 --- after/ftplugin/puppet.vim | 11 +++ build | 2 +- ftdetect/polyglot.vim | 2 +- ftplugin/puppet.vim | 143 ++------------------------------------ indent/puppet.vim | 15 ++-- syntax/puppet.vim | 89 ++++++++++++++++++------ 6 files changed, 98 insertions(+), 164 deletions(-) create mode 100644 after/ftplugin/puppet.vim diff --git a/after/ftplugin/puppet.vim b/after/ftplugin/puppet.vim new file mode 100644 index 0000000..2bac2dc --- /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 diff --git a/build b/build index eea71ee..a4ee7de 100755 --- a/build +++ b/build @@ -97,7 +97,7 @@ PACKS=" opencl:petRUShka/vim-opencl perl:vim-perl/vim-perl php:StanAngeloff/php.vim - puppet:ajf/puppet-vim + puppet:rodjek/vim-puppet protobuf:uarun/vim-protobuf python:mitsuhiko/vim-python-combined r-lang:vim-scripts/R.vim diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index 6be7b79..28354d6 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -87,7 +87,7 @@ endif au BufRead,BufNewFile /etc/nginx/*,/usr/local/nginx/*,*/nginx/vhosts.d/*,nginx.conf if &ft == '' | setfiletype nginx | endif au BufRead,BufNewFile *.cl set filetype=opencl autocmd BufNewFile,BufRead *.proto setfiletype proto -au BufRead,BufNewFile *.pp set filetype=puppet +au! BufRead,BufNewFile *.pp setfiletype puppet function! s:setf(filetype) abort if &filetype !=# a:filetype let &filetype = a:filetype diff --git a/ftplugin/puppet.vim b/ftplugin/puppet.vim index 1b00868..175ac12 100644 --- a/ftplugin/puppet.vim +++ b/ftplugin/puppet.vim @@ -1,137 +1,6 @@ -" Vim filetype plugin -" Language: Puppet -" Maintainer: Todd Zullinger -" Last Change: 2009 Aug 19 -" vim: set sw=4 sts=4: - -if exists("b:did_ftplugin") - finish -endif -let b:did_ftplugin = 1 - -if !exists("no_plugin_maps") && !exists("no_puppet_maps") - if !hasmapto("AlignRange") - map = AlignRange - endif -endif - -noremap