PATH:
usr
/
share
/
vim
/
vim74
/
indent
" Vim indent file " Language: eRuby " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " URL: https://github.com/vim-ruby/vim-ruby " Release Coordinator: Doug Kearns <dougkearns@gmail.com> if exists("b:did_indent") finish endif runtime! indent/ruby.vim unlet! b:did_indent setlocal indentexpr= if exists("b:eruby_subtype") exe "runtime! indent/".b:eruby_subtype.".vim" else runtime! indent/html.vim endif unlet! b:did_indent if &l:indentexpr == '' if &l:cindent let &l:indentexpr = 'cindent(v:lnum)' else let &l:indentexpr = 'indent(prevnonblank(v:lnum-1))' endif endif let b:eruby_subtype_indentexpr = &l:indentexpr let b:did_indent = 1 setlocal indentexpr=GetErubyIndent() setlocal indentkeys=o,O,*<Return>,<>>,{,},0),0],o,O,!^F,=end,=else,=elsif,=rescue,=ensure,=when " Only define the function once. if exists("*GetErubyIndent") finish endif function! GetErubyIndent(...) if a:0 && a:1 == '.' let v:lnum = line('.') elseif a:0 && a:1 =~ '^\d' let v:lnum = a:1 endif let vcol = col('.') call cursor(v:lnum,1) let inruby = searchpair('<%','','%>','W') call cursor(v:lnum,vcol) if inruby && getline(v:lnum) !~ '^<%\|^\s*[-=]\=%>' let ind = GetRubyIndent(v:lnum) else exe "let ind = ".b:eruby_subtype_indentexpr endif let lnum = prevnonblank(v:lnum-1) let line = getline(lnum) let cline = getline(v:lnum) if cline =~# '^\s*<%[-=]\=\s*\%(}\|end\|else\|\%(ensure\|rescue\|elsif\|when\).\{-\}\)\s*\%([-=]\=%>\|$\)' let ind = ind - &sw endif if line =~# '\S\s*<%[-=]\=\s*\%(}\|end\).\{-\}\s*\%([-=]\=%>\|$\)' let ind = ind - &sw endif if line =~# '\%({\|\<do\)\%(\s*|[^|]*|\)\=\s*[-=]\=%>' let ind = ind + &sw elseif line =~# '<%[-=]\=\s*\%(module\|class\|def\|if\|for\|while\|until\|else\|elsif\|case\|when\|unless\|begin\|ensure\|rescue\)\>.*%>' let ind = ind + &sw endif if line =~# '^\s*<%[=#-]\=\s*$' && cline !~# '^\s*end\>' let ind = ind + &sw endif if line !~# '^\s*<%' && line =~# '%>\s*$' let ind = ind - &sw endif if cline =~# '^\s*[-=]\=%>\s*$' let ind = ind - &sw endif return ind endfunction " vim:set sw=2 sts=2 ts=8 noet:
[-] rpl.vim
[edit]
[-] zimbu.vim
[edit]
[-] bib.vim
[edit]
[-] c.vim
[edit]
[-] make.vim
[edit]
[-] sml.vim
[edit]
[-] logtalk.vim
[edit]
[-] postscr.vim
[edit]
[-] eruby.vim
[edit]
[-] ada.vim
[edit]
[-] r.vim
[edit]
[-] sql.vim
[edit]
[-] liquid.vim
[edit]
[-] xsd.vim
[edit]
[-] tex.vim
[edit]
[-] aap.vim
[edit]
[-] matlab.vim
[edit]
[-] mma.vim
[edit]
[-] ishd.vim
[edit]
[+]
..
[-] cs.vim
[edit]
[-] dtd.vim
[edit]
[-] python.vim
[edit]
[-] changelog.vim
[edit]
[-] treetop.vim
[edit]
[-] tcsh.vim
[edit]
[-] xhtml.vim
[edit]
[-] sqlanywhere.vim
[edit]
[-] perl6.vim
[edit]
[-] idlang.vim
[edit]
[-] cucumber.vim
[edit]
[-] hamster.vim
[edit]
[-] verilog.vim
[edit]
[-] java.vim
[edit]
[-] pov.vim
[edit]
[-] cuda.vim
[edit]
[-] README.txt
[edit]
[-] d.vim
[edit]
[-] tf.vim
[edit]
[-] gitconfig.vim
[edit]
[-] scss.vim
[edit]
[-] cmake.vim
[edit]
[-] tcl.vim
[edit]
[-] yaml.vim
[edit]
[-] zsh.vim
[edit]
[-] pascal.vim
[edit]
[-] objc.vim
[edit]
[-] pyrex.vim
[edit]
[-] occam.vim
[edit]
[-] automake.vim
[edit]
[-] xml.vim
[edit]
[-] fortran.vim
[edit]
[-] xslt.vim
[edit]
[-] eiffel.vim
[edit]
[-] yacc.vim
[edit]
[-] ch.vim
[edit]
[-] htmldjango.vim
[edit]
[-] lifelines.vim
[edit]
[-] ant.vim
[edit]
[-] erlang.vim
[edit]
[-] vim.vim
[edit]
[-] vb.vim
[edit]
[-] tilde.vim
[edit]
[-] mp.vim
[edit]
[-] vhdl.vim
[edit]
[-] ocaml.vim
[edit]
[-] css.vim
[edit]
[-] lua.vim
[edit]
[-] chaiscript.vim
[edit]
[-] perl.vim
[edit]
[-] eterm.vim
[edit]
[-] haml.vim
[edit]
[-] falcon.vim
[edit]
[-] awk.vim
[edit]
[-] dictconf.vim
[edit]
[-] scheme.vim
[edit]
[-] dictdconf.vim
[edit]
[-] docbk.vim
[edit]
[-] xinetd.vim
[edit]
[-] framescript.vim
[edit]
[-] rst.vim
[edit]
[-] dtrace.vim
[edit]
[-] ruby.vim
[edit]
[-] javascript.vim
[edit]
[-] dylan.vim
[edit]
[-] ld.vim
[edit]
[-] php.vim
[edit]
[-] xf86conf.vim
[edit]
[-] sass.vim
[edit]
[-] sdl.vim
[edit]
[-] gitolite.vim
[edit]
[-] prolog.vim
[edit]
[-] html.vim
[edit]
[-] bst.vim
[edit]
[-] config.vim
[edit]
[-] cdl.vim
[edit]
[-] lisp.vim
[edit]
[-] mail.vim
[edit]
[-] cpp.vim
[edit]
[-] cobol.vim
[edit]
[-] clojure.vim
[edit]
[-] jsp.vim
[edit]
[-] sh.vim
[edit]
[-] readline.vim
[edit]