And you love the way vim allowed you to do crazy stuff inside a map. But now you're in emacs, so let's see how we can scratch your itch.
My concrete case was inserting strings like (?* ?x) where x is a parameter.
- Skeletons. Skeletons can do that and much more. it's a classical template inserter. For example, you can setup a skeleton of the desired output and interleave str symbol, that will be replaced for the input you'enter.
Skeleton can do more sophisticated things, like inserting multiple lines while user keeps entering data. I can imagine myself using this when entering lots of data with some desired format.
- Yasnippets. Yasnippets are skeletons on steroids. Sad thing is that there's no direct way to bypass the file used to define snippets. I guess you can open a new buffer, put it into yasnippet-mode, and c-c c-c to activate the binding for just this session, but maybe it's too much of a hassle.
- defun+insert. The dumb way to do it, but the most straightforward if you tend to forget rarely used functionalities like skeletons. Just define an interactive function that inserts your shit there, and call it at will. That's the option I go when I don't wanna spend a minute looking for skeleton docs.
Then to call the functions/skeletons, you have different ways, if you want to global-set-key, or even just set the key in insert mode (using evil), reminding of imap style,
I'd love to hear other solutions on that same issue. Any suggestions?