Fork me on GitHub
#vim
<
2016-10-18
>
dominicm14:10:36

Wanted to share this little trick I've been using lately, I want to make it take a mark as a parameter. I work on this big project, where a refresh can take around ~20s. My solution is obviously just to re-evaluate the function I'm working on, so I came up with this little mapping: nmap <localleader>ap a<Plug>FireplaceCountPrint<C-o><C-o>` It can easily be optimized (C-o*2 should be for example).. The gist of what it does is jump to mark a, evaluate there, and come back. I sometimes need two of these mappings, depending on what I am doing. So right now I am tweaking a function, and I do ,bp to re-eval it, followed by ,ap to jump to a (comment) I wrote and evaluate that to check it's result, and go back to where I was. This keeps the feedback loop really short — I love it

markwoodhall15:10:51

Is FireplaceCountPrint what usually happens with cpp?

dominicm15:10:30

@markwoodhall yep, but you can't map a map, I think was what tpope said

markwoodhall15:10:04

LOL! So you put a mark on a defn or something and that snippet jumps to the mark, does the equivalent of a cpp and takes you back to where you were?

dominicm15:10:09

Apparently some people created a custom version of cp which let you do things like cpaf without losing your position, which is a really nice tweak.

markwoodhall15:10:15

Can you go to the outer most expression, instead of using a mark?

dominicm15:10:35

^^ my previous message is that I think

markwoodhall15:10:00

What a sentence, "I edit drum sequences in vim". 🤓