Vim tag
1.Tag files contain the source file locations of all function, macro, and type definitions used in a programming project. Most editors, including vim and emacs, are able to jump directly to the source code location of a function, macro, or type definition, as specified in the project’s tag file.
To create tag files, edit Makefile and add the following makefile target:
tags:
etags *.cc *.h
ctags *.cc *.h
Now run “make tags” to create tag files for both vim and emacs. To use the tags, open hello.cc in your favorite editor, and type the appopriate command:
vim:
:ta dumb_func
emacs:
Meta-.
dumb_func
This should take you to the definition of function dumb_func. To return to where you came from, type ^t (control-t) in vim, or Meta-* in emacs.
2.RCS (the revision control system) is a handy tool to keep track of the history of changes made to files. It maintains only the diffs between versions, minimizing space requirements. It allows you to “back out” to a previous version of a file at any time. It also facilitates logging of notes about your changes. Advanced features include a locking mechanism to prevent partners on a team from making changes to the same file at the same time and a “3-way merge” mechanism to combine changes made independently to a common source.
Read the man pages for ‘ci’, ‘co’, and ‘rcs’. “Check in” your file with
ci -l hello.cc
Check it out with
co -l hello.cc
Make a change and check it in again. Now type
rlog hello.cc
to see a history of your changes.
NB: RCS is very old. There are several substantially more capable alternatives, including cvs (which is built on rcs, and still pretty old), subversion (svn), bazaar (bzr), git, mercurial (hg), and perforce (p4).