I would like to yank some lines beginning from 'some_code_to_copy' until the empty line and then do the same for 'some_other_cody_to_copy' in vim.
some_code_to_copy(){ statement; statement; statement; statement;
}
some_other_code_to_copy(){ other_statement; other_statement;
}I could first count the lines of each function and then do 6yy for the first one and 4yy for the second one.
I could also use v to select the first function and then y to yank it. and repeat this for each function.
What I actually want is to navigate to the first line and then tell vim copy all lines until the empty line.
How can I do this?
1 Answer
You can do this with yip (which means "yank inner paragraph"). ip is a motion just like hjkl and $, ^, etc., so you can also use it for other things like dip do delete the paragraph, cip to change it, gcip to comment it out if you have the vim-commentator plugin, etc.