Create .vimentry file
exVim uses your_project.vimentry file access the project. The main purpose is let the exVim can open several different projects in the same time, and each project have its own settings.
When starting a new project, create a file with suffix .vimentry under the root directory, and open the file by vim. You may see your vim like this:

The “Edit Window” shows the contents of vimentry file you create. These contents are automatically generate when first time you open a project.
You can modify the settings to fulfill your demands, when you edit the settings and save the file, exVim will aware the changes and update to the new one.
Syntax
There are two types of variable you can define in vimentry file — normal variable and list variable. The value of the variable always quoted by single quotes ‘. The “=” will tells exVim the line contains a normal variable, otherwise “+=” will tells exVim it is a list variable.
Normal Variable
Variable1='this is a normal variable'
List Variable
List1+='item1'
List1+='item2'
List1+='item3'
When parsing vimentry file, exVim will create the variables with prefix g:exES_. For example the Variable1 above will be g:exES_Variable1 in the vimscript.
Update vimentry file
When you create a .vimentry file, exVim will write a default template at the beginning, the settings usually break into several sections. The first one is auto-gen section, you probably see the section like this:
-- auto-gen settings (DO NOT MODIFY) --
CWD=D:/Project/Dev/exUtility/src/exLibs
Version=21
VimEntryName=exLibs
VimfilesDirName=.vimfiles.exLibs
The user are not allowed to change the value in this section. Everytime you open the vimentry file, the exVim will load the section, and check if it is consist with current settings. it will force exVim rewrite and update the vimentry file if the settings are not the same.
The conditions to force the exVim update the vimentry are listed here:
- The value of CWD different with the path vimentry file exists.
- Version is different with exVim’s internal version aka. (s:exES_CurrentVersion).
- VimEntryName is different with the filename of vimentry.
- The vimentry file is empty.
When user edit the vimentry file, and save it by :w, exVim will detect and load the new settings.
Builtin vimentry settings
Most variables in vimentry files are relate with file name or path. They are obviously known by the name. This section will only discuss some special variable.
LangType
- default: auto
- options: c,cpp,c#,shader,python,vim,math,uc,javascript,java,html,lua
The language type of the project will be set automatically by the file type filter (s:ex_project_file_filter in exProject). You can specific your own language type as:
LangType=lang1,lang2,lang3
The LangType will be used in quick_gen_project file, and will let the project update by specific language you define.
vimentryRefs
This is a list used to reference other vimentry files in current project. User then can access the tags, symbols and inherits of the reference vimentry.
To make it works, you need to add the absolute path of the referenced vimentry file.
RestoreBuffer
default: false
exVim can save all opened buffers when you exit, and restore them in your next time editing. By default, this function is turn off. Set the “RestoreBuffer=true” to turn it on.
Before restore buffers, exVim will ask if restore when “AskForRestoration” is true.
.vimfiles
When you open the vimentry, exVim will do the things below in order:
- Check if need to Update vimentry file in vimentry settings.
- Parse settings, generate global variables in vimscript.
- Create .vimfiles.${VimEntryName} folder ( NOTE: the ${VimEntryName} here is the name of your vimentry file ).
- Create
id-lang-autogen.mapin .vimfiles.${VimEntryName}. - Create
quick_gen_project_${VimEntryName}_autogen.bat[1]. - Create
quick_gen_project_${VimEntryName}_pre_custom.bat[1] andquick_gen_project_${VimEntryName}_post_custom.bat[1] in .vimfiles.${VimEntryName}.
The .vimfiles.${VimEntryName} folder includes all the files used exVim. The reason we create the name of the folder use the .${VimEntryName} behind .vimfiles is we can have different vimentry files under the same root directory, we have to distinguish them and apply right settings and files for each entry.
The id-lang-autogen.map used in id-utils – our global search tool. The file describe the filetype filter used in id-utils, which come from the filter settings in exProject. The id-utils uses the id-lang map in exVim in this order:
- Check if there have a file named
id-lang-custom.mapin.vimfiles.${VimEntryName}, if exists use it, and skip the following step. - Check if there have a file named
id-lang-autogen.mapin.vimfiles.${VimEntryName}, if exists use it, and skip the following step. - Check if there have a file named
id-lang.mapin ${VIM}/toolkit/idutils/, if not, report an error.
By this rule, you could customize your own id-lang.map.
The quick_gen_project${VimEntryName}autogen is the shell programme to invoke exVim update the project. You can run it outside exVim or use :Up[date] command.
You can not edit quick_gen_project${VimEntryName}autogen, it will be overwrite next time you use :Up[date] command. exVim provide 2 different way let your customize the script.
- You can find
quick_gen_project_${VimEntryName}_pre_custom.bat[1] andquick_gen_project_${VimEntryName}_post_custom.bat[1] in .vimfiles.${VimEntryName}, When you run the quick_gen_project${VimEntryName}autogen script, it will run the xxx_pre_custom, then the main shell script, finally the xxx_post_custom. You can edit put your custom script in these two files. - If you want to change the whole
_autogen.bat[1], you could put a shell programme namedquick_gen_project_${VimEntryName}_customin the same path, the:Up[date]command will skip the execute_autogenscript if there exists a_customone.
Edit vimentry file in exVim
The <leader>ve commands provides you a faster way to edit vimentry file in exVim. If you don’t find the command in your .vimrc, write the script:
nnoremap <unique> <leader>ve :call exUtility#EditVimEntry ()<CR>
Add new language support
Add new exvim language maps===
The default languages support by exVim shows in the table below:
asm: asm, ASMawk: awk, gawk, mawkbatch: batc: c, Ccpp: c++, cc, cp, cpp, cxx, h, H, h++, hh, hp, hpp, hxx, inl, ippc#: csdoxygen: dox, doxygendebug: log, err, exehtml: htm, htmlini: ini, cfgjava: javajavascript: jslua: luamake: mak, mk, Makefile, makefilemath: mpython: py, pyw, pyx, pxdruby: rb, rubysh: sh, SH, bsh, bash, ksh, zshshader: hlsl, vsh, psh, fx, fxh, cg, shd, glsluc: ucvim: vimwiki: wikixml: xml
The table will affect the exProject file filter and quick_gen_project script in exVim. When you set the LangType ‘auto’ in vimentry, exVim will get the “Language Type” through the “File Type” provided by exProject file filter. When the LangType is set to any of the Language Type above (e.g. LangType=c,cpp,python), exVim will look up the “File Type” apply them to the exProject file filter and quick_gen_project script.
You can use the function below add new language type:
function exUtility#AddLangMap( langmap_type, lang_type, file_type_list )
- “langmap_type” controlls the maps you operated. The value could be “exvim” and “ctags”, I’ll explain the ‘ctags’ later, here we choose ‘exvim’
- “lang_type” is the language type you want to add your file type list in. If the “lang_type” is not in the default language maps, it will create a new one.
- “file_type_list” is a list carries the file types you want to add. If the file type already exists, the function will skip it.
Here is an example to add filetype ‘as’ into language ‘javascript’
call exUtility#AddLangMap ( 'exvim', 'javascript', ['as'] )
You can use the function reset specific language mapping:
function exUtility#ResetLangMap( langmap_type, lang_type, file_type_list )
The function will erase any exists mappings and apply the new.
Add new ctags language maps
ctags use its own language mappings in exVim:
asm: asm, ASM, s, S, A51asp: asp, asaawk: awk, gawk, mawkbasic: bas, bi, bb, pbbeta: betc: ccpp: c++, cc, cp, cpp, cxx, h, h++, hh, hp, hpp, hxxc#: cscobol: cbl, cob, CBL, COBeiffel: eerlang: erl, ERL, hrl, HRLfortran: fo, ft, f7, f9, f95html: htm, htmljava: javajavascript: jslisp: cl, clisp, el, l, lisp, lsp, mllua: luamake: mak, mk, Makefile, makefilepascal: p, pasperl: pl, pm, plx, perlphp: php, php3, phtmlpython: py, pyx, pxd, sconsrexx: cmd, rexx, rxruby: rb, rubyscheme: SCM, SM, sch, scheme, scm, smsh: sh, SH, bsh, bash, ksh, zshslang: slsml: sml, sigsql: sqltcl: tcl, tk, wish, itclvera: vr, vri, vrhverilog: vvim: vimyacc: y
In exVim, since we generate the ctags options automatically, the user need to specific their new language mappings manually by use:
function exUtility#AddLangMap( langmap_type, lang_type, file_type_list )
With the first parameter langmap_type equals to ‘ctags’. exVim will compare two maps, and decide how to write the options in quick_gen_project script.
For example, you can let ctags parse *.ms files in the syntax of maxscript in the script:
call exUtility#AddLangMap ( 'ctags', 'maxscript', ['ms'] )
Add new cscope file type
The cscope is mainly used in c pgrogramme, people sometimes use it in cpp or asm programme. You need add new language type in list g:ex_cscope_langs to make it support in cscope.
let g:ex_cscope_langs = ['c', 'cpp', 'shader', 'asm' ]
Footnotes
- in unix/linux, it is .sh
