moe
moe copied to clipboard
Enhance Autoindent
Auto indent the next line when:
- The line is
var
,let
orconst
- The line finishes with
or
,and
orobject
- The instruction isn't complete (eg: Parenthesis aren't closed)
And this: (<>
represents the indentation, |
the cursor)
fn main() {|}
<Return>
fn main() {
<>|
}
or
echo someFunc(|)
<Return>
echo someFunc(
<>|
)
See https://github.com/zah/nim.vim
- Implement the same you did for
{}
but for()
and[]
1.1) Edit: I saw you did it for other languages but not for Nim - Indent when defining a function/procedure:
proc a() =<return>
@uninhm
Thank you for your feedback. I will fix them.
https://github.com/fox0430/moe/blob/develop/src/moepkg/editor.nim#L289
My question is, why not? It's not LISP...
At least in Python I'm pretty sure that the "standard" style is
function(
arg1,
arg2
)
(with a new line after the last parameter)
@uninhm
Thank you for the advice. I don't use Python. Ok, I will fix it.