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
Another way is to go to the line of the start of your function and hit: Vj%
(or V%%
if your style puts the opening brace on the same line). This puts you into Visual-Line mode and the percent takes you to the matching closing brace. In the second style, the first % takes you to the opening brace on the line that you selected and the second to its matching closing brace.
Also works for parentheses, brackets, C-style multi-line comments and preprocessor directives.
See the manual for more info.