Fork me on GitHub

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.


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


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


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?


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

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.


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.


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


yep, sounds like they could be conflicting!


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.


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


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.


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.


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


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.


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

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


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


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


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


...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! 😄


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


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!


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.


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


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.


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


I'm a weirdo, I guess