2 " Language: tf (TinyFugue)
3 " Maintainer: Christian J. Robinson <infynity@onewest.net>
4 " URL: http://www.infynity.spodzone.com/vim/indent/tf.vim
5 " Last Change: 2002 May 29
7 " Only load this indent file when no other was loaded.
8 if exists("b:did_indent")
13 setlocal indentexpr=GetTFIndent()
14 setlocal indentkeys-=0{,0} indentkeys-=0# indentkeys-=:
15 setlocal indentkeys+==/endif,=/then,=/else,=/done,0;
17 " Only define the function once:
18 if exists("*GetTFIndent")
22 function GetTFIndent()
23 " Find a non-blank line above the current line:
24 let lnum = prevnonblank(v:lnum - 1)
26 " No indent for the start of the file:
31 let ind = indent(lnum)
32 let line = getline(lnum)
34 " No indentation if the previous line didn't end with "\":
35 " (Could be annoying, but it lets you know if you made a mistake.)
40 if line =~ '\(/def.*\\\|/for.*\(%;\s*\)\@\<!\\\)$'
42 elseif line =~ '\(/if\|/else\|/then\)'
46 elseif line =~ '/while'
52 let line = getline(v:lnum)
54 if line =~ '\(/else\|/endif\|/then\)'
58 elseif line =~ '/done'
64 " Comments at the beginning of a line: