Is there a simple way to surround text, I know about this plugin
But too much keys.
I tried my approach
vmap ' <D-x>i'<esc><D-v>i'
vmap " <D-x>i"<esc><D-v>i"
But this does not work. Anyway if this way is fixed how could I extract this behaviour to a function that allows me this:
- I select any text (I think this would be visual mode)
- I enter any symbol in a given set for "symmetric" surround (for example ', ", `, |, /, , *, -), or for "asymmetric" surround (for example <>, {}, [], ())
- selected text gets surrounded by the symbol.
- Maybe would be good to detec if selected word is already surrounded and toggle symbol.
Any recommended reading on how to do this?