The plugin (srcexpl.vim) is a source code explorer based on tags and it provides an overview of the function and type definitions.It has such a mechannism that works like the context window component of "Source Insight" software.

If you have used Source Insight for browseing C/C++/Java project before, you may find that you can browse the definitions with the Source Explorer as well as the context window of "Source Insight".

For example, you put the cursor on a function name in the Normal mode, its definition will show on the Source Explorer window a moment later. As soon as you do the 'double-click' operation using your mouse onto the Source Explorer window which had appeared on the bottom of (G)Vim, the definition and its context will be shown on the editor window.(Just like Source Insight does). Besides, multi-definitions' listing and jumping works like the Source Insight too. In srcexpl v1.2 and above, the function key which users mapped will play a important role that you can not only use mouse but also use keyboard in order to exploring source code in both GUI and cterm VIM.

The Source Explorer can work with 'Taglist' and 'NERD tree' very well. Both of them make (G)Vim looks like the "Source Insight" in Unix/Windows/Mac enviroment.

[Features]

1\ Go insight the definitions of functions and various types of C/C++/Java language project, including function, marcos, structure, array, method, class, global variable, local variable etc.
2\ Double click using left mouse and your own map key (such as: <ENTER>) onto the Source Explorer window can go forward to the preview context.
3\ Popup menu and Your own map key (such as <A-,> in Source Insight) to go back from the preview context.
4\ Auto create and update the 'tags' file intelligently.

[Tips]

1\ Ensure that there is only one 'tags' file in your project PATH, or it would make VIM load all of them on the same time. For example: There are two tags file in the 'your_project' directory, so we will delete the excess 'tags' file in the 'sub_directory'.

a\ Move the cursor onto a symbol word.
b\ As soon as the definition of the word is displayed on the preview window, we type <Ctrl-j> to jump into the previw window.
c\ Type the SrcExpl_jumpKey(<ENTER> as default) to jump to the exact context of its definition.
d\ Type the SrcExpl_gobackKey(<SPACE> as default) to go back to the previous position of the symbol word.

install details

1\ Unzip the archive into your ~/.vim directory. That should put srcexpl.vim in ~/.vim/plugin and srcexpl.txt in ~/.vim/doc.

2\ Add the followings in your .vimrc or _vimrc and change them by yourself

- Fix a bug when operating the Quickfix window after closing the Source Explorer window.
- Handle the case when the cursor is located at the Quickfix window as same as other external plugins.
- Update doc/srcexpl.txt

- Add the fast way for displaying the previous or next definition in the jump list. The new feature is similar with the commands called cprev and cnext for operating the Quickfix list. You can add below config lines in your .vimrc or just update your Trinity to v2.1.
1. " // Set "<F3>" key for displaying the previous definition in the jump list
let g:SrcExpl_prevDefKey = "<F3>"
2. " // Set "<F4>" key for displaying the next definition in the jump list
let g:SrcExpl_nextDefKey = "<F4>"
- Fix a bug when clicking the default prompt line in the Source Explorer window.

5.0
Replaced use of preview window with a named buffer.
Moved to github.
Added documentation.

5.1
Added two APIs for serving other plugins:
SrcExpl_GetWin(), getting the Source Explorer window number for those plugins based on multiple windows.
SrcExpl_GetVer(), getting the Source Explorer version for the forward compatibility.
Added debug/logging functions for the internal development.

Fixed a bug when the working 'tags' file was created with the commands 'ctags -L cscope.files'. In this case, the plugin could not change the relative path to the absolute one. Thank Trevor Brown for reporting this bug.

In this version, the taglist() interface do the binary searching in the exact tags file instead of a linear search, so each tagging responses much more quickly than before even though the tags file of the source code project is so large. All we have to do is add an option in your ctags ultility (--sort=foldcase).

New features: --- The 1st anniversary
1\ Manually updating or creating the 'tags' file using a new custom key named g:SrceExpl_updateTagsKey when you browse the source code without closing the Source Explorer window.
2\ Dynamically loading the tags database from one source code project to another without closing the Source Explorer window.

I've implemented a local mark-stack mechanism using variable type of dictionary in this version, so you can trace into the source code more deeply without warring about the limit of 'A-Z' level using Vim's mark before.

In this version, We do not try to tag something when we got the invalid symbol (only 0-9, a-z, A-Z, and '_' are valid) under the current cursor. So we should not feel unfrequently when we explore the huge source code project using "HJKL" to jump from a word to another.

1\ Add one new feature: Update different 'tags' file dynamically on different project PATH when opening the Source Explorer each time.
2\ Add one user interface variable named g:SrcExpl_updateTagsCmd, which can be set to execute particular 'ctags' utility program, "ctags -R *" as default.

1\ Added one user interface variable named g:SrcExpl_jumpKey, which can be mapped to jump into the exact definition context, "<ENTER>" as default.
2\ Delete one user interface variable named g:SrcExpl_refreshKey, because it is almost not be used actually according to feedbacks from users.
3\ Added the protect mechanism when running multiple tab pages.
4\ Avoid additional refresh operation when the cursor had jumped into the definition context.
5\ Fixed a bug that setting a error mark on the [Jump List] line without judgement.

Two bugs fixed:
1\ Avoid highlight the whole EX command when previewing the definition.
2\ Not update the Popup menu when the current word under the cursor
had been tagged already, or it would be changed on the UNIXs platform.

New feature: Local definition searching and preview using the interface of 'gd' command in VIM. Note that this is not guaranteed to work, the Source Explorer does not check the syntax for now, it only searches for a match with the keyword according to the command 'gd' when you enable the new variable named g:SrcExpl_searchLocalDef.
Improvement: Reimplement the jump mechannism when going back from the preview context using the mark stack with 'A-Z' (26 depth actually). It is more accurate than using the 'Ctrl-o' command.

Update the mechanism and process when the Source Explorer work with other plugins, such as Taglist, NERD tree, etc. Of course, you must tell the Source Explorer what plugins are using the split windows according to a new MMI setting: g:SrcExpl_pluginList

In this version, I add a prompt line which contain the tag name and its counts when we do the multi-definition searching. A bug about folding in VIM is fixed. In srcexpl.vim, I desrcibed that how the Source Explorer works with the Taglist and the MiniBufExplorer on my platform.

In version 2.4, the srcexpl plugin should work more stable and more efficient than before.
Firstly, I implemented the method of getting tags list without traversaling the 'tags' file. So parsing and showing the tags of whole project is more quickly, espacially in a large project. (e.g. The size of tags file in "Linux-2.4.0" is 19 MBytes which including more than 248000 lines data.)
Secondly, it is more accurate to find the symbol definition because of the regular expression.
Finally, I handled a potential problem of deleting buffers, and it may become a bug when changing the tags list in WIN32 platform.

Bugfixed: When the current file which you are editing is not saved, the Source Explorer would not jump to the definition of the symbol under the cursor. This mechanism can handle the 'one-file-multi-buffers' situation very well.

In this version(V2.2), I added a feature, which supported 'tags' file auto-updateing when you open the Source Explorer every time. And if the tags file were not found, the Source Explorer would create one in the current directory according your choice. Besides, I fixed a bug of tags file loading on the mac OS X running enviorment. Thank Larry and Maqi for their freebacks and suggestions. :-)

In this version, I implemented the method to do the recursion for searching the 'tags' file from the current directory to the root directory. In addition, the mechanism for vim version inspection is added. Finally, I rewrote the function named g:SrcExpl_OtherPluginAdapter() in order to adapt the privious postion of the editor window when using the Taglist and MiniBufExpl Plugins.

Added an important feature, that is, multi-definitions list and explore.
When the symbol under the cursor is defined in several places, the Source Explorer window will list them one by one. You can select one of them by a double-click or a <Enter> key onto the exact line, and then we jump to the place that match the definition.
This feature is so important that you can only use one hand ( the one using the mouse :-) ) to explore the source code conveniently, and avoid the number selection when tagging a mulit-definition by <Left-Mouse> or <Ctrl-]>.

Add one feature and two user interfaces.
You can use your own map key to force to complete one refreshing operation. And it will take a less waiting time sometimes.
Additionally, users can set update time interval by themselves in this version.

Inthis version(v1.1), I added the following features
1\ add the 'SrcExplGoBack' item in popup menu when you click right button of your mouse. You will see that when you use srcexpl.vim for exploring the source code.
2\ add an interface for users who want to map their own key for do the 'SrcExplGoBack' function.
3\ 'SrcExplGoBack' is such a feature that it make user go back from 'definition contexts' in editor. When you click the 'SrcExplGoBack' item, it jump the privious place which your have explored just now.