vim tips and tricks

tags

Using tags makes it easier to jump to certain parts of your programs. First run ctags from the UNIX command line on your source files (e.g., ctags prog.c or ctags -R to recurse) to generate a "tags" file, then use these while editing your source files:

 :tag TAB            - list the known tags
 :tag function_name  - jump to that function
 ctrl-t   - goes to previous spot where you called :tag
 ctrl-]   - calls :tag on the word under the cursor        
 :ptag    - open tag in preview window (also ctrl-w })
 :pclose  - close preview window