Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/vim73/indent/tilde.vim
diff options
context:
space:
mode:
authorGeroge Hunt <georgejhunt@gmail.com>2011-02-26 20:19:01 (GMT)
committer Geroge Hunt <georgejhunt@gmail.com>2011-02-26 20:19:01 (GMT)
commitfb6211451e0aa64e36ba309934746c12f9ebd869 (patch)
tree2c8f7cbb26f97654a9d7b6b6b26a82a53bc64f07 /vim73/indent/tilde.vim
create initial snapshotHEADmaster
Diffstat (limited to 'vim73/indent/tilde.vim')
-rw-r--r--vim73/indent/tilde.vim36
1 files changed, 36 insertions, 0 deletions
diff --git a/vim73/indent/tilde.vim b/vim73/indent/tilde.vim
new file mode 100644
index 0000000..5fdcfe0
--- /dev/null
+++ b/vim73/indent/tilde.vim
@@ -0,0 +1,36 @@
+"Description: Indent scheme for the tilde weblanguage
+"Author: Tobias Rundström <tobi@tobi.nu>
+"URL: http://tilde.tildesoftware.net
+"Last Change: May 8 09:15:09 CEST 2002
+
+if exists ("b:did_indent")
+ finish
+endif
+
+let b:did_indent = 1
+
+setlocal autoindent
+setlocal indentexpr=GetTildeIndent(v:lnum)
+setlocal indentkeys=o,O,)
+
+if exists("*GetTildeIndent")
+ finish
+endif
+
+function GetTildeIndent(lnum)
+ let plnum = prevnonblank(v:lnum-1)
+
+ if plnum == 0
+ return 0
+ endif
+
+ if getline(v:lnum) =~ '^\s*\~\(endif\|else\|elseif\|end\)\>'
+ return indent(v:lnum) - &sw
+ endif
+
+ if getline(plnum) =~ '^\s*\~\(if\|foreach\|foreach_row\|xml_loop\|file_loop\|file_write\|file_append\|imap_loopsections\|imap_index\|imap_list\|ldap_search\|post_loopall\|post_loop\|file_loop\|sql_loop_num\|sql_dbmsselect\|search\|sql_loop\|post\|for\|function_define\|silent\|while\|setvalbig\|mail_create\|systempipe\|mail_send\|dual\|elseif\|else\)\>'
+ return indent(plnum) + &sw
+ else
+ return -1
+ endif
+endfunction