my favorite

2011/02/03

VIM shortcuts

in VIM, if you wanna delete/modify div_class, just navigate to inside of it and type
d i " - to delete inner text of double quotes (normal mode)
d a " - to delete inner text of double quotes and double quotes is also included (normal mode)

c i " - to delete inner text of double quotes (insert mode)
c a " - to delete inner text of double quotes and double quotes is also included (insert mode)


this is content inside div tag

However, there is no better way to modify "content" only.
That's why I remap the key in vim


" algo
" 1. delete forward to <
" 2. delete backward to >
" 3. enter insert mode
nmap <leader>d dt<dT>i

Now I can use d to delete all content inside of div tag and get into insert mode.

No comments:

BIO

Taipei, GuTing, Taiwan

huang47 | personal

huang47 | personal