Reputation: 2410
'bla bla bla', 'bla bla bla'
---------------^------------ (cursor position)
To delete the second 'bla bla bla' I use
da'
but this also deletes the leading space. Is there a way to not include the leading space in the deletion?
(I'm trying to create a macro to replace quoted strings with a function call, ie replace eg
'bla bla bla', 'woot'
with
yada('bla_bla_bla'), yada('woot') )
Upvotes: 0
Views: 48
Reputation: 195049
in macro you can also use command, like this:
s/'.\{-}'/yada(&)/g
This will only apply on '...'
, the rest (space, comma etc) won't be touched.
Upvotes: 2
Reputation: 196546
You can use vi'i'<operator>
to operate on the quotes and their content. This would make your macro look something like that:
vi'i'cyada(<C-r>")
Upvotes: 1