Closed 9seconds closed 8 years ago
This is not configurable. I can't decide whether or not I like it now that I've been using it for a while. It was originally 2 lines, but that felt too far to go to dedent in some cases. I wanted to be able to maintain momentum while coding, but I guess that'll be hard to achieve without braces.
Perhaps it should be left so that the indent stays with the block body's indent level, but only dedent when there's clear call for it, like right after a return
. What do you think?
I can't think of any off the top of my head, but can you think of any other cases where a blank line from the user should almost always dedent?
Dedenting after return
is going to work in my case but I think that it might break other people usecases where there is no explicit return
statement (function returns None
implicitly): in such cases current behavior works really well.
Is it possible to add option like g:braceless_dedent_after_return_only
with default 0
? What do you think?
@9seconds Sorry for the delayed response. I think an option to tune or turn off auto-dedent is a good idea. I'll work on adding it when I find some spare time today.
It also might be a good idea to point out the use of insert mode <c-i>
and <c-d>
in the docs since tabs is so important to Python dev.
@9seconds Added g:braceless_auto_dedent_gap
. Set it to 0
to disable or some other number to define the blank line gap before dedent. It can use the b:
prefix if you want it to be per-buffer.
Hi!
braceless works great but I want to tune it a bit for my own need. Is it possible to dedent if I press Enter 2 times, not 1?
An example: usually I write functions like this, with blocks, separated by 1 empty lines:
If I type
items = []
then it is not possible to press Enter 2 times to inputfor elements in elements
, because, well, after first keypress I dedent. But as a workaround, if I enterreturn
at the start, it works as expected.Do I need to set anything in my vimrc to support such behavior? Or how can I tune braceless to work as I want?
Thanks!