Information about of different web hosting plans. Users submitted reviews for inmotion hosting company.

Vim IDE

Parent Category: Electrical and Computer Engineering Category: Code
Hits: 2761

Ideally most software developers familiar with VIM would love to have a proper Interface Development Environment within VIM. Sometime ago, I developed the IDE plugin which extends the project plugin by providing among other things: automated syntax highlight, visual status notification for open/close/edited/read-only files, file-buffer tracking over tabs and windows, persistent ide window with file navigation, integration with other plugins. For instance, Figure 1 is a screen shoot of the IDE plugin (upper left window) running side by side with the ExUtility plugin (bottom-left window) and the TagList plugin (right most window). It can be observed that the ide window has four different icons that are updated depending on the status of each individual file within the project (closed,read-only,edited,open); these icons are updated each time the ide window gains focus (either by pressing <F12> to toggle the ide window on and off, or by pressing <alt-left> and <alt-right> to jump between the ide window and the files).

ide-taglist-globalsearch

Figure 1. IDE plugin with MultipleSearch and TagList plugins.

 

The difference in syntax highlight between using or not the IDE plugin is demonstrated in Figure 2 below. The left figure shows the default highlighting provided by cpp.vim plugin, the right figure in contrast shows the additional highlighting provided to class names, class members, functions and variables, with different colors provided they are public, private or protected.

 

  

ide-with-syntax

Figure 2.Syntax highlight provided by the IDE plugin

 

I have change the color palette many times depending on the brightness and contrast settings of different monitors, so you can tweak the palette to your personal taste by modifying the ideSyntax.pl script provided within the IDE plugin. The lines you need to modify in the ideSyntax.pl script are lines 183 through 194, which are pasted below for easy reference. In the ideSyntax.pl script there is an extensive color definition before these lines which you can use to name the colors, or you can also provide an hexadecimal value directly.

# choose the colors for your GUI from the values above
# or provide the hexadecimal number directly.
my $colorTypeNamePublic = $turquoise;
my $colorTypeNameProtected = $mediumturquoise;
my $colorTypeNamePrivate = $darkturquoise;
my $colorFunctionPublic = $tomato;
my $colorFunctionProtected = $coral;
my $colorFunctionPrivate = $chocolate;
my $colorMemberPublic = $palegreen;
my $colorMemberProtected = $mediumaquamarine;
my $colorMemberPrivate = $mediumseagreen;
my $colorVariablePublic = $tan;
my $colorVariableProtected = $sandybrown;
my $colorVariablePrivate = $peru;

The biggest code project that I have handle with the IDE plugin was when working for a medium/large size company which had around 47 thousand files of code. On this large project, the first time the IDE plugin built the syntax highlight for the entire project took about 4 minutes to generate it, and at that time I realized that updating the syntax file for big projects each time a file was changed was a waste of time. Therefore, to speed up the time spend highlighting the code the IDE plugin tracks all files that have been modified within a session (i.e. new methods, classes, etc); and once a predefined percentage of files have been modified then the syntax highlight is automatically refreshed. The default threshold of modified files to update the syntax highlight is 10% but you can change it by defining in your .vimrc or _vimrc configuration file the global variable g:IDE_UpdateSyntaxAt to any other value. For instace, the following line will require syntax updates every 3% of the files within the project are modified.

let g:IDE_UpdateSyntaxAt = 3

You can also update the syntax using the command IDESyntax for all files in the project. If you are currently working in a project and decide to change the ideSyntax.pl script to accommodate your palette taste, you will have to type at least once IDESyntax! so that the local copy of the perl script is updated. In fact you can virtually modify most mappings from your .vimrc file, for instance I use the following configuration in my .vimrc file:

 

" === IDE ============================================================={{{
let g:IDE_ProjectFlags                   = "FgimsSt"
let g:IDE_AdvancedFlags               = "DfMOSTz"
let g:IDE_IconFolder                     = "~/.vim/icons"
let g:IDE_WindowIncrement           = 50
let g:IDE_UpdateSyntaxAt             = 6
let g:IDE_MapProjectToggle           = '<F12>'
let g:IDE_MapMove2RightTab         = '<C-Right>'
let g:IDE_MapMove2LeftTab          = '<C-Left>'
let g:IDE_MapMakeMainTarget_1    = '<F7>r'
let g:IDE_MapMakeMainTarget_2    = '<F7>d'
let g:IDE_MapMakeMainTarget_3    = '<F7>c'
let g:IDE_MapMakeThisTarget_1    = '<C-F7>r'
let g:IDE_MapMakeThisTarget_2    = '<C-F7>d'
let g:IDE_MapMakeThisTarget_3    = '<C-F7>c'
"}}}

 

If you are not sure what is the setting that is currently active in the IDE plugin or you just want to explore other variables that you could customize, you can always execute the command IDEShowenv to retrieve the entire list of parameters (the command also shows the entire list of the files currently managed by the IDE and their refresh status). Figure 3 gives an idea of the expected output.

Figure 3. The environment used within the IDE plugin as shown by the command IDEShowenv

 

For a quick reference of the most common mappings available in the IDE plugin, you can press <F1> from within the ide window. The help to be display is shown in Figure 4 below.

 

Figure 4. The help within the IDE window as obtained by the <F1> within the ide window

 

Besides the mentioned features, the IDE plugin provides extensive debugging facilities so that you can extend it and improve it, most routines can be traced at enter and exit so that any bug or misbehaving code can be rapidly isolated and fix. By default the debugging facility is off, different level of traces and different outputs (either to a screen or to a log file) are also available. There are many other features documented in the ide.txt file (available once the IDE plugin is untarred) and probably some other features not documented anywhere, but the point is that I currently can get more done with the IDE plugin than without it (huge bias of course) and besides the IDE plugin I use other list of plugins listed below to complement its functionality and extract the best I can out of VIM:

 

Acknowledgements:

The IDE plugin is based on the project plugin written by Aric Blumer; and it uses mechanisms and ideas borrowed from the Taglist, errormarkerexUtility and ShowMarks plugins among other plugins and scripts. A list of all changes and modification (not comprehensive) is available in the IDE plugin documentation.

 

Add comment

Security code
Refresh

2012, Credits