Lovely, lovely vim
Source: Adding parenthesis around highlighted text in VimThe command
c()<Esc>PExplanation
If you want to put the word under the cursor in to brackets this is
viwc()<Esc>P.
viwwillvisually select all charactrsin aword.
c()willcchange the selection and drops you into insert mode, where you type the literal characters(). Also,cautomatically copies the original content to youryankbuffer (clip board).With
<Esc>Pyou returnEscback from insert to normal mode andPaste the previous content.