Fork me on GitHub
#vim
<
2019-08-27
>
Chase08:08:50

If I have (map #(* % % [1 2 3])) how do I move that collection out of the anon function into its correct spot? Where should the cursor be and is it slurping or barfing? I have vim-sexp, vim-sexp-mappings-for-real-people and parinfer-rust and for some reason it just isn't clicking for me and I know I'm leaving some powerful structural editing capabilities on the table.

tvirolai08:08:47

Put the cursor on the closing parenthesis after the vector and do <)

tvirolai08:08:17

That moves the said parenthesis to the direction of the "arrow". It's barfing since it takes stuff out from between the parentheses.

Chase08:08:20

yes! Thank you. Oh man, I must have tried every combo but the most obvious, correct one. How would you say that command out loud? "Slurp backwards?

Chase08:08:38

the bracket and the parenthesis really do seem like an intuitive way to do this! It makes sense. I'm just absurdly slow on the pickup sometimes. haha. thanks again, I'll keep practicing.

parrot 8
herald08:08:42

the parinfer way to do this would be to place your cursor in insertmode after the last %, then type ). It should barf the collection out of the form.

herald08:08:46

also I'm curious how well it works to combine paredit (vim-sexp) and parinfer. I've switched between them, but never used them both at the same time.

Chase08:08:08

interesting. I don't get that behavior, I wonder if it's because I am using the combination.

herald08:08:54

yep, sounds like they could be conflicting!

Chase08:08:08

Yeah, I haven't quite committed yet so my plan is to kind of learn how to use paredit for structural editing but then have parinfer as my main tool allowing me to use indentation to get where I want.

herald08:08:47

so you're still able to indent forms and parinfer will fix the parens automatically?

Chase08:08:46

yup. That's what I love about it. And then I can use paredit commands when indentation isn't the right method if that makes sense. that way I know basic paredit if I decide to switch back to that.

Chase08:08:22

Say I go back to emacs or something, I didn't like parinfer in emacs at all. And Cursive and Calva use paredit style I think too.

Chase08:08:11

i'm probably holding myself back in both instead of getting the best of both worlds like how I'm imagining but whatevs

herald08:08:04

I think it sounds like a cool approach. I'm only using parinfer now, and in some cases I wish I had my paredit commands.

Chase09:08:43

and here I am wondering if I need the paredit commands. Your description of the parinfer way to do it sounds great so I might experiment going solely with parinfer. lol! Grass is always greener I guess

😁 4
dave11:08:27

i think paredit and parinfer work well together. your setup with vim-sexp, vim-sexp-mappings-for-regular-people, and parinfer-rust is exactly my setup as well, and i haven't run into problems

dave11:08:03

i mostly find myself doing things the parinfer way at this point. i could probably do away with vim-sexp, come to think of it

dave11:08:29

in particular, i use ( and ) in normal mode to move to the nearest paired structural bracket. that one's super handy

dave11:08:43

[[ and ]] to move to the adjacent top level element is also useful

dave11:08:02

...and i use <localleader>o to raise the current form to replace its parent form. ok, so i do still use vim-sexp mappings fairly often, even if i don't realize it! 😄

Chase16:08:23

Lol! Yes, I definitely use the ( and ) a lot but haven't taken advantage of all this other stuff yet.

Chase16:08:53

I'm about to check out some parens of the dead again though and I know that's going to inspire me to level up my structural editing!

Chase16:08:36

He is an emacs guy though but I don't remember if he uses evil or not. But check him out if you haven't.

herald07:08:52

You're going to be left in the dust when Magnar pulls out his custom Clojure-specific emacs macros 😁

lxsli13:08:41

One of my plugins, I think it's vim-sexp? Allows me to use alt-shift-k for that. Mnemonic: h/j for the left bracket, k/l for the right bracket. j/k to move in, h/l to move out.

lxsli13:08:51

I didn't get on with vim-sexp-for-regular-people

lxsli13:08:11

I'm a weirdo, I guess