CCTree is a Vim 7 plugin that displays hierarchical call-trees for functions or files using a Cscope database. The functionality is similar to that offered by other IDEs and source-analysis applications, i.e., Kscope, Source navigator, and Eclipse. Currently, works best for C.
Also, check out http://sourceforge.net/projects/ccglue/ for a companion tool that can produce cross-reference files from cscope [and ctags] databases that CCTree can load directly from disk.
HTML comment gadget has been added to the Feedback/Comments page. You can leave your queries or comments on the page.May 10, 2011: Version 1.50
July 14, 2011: CCTree version 1.60
Performance speed-up for tree depth manipulation using incremental updates.
June 20, 2011: CCTree version 1.55
Speed-up syntax highlighting (Note: To export to HTML, run TOhtml command on cctree window copy to get complete highlighted call-tree).
June 17, 2011: CCTree version 1.53
Fix bugs related to database append, xrefdb load.
June 7, 2011: ccglue version 0.3.0
Support for global variables, enum members and more complete macro cross-referencing.
CCTree now supports cross-referencing global variables, enums, typedefs, and macros, in-addition to functions. The feature is disabled by default.
Warning: Two passes are required for cross-referencing; the time taken to load will be around 3-4 times longer.
To enable it, there are two ways:
Known limitations of Enhanced Symbol Processing:
(1) Cscope does not tag anonymous enums (see feature request) . Therefore, CCTree cannot recognize anonymous enum symbols.
April 9, 2011: ccglue project
Spawned off project ccglue (http://sourceforge.net/projects/ccglue/ ), an external tool for producing cross-reference files from cscope and ctags that can be used with CCTree.
April 5, 2011: Version 1.33
1. Load and trace CCTree native XRefDb directly from disk ( :CCTreeLoadXRefDBFromDisk )
(Note: Earlier saved xref db's had an issue with tabs in the tag file; its probably better to use xref db's generated
by version 1.33).
2. Fix AppendDB command when 'ignorecase' is set.
March 28, 2011: Version 1.26
1. Fix macro cross-referencing limitation
2. Correct native xref file format
March 22, 2011: Updated help file
Update help file section on the website. Its still not complete. I hope to add it to the package sometime soon.
March 21, 2011: Version 1.21
1. Support for serialization of loaded cscope databases
To save the current set of databases loaded in to memory onto disk
in native CCTree XRef format, use command ":CCTreeSaveXRefDB"
To load a saved native CCTree XRef format file, use
Notes: No merging database support for CCTree native DB's [at present].
Writing large Xref Databases:
CCTree can use external utilities to write extremely large files beyond
VimScripts capabilities. It requires the use of an external tool that can
join text files (i.e., 'cat' in unix). This utility is triggered if the size
of the file being written exceeds g:CCTreeDbFileMaxSize (40 Mb or as configured)
The join utility command is configured by default as follows:
let CCTreeJoinProgCmd = 'PROG_JOIN JOIN_OPT IN_FILES > OUT_FILE'
let g:CCTreeJoinProg = 'cat' " PROG_JOIN
let g:CCTreeJoinProgOpts = "" " JOIN_OPT
March 06, 2011: Version 1.03
1. Customization for key mappings
2. Dynamic configuration of UI variables
3. Folding long call-trees to show current path dynamically
Detailed release notes:
Unicode symbols (Default: Off)
UTF-8 symbols should work fine on the majority of
X11 systems; however, some terminals might cause problems.
To use symbols for drawing the tree, this option can be enabled.
g:CCTreeUseUTF8Symbols = 1
The options interface (CCTreeOptsxxx) can be used to modify options on-the-fly.
Dynamic options configuration:
CCTreeOptsEnable <option> (<tab> for auto-complete)
CCTreeOptsDisable <option> (<tab> for auto-complete)
DynamicTreeHiLights: Control dynamic tree highlighting
UseUnicodeSymbols: Use of UTF-8 special characters for tree
Users can custom-map the short-cut overriding the following variables on their Vim start-up configuration.
g:CCTreeKeyTraceForwardTree = '<C-\>>'
g:CCTreeKeyTraceReverseTree = '<C-\><'
g:CCTreeKeyHilightTree = '<C-l>'
g:CCTreeKeySaveWindow = '<C-\>y'
g:CCTreeKeyToggleWindow = '<C-\>w
g:CCTreeKeyCompressTree = 'zs'
g:CCTreeKeyDepthPlus = '<C-\>='
g:CCTreeKeyDepthMinus = '<C-\>-'
Call Tree folding for trees that span multiple pages
Use 'zs' in preview-window
On-demand Call-Tree Highlighting (Works only in preview window:)
CCTreeWindowHiCallTree (same as <C-l> shorcut): Will highlight calling tree for keyword at cursor
Users can turn off dynamic call tree highlighting using CCTreeOptsDisable command interface or
setting g:CCTreeHilightCallTree = 0 in their vim configuration.
Version 1.00: March 02, 2011
1. Staging release for upcoming features
- Complete refactoring of code to take advantage of VimScript's OO features
2. Faster decompression of symbols
3. Display related changes
- Use of unicode symbols for tree
4. Bugfixes related to multi-database loading
Version 0.90: February 18, 2011
1. Support for large database file loading using split utility or perl interface
Vimscript does not have an API for reading files line-by-line. This
becomes a problem when parsing large databases. CCTree can overcome
the limitation using an external utility (i.e., GNU coreutils: split)
or VimScript's perl interpreter interface (:version must indicate +perl)
The following settings are tailored to suit GNU coreutils split; the default
settings should work with no changes on linux/unix standard installations
(Windows/Mac might require installation of unixutils or equivalent)
External command is setup with the following parameters:
g:CCTreeSplitProgCmd = 'PROG_SPLIT SPLIT_OPT SPLIT_SIZE IN_FILE OUT_FILE_PREFIX'
Break-down of individual parameters:
The split utility is assumed to be on the path; otherwise, specify full path
g:CCTreeSplitProg = 'split'
Option for splitting files (-C or -l)
g:CCTreeSplitProgOption = '-C'
If split program does not support -C, then this parameter must be set to
the number of lines in the split files
g:CCTreeDbFileSplitLines = -1
Largest filesize Vimscript can handle; file sizes greater than this will
be temporarily split
g:CCTreeDbFileMaxSize = 40000000 (40 Mbytes)
Sample system command:
split -C 40000000 inputFile outputFilePrefix
When g:CCTreeDbFileSplitLines is set to 10000 (-C options will be ignored)
split -l 10000 inputFile outputFilePrefix
Using perl interface:
By default, perl usage is disabled. Set
g:CCTreeUsePerl = 1 to enable the perl interface.
Perl interface is typically faster than native Vimscript.
This option can be used independent of the file size
For more info on setting up perl interface
:help perl-using or :help perl-dynamic
Version 0.85: Feb 14, 2011
Figured the slow loading speeds in CCTree was because of the use of lists (Vimscript's list look-up speed is not O(1)). This patch should offer significant speed boost for loading databases.
Version 0.80: Feb 4, 2011
Reduced memory usage by removing symbols that have no cross-references.
Version 0.75: July 27, 2010
Allow CCTree windows to be "saved". Multiple instances of CCTree preview windows can now exist.
Use "<Ctrl-\>y" or ":CCTreeWindowSaveCopy" to save the current view.
Version 0.71: May 11, 2010
Added support for multiple cscope databases.
" Append database with command ":CCTreeAppendDB"
" Allows multiple cscope files to be loaded and cross-referenced
" :CCTreeAppendDB ./cscope.out
" :CCTreeAppendDB ./dir1/cscope.out
" :CCTreeAppendDB ./dir2/cscope.out
Version 0.65: July 12, 2009
Added preview window toggle functionality. Shortcut <C-\>w to toggle.
Version 0.60: November 26, 2008
Added support for source-file dependency tree
NOTE: Previously used shortcuts for symbols would work with filenames as well.
Version 0.50: October 17, 2008
Optimizations for faster compressed database load-speeds and reduced memory usage.
Version 0.41: October 6, 2008
Fix for compressed cscope databases -- would have caused problems with non 8-bit encodings.
Version 0.4: October 3, 2008
1. Rewrite of display-related code
2. New syntax hightlighting
3. Dynamic highlighting for call-trees
4. Support for new window modes (vertical, horizontal)
5. New display format option for compact or wide call-trees
6. Preview window fix
(Thanks to Michael Wookey for help with testing this release.)
Important release changes:
CCTree Preview Window is oriented vertically. For older behavior, the following values can be added to your vimrc:
let g:CCTreeDisplayMode = 3
let g:CCTreeWindowVertical = 0
Also, the syntax highlights can be modified to change the highlight for the call-tree. The screenshot on the left uses the following settings:
highlight CCTreeHiSymbol gui=bold guibg=darkblue guifg=peachpuff
highlight CCTreeHiMarkers gui=bold guifg=darkgreen guibg=lightyellow
For use in console, add the ctermfg and ctermbg parameters. An example:
highlight CCTreeHiSymbol gui=bold guibg=darkblue guifg=peachpuff ctermfg=blue ctermbg=white
Also, note that some colorschemes (Desert is one) do not define the syntax Ignore marker correctly. This can be checked as follows.
> hi Ignore ctermfg=black guifg=bg
ctermfg must be the same as the current background color; otherwise strange characters like "!@#" will appear.
Version 0.3: September 21, 2008
1. Support compressed cscope databases
2. Display window related bugs fixed
3. More intuitive display and folding capabilities
Click here to view Flash Animation
Version 0.2: September 12, 2008
(Patches from Yegappan Lakshmanan, thanks!)
1. Support for using the plugin in Vi-compatible mode
2. Filtering out unwanted lines before processing the db
3. Command-line completion for the commands
4. Using the cscope db from any directory
Version 0.1: August 31, 2008
1. Cross-referencing support for functions and macros