I\'ve been trying Vim for any text editing work for almost a week now. I want to know the fastest way to select a C function definition.
For example, if I have a fun
If you are willing to install plugins vim-textobj-function will give you vif
for Visual select Inside Function and vaf
for Visual select A Function.
daf
will delete the function, both the line with the signature and the function body ({}
)
The text object defined by this plugin are more specific and they don't rely on the function body being a contiguous block of text or {
being placed at the first character on the line.
The drawback is that you depend on an external plugin.