Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a good way by default to wrap a visual selection in braces/parens/brackets?



Great plugin. Everything Tim Pope produces is gold. All Vim users should check out his whole collection on GitHub.


A fairly easy way to do it is either

c()^[P or c(^r")

The first leaves you in normal mode the second in insert mode. I recommend vim-surround by tpope though.


I used vim-surround for a long time, but I prefer vim-sandwich now: https://github.com/machakann/vim-sandwich




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: