PATH:
usr
/
share
/
vim
/
vim82
/
indent
" Vim indent file " Language: Cucumber " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2017 Jun 13 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetCucumberIndent() setlocal indentkeys=o,O,*<Return>,<:>,0<Bar>,0#,=,!^F let b:undo_indent = 'setl ai< inde< indk<' " Only define the function once. if exists("*GetCucumberIndent") finish endif function! s:syn(lnum) return synIDattr(synID(a:lnum,1+indent(a:lnum),1),'name') endfunction function! GetCucumberIndent() let line = getline(prevnonblank(v:lnum-1)) let cline = getline(v:lnum) let nline = getline(nextnonblank(v:lnum+1)) let sw = exists('*shiftwidth') ? shiftwidth() : shiftwidth() let syn = s:syn(prevnonblank(v:lnum-1)) let csyn = s:syn(v:lnum) let nsyn = s:syn(nextnonblank(v:lnum+1)) if csyn ==# 'cucumberFeature' || cline =~# '^\s*Feature:' " feature heading return 0 elseif csyn ==# 'cucumberExamples' || cline =~# '^\s*\%(Examples\|Scenarios\):' " examples heading return 2 * sw elseif csyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || cline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):' " background, scenario or outline heading return sw elseif syn ==# 'cucumberFeature' || line =~# '^\s*Feature:' " line after feature heading return sw elseif syn ==# 'cucumberExamples' || line =~# '^\s*\%(Examples\|Scenarios\):' " line after examples heading return 3 * sw elseif syn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || line =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):' " line after background, scenario or outline heading return 2 * sw elseif cline =~# '^\s*[@#]' && (nsyn == 'cucumberFeature' || nline =~# '^\s*Feature:' || indent(prevnonblank(v:lnum-1)) <= 0) " tag or comment before a feature heading return 0 elseif cline =~# '^\s*@' " other tags return sw elseif cline =~# '^\s*[#|]' && line =~# '^\s*|' " mid-table " preserve indent return indent(prevnonblank(v:lnum-1)) elseif cline =~# '^\s*|' && line =~# '^\s*[^|]' " first line of a table, relative indent return indent(prevnonblank(v:lnum-1)) + sw elseif cline =~# '^\s*[^|]' && line =~# '^\s*|' " line after a table, relative unindent return indent(prevnonblank(v:lnum-1)) - sw elseif cline =~# '^\s*#' && getline(v:lnum-1) =~ '^\s*$' && (nsyn =~# '^cucumber\%(Background\|Scenario\|ScenarioOutline\)$' || nline =~# '^\s*\%(Background\|Scenario\|Scenario Outline\):') " comments on scenarios return sw endif return indent(prevnonblank(v:lnum-1)) endfunction " vim:set sts=2 sw=2:
[+]
..
[-] mp.vim
[open]
[-] htmldjango.vim
[open]
[-] j.vim
[open]
[-] docbk.vim
[open]
[-] nsis.vim
[open]
[-] less.vim
[open]
[-] dune.vim
[open]
[-] yacc.vim
[open]
[-] framescript.vim
[open]
[-] eiffel.vim
[open]
[-] gitconfig.vim
[open]
[-] jsp.vim
[open]
[-] prolog.vim
[open]
[-] cucumber.vim
[open]
[-] bash.vim
[open]
[-] ant.vim
[open]
[-] dtd.vim
[open]
[-] tex.vim
[open]
[-] json.vim
[open]
[-] automake.vim
[open]
[-] tcl.vim
[open]
[-] tilde.vim
[open]
[-] java.vim
[open]
[-] context.vim
[open]
[-] sshconfig.vim
[open]
[-] matlab.vim
[open]
[-] dylan.vim
[open]
[-] README.txt
[open]
[-] html.vim
[open]
[-] eterm.vim
[open]
[-] cpp.vim
[open]
[-] scss.vim
[open]
[-] logtalk.vim
[open]
[-] objc.vim
[open]
[-] raml.vim
[open]
[-] sh.vim
[open]
[-] xsd.vim
[open]
[-] sass.vim
[open]
[-] d.vim
[open]
[-] xf86conf.vim
[open]
[-] pov.vim
[open]
[-] verilog.vim
[open]
[-] ld.vim
[open]
[-] dtrace.vim
[open]
[-] eruby.vim
[open]
[-] perl.vim
[open]
[-] xhtml.vim
[open]
[-] go.vim
[open]
[-] lifelines.vim
[open]
[-] ch.vim
[open]
[-] lua.vim
[open]
[-] falcon.vim
[open]
[-] dictconf.vim
[open]
[-] config.vim
[open]
[-] chaiscript.vim
[open]
[-] sas.vim
[open]
[-] bib.vim
[open]
[-] ocaml.vim
[open]
[-] ada.vim
[open]
[-] pascal.vim
[open]
[-] aap.vim
[open]
[-] dictdconf.vim
[open]
[-] mf.vim
[open]
[-] perl6.vim
[open]
[-] xslt.vim
[open]
[-] php.vim
[open]
[-] occam.vim
[open]
[-] r.vim
[open]
[-] meson.vim
[open]
[-] systemverilog.vim
[open]
[-] scheme.vim
[open]
[-] ishd.vim
[open]
[-] scala.vim
[open]
[-] liquid.vim
[open]
[-] xinetd.vim
[open]
[-] rhelp.vim
[open]
[-] haml.vim
[open]
[-] erlang.vim
[open]
[-] elm.vim
[open]
[-] yaml.vim
[open]
[-] xml.vim
[open]
[-] javascriptreact.vim
[open]
[-] wast.vim
[open]
[-] ruby.vim
[open]
[-] cobol.vim
[open]
[-] zimbu.vim
[open]
[-] vim.vim
[open]
[-] tf.vim
[open]
[-] sql.vim
[open]
[-] clojure.vim
[open]
[-] rrst.vim
[open]
[-] lisp.vim
[open]
[-] css.vim
[open]
[-] bzl.vim
[open]
[-] cs.vim
[open]
[-] sml.vim
[open]
[-] typescript.vim
[open]
[-] vroom.vim
[open]
[-] javascript.vim
[open]
[-] gitolite.vim
[open]
[-] idlang.vim
[open]
[-] mail.vim
[open]
[-] c.vim
[open]
[-] vb.vim
[open]
[-] systemd.vim
[open]
[-] hog.vim
[open]
[-] make.vim
[open]
[-] vhdl.vim
[open]
[-] sqlanywhere.vim
[open]
[-] postscr.vim
[open]
[-] rnoweb.vim
[open]
[-] mma.vim
[open]
[-] treetop.vim
[open]
[-] cmake.vim
[open]
[-] dosbatch.vim
[open]
[-] hamster.vim
[open]
[-] sdl.vim
[open]
[-] zsh.vim
[open]
[-] fortran.vim
[open]
[-] rpl.vim
[open]
[-] teraterm.vim
[open]
[-] python.vim
[open]
[-] changelog.vim
[open]
[-] tcsh.vim
[open]
[-] cdl.vim
[open]
[-] bst.vim
[open]
[-] awk.vim
[open]
[-] pyrex.vim
[open]
[-] cuda.vim
[open]
[-] rust.vim
[open]
[-] readline.vim
[open]
[-] rst.vim
[open]
[-] rmd.vim
[open]