aboutsummaryrefslogtreecommitdiff
path: root/vim/indent/puppet.vim
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-06-11 23:21:38 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-06-11 23:21:38 +0200
commit252cea169185f5a57acb6913f622950bb27458f8 (patch)
tree33bc09c6a5abd5bd46faec09c10de226a9993a5c /vim/indent/puppet.vim
parente19087bc292678a526a8c780bbdc58b38dcecc2c (diff)
Drop support for vim, cleanup nvim config
Diffstat (limited to 'vim/indent/puppet.vim')
-rw-r--r--vim/indent/puppet.vim76
1 files changed, 0 insertions, 76 deletions
diff --git a/vim/indent/puppet.vim b/vim/indent/puppet.vim
deleted file mode 100644
index 689e068..0000000
--- a/vim/indent/puppet.vim
+++ /dev/null
@@ -1,76 +0,0 @@
-" Vim indent file
-" Language: Puppet
-" Maintainer: Todd Zullinger <tmz@pobox.com>
-" Last Change: 2009 Aug 19
-" vim: set sw=4 sts=4:
-
-if exists("b:did_indent")
- finish
-endif
-let b:did_indent = 1
-
-setlocal autoindent smartindent
-setlocal indentexpr=GetPuppetIndent()
-setlocal indentkeys+=0],0)
-
-if exists("*GetPuppetIndent")
- finish
-endif
-
-" Check if a line is part of an include 'block', e.g.:
-" include foo,
-" bar,
-" baz
-function! s:PartOfInclude(lnum)
- let lnum = a:lnum
- while lnum
- let lnum = lnum - 1
- let line = getline(lnum)
- if line !~ ',$'
- break
- endif
- if line =~ '^\s*include\s\+[^,]\+,$'
- return 1
- endif
- endwhile
- return 0
-endfunction
-
-function! s:OpenBrace(lnum)
- call cursor(a:lnum, 1)
- return searchpair('{\|\[\|(', '', '}\|\]\|)', 'nbW')
-endfunction
-
-function! GetPuppetIndent()
- let pnum = prevnonblank(v:lnum - 1)
- if pnum == 0
- return 0
- endif
-
- let line = getline(v:lnum)
- let pline = getline(pnum)
- let ind = indent(pnum)
-
- if pline =~ '^\s*#'
- return ind
- endif
-
- if pline =~ '\({\|\[\|(\|:\)$'
- let ind += &sw
- elseif pline =~ ';$' && pline !~ '[^:]\+:.*[=+]>.*'
- let ind -= &sw
- elseif pline =~ '^\s*include\s\+.*,$'
- let ind += &sw
- endif
-
- if pline !~ ',$' && s:PartOfInclude(pnum)
- let ind -= &sw
- endif
-
- " Match } }, }; ] ]: )
- if line =~ '^\s*\(}\(,\|;\)\?$\|]:\?$\|)\)'
- let ind = indent(s:OpenBrace(v:lnum))
- endif
-
- return ind
-endfunction