WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

VIM tip of the day

Submitted by barnettech on Mon, 01/28/2013 - 15:31

to delete or yank (copy) a whole function try this:

If you're on a parentheis, or curly bracket or even a quote sign you can always hit the % sign to go to the closing parentheis, curly bracket or quote sign in vim.  So you can instead do "d%" to delete all in between said quotes, curly brackets, or parenthis or you can do "y%" to yank the lines (copy) and then later go to where you want to paste those yanked lines and hit the "p" key.

Yes finally.  Great for when you're refactoring your code and moving functions around.