Tip #142: Automatic function end commenting for C++ and Java
tip karma |
Rating 12/9, Viewed by 1952
|
created: |
|
October 19, 2001 9:44 |
|
complexity: |
|
intermediate |
author: |
|
Kalle Björklid |
|
as of Vim: |
|
6.0 |
Some people have a habit of adding the function name as a comment to the end of that function, if it is long, so that he/she knows which function the '}' ends. Here's a way to automate the process.
Use the following abbreviation:
iab }// } // END: <esc>10h%$?\w\+\s*(<cr>"xy/\s*(<cr>/{<cr>:nohl<cr>%$"xpa
If you now end the function with '}//', the follwoing string will be automatically generated: '} //END: functionname'
<<Add your function heading with a keystroke |
Use of Vim folds for javadocs >>
Additional Notes
|