summaryrefslogtreecommitdiffstats
path: root/indent
diff options
context:
space:
mode:
Diffstat (limited to 'indent')
-rw-r--r--indent/pony.vim41
1 files changed, 41 insertions, 0 deletions
diff --git a/indent/pony.vim b/indent/pony.vim
new file mode 100644
index 00000000..613dae6e
--- /dev/null
+++ b/indent/pony.vim
@@ -0,0 +1,41 @@
+if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'pony') == -1
+
+" Vim indent file
+" Language: Pony
+" Maintainer: Jak Wings
+
+if exists('b:did_indent')
+ finish
+endif
+
+let s:cpo_save = &cpo
+set cpo&vim
+
+
+setlocal nolisp
+setlocal nocindent
+setlocal nosmartindent
+setlocal autoindent
+setlocal indentexpr=pony#Indent()
+setlocal indentkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
+setlocal cinkeys=!^F,o,O,0\|,0(,0),0[,0],0{,0},0==>,0=\"\"\",0=end,0=then,0=else,0=in,0=do,0=until,0=actor,0=class,0=struct,0=primitive,0=trait,0=interface,0=new,0=be,0=fun,0=type,0=use
+setlocal cinwords=ifdef,if,match,while,for,repeat,try,with,recover,object,lambda,then,elseif,else,until,do,actor,class,struct,primitive,trait,interface,new,be,fun,iftype,elseiftype
+
+augroup pony
+ autocmd! * <buffer>
+ autocmd CursorHold <buffer> call pony#ClearTrailingSpace(1, 1)
+ "autocmd InsertEnter <buffer> call pony#ClearTrailingSpace(0, 0)
+ autocmd InsertLeave <buffer> call pony#ClearTrailingSpace(0, 1)
+ autocmd BufWritePre <buffer> call pony#ClearTrailingSpace(1, 0, 1)
+augroup END
+
+let b:undo_indent = 'set lisp< cindent< autoindent< smartindent< indentexpr< indentkeys< cinkeys< cinwords<'
+ \ . ' | execute("autocmd! pony * <buffer>")'
+
+
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
+let b:did_indent = 1
+
+endif