Fork me on GitHub
#vim
<
2021-12-03
>
walterl01:12:27

Clever! I have a few similar mappings, but tend to add the form to the current buffer, because it's easy enough to send it to the REPL from there (`<localleader>ee` with Conjure), and also to edit afterwards (it's in a normal vim buffer).

sheluchin13:12:09

Thanks @UJY23QLS1. I mentioned in the other thread that I prefer not to put the results in my buffer all the time, especially if the result is very long. At this point, I don't really see much benefit to using a function instead of the macro. Perhaps if my use cases start growing it will make more sense. I am going to try adding -> and ->> macros and seeing if I get much use out of those. I haven't done it yet, but it looks like this would pair nicely with https://vlaaad.github.io/reveal-stickers.

walterl01:12:12

I.e. I'd go for nmap <Leader>if i( *1)<Esc>%a or similar

walterl01:12:34

That adds an extra space before ) when using (I think) auto-pairs; this works better: nmap <Leader>if i( *1<Esc><Right>x%a