koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.26k stars 161 forks source link

Add comments and smart indentation for (neo)vim #367

Closed oxalica closed 8 months ago

oxalica commented 11 months ago

It's mostly modified from runtime/indent/lua.vim

Regex is not strong enough to parse all cases, and I try to guess the indentation for common cases. Currently it auto-indents for all fun/fn following a :, assuming that most functions with an explicit return type are NOT defined inline.

I also renamed ftdetect/kokafiletype.vim to ftdetect/koka.vim to fit the naming convention.

daanx commented 8 months ago

Thanks so much!