You know in vim, let's say I have this...
poi {:uuid id
:name name
:label label
:location location
:active active}]))
and I want to delete poi
, but have the {}
block shift over to the left as I delete each character of POI (or delete the entire word POI)....how do?
I guess the delete has to be aware that it has to shift the entire map left
isn't that a job for an auto-formatter instead?
You would think 🙂 I use parinfer
but if I delete the poi
, it ends up like this
ah! then it should do it
I guess
{:uuid id
:name name
:label label
:location location
:active active}]))
it dosn't shift over the rest of the contents of the map
I had a similar problem when raising forms using vim-sexp, the indentation would not be updated. But I'd expect that to work with parinfer, yes.
It should, according to Paren Mode
letmeresearch
ah-ha!
switching to let g:parinfer_mode = 'smart'
or let g:parinfer_mode = 'indent'
solves the problem
Interesting. I've just burned =-
into my muscle memory to reformat after such an operation.
@dharrigan i also use parinfer. in a situation like that, i usually put my cursor on the {
and press ==
or =%
@nate what is =-
? i'm intrigued!
...ah yes, and i actually don't have this problem because when i delete poi
, the entire map shifts to the left
:echo g:parinfer_mode
does display smart
, so that makes sense
@dave =-
is a mapping provided by vim-sexp that reindents from the top form
just like ==
indents the form you're cursor is in
oh, cool!
that's super useful
does parinfer provide the ==
mapping or do you also have vim-sexp installed?
i have vim-sexp installed. looks like it's being provided by vim-sexp
thanks all 🙂