user4440701
user4440701

Reputation:

Vim: converting matching parenthesis to matching curly braces

I saw a screencast where someone had highlighted a set of parenthesis and instantly converted them to curly braces. Is this a macro or a Vim thing?

Upvotes: 1

Views: 54

Answers (2)

Mustafa
Mustafa

Reputation: 1854

They use vim surround plugin.

Quoting their Hello World.

It's easiest to explain with examples. Press cs"' inside

"Hello world!"

to change it to

'Hello world!'

Upvotes: 2

Kent
Kent

Reputation: 195029

you can do it with surround.vim plugin. https://github.com/tpope/vim-surround

e.g.

when your cursor (*) at : ( fo*o), press cs({ will change your text into { fo*o}

Upvotes: 4

Related Questions