воскресенье, 25 августа 2013 г.

Portable Vim (from portableapps.com) and Tools

If you use portable Vim/GVim as PortableApps.com package and want to use external tools (ctags, uncrustify, astyle, global/gtags, so on) you can setup your paths (to tools executable files) based on $HOME variable. For example lets set folder of all tools:
let TOOLSDIR=$HOME . "/vimfiles/tools"
because HOME is setted in gVimPortable/App/AppInfo/Launcher/gVimPortable.ini:
[Environment]
VIM=%PAL:AppDir%\vim
VIMRUNTIME=%PAL:AppDir%\vim\vim74
HOME=%PAL:DataDir%\settings
LANG=%PAL:LanguageCustom%
Also you can add there any other environment variables to use them in vim config file.
I usually create there - in settings/ - "tools" directory and make there "ctags", "astyle" and other folders with my external tools binaries, config files, etc...
Now you can make something like:
" Beautifiers.
exec ':cabbr astyle ' . TOOLSDIR . '/astyle/astyle.exe --options=' . TOOLSDIR . '/astyle/.astylerc'
exec ':cabbr uncr ' . TOOLSDIR . '/uncrustify/uncrustify.exe -q -c ' . TOOLSDIR . '/uncrustify/uncrustify.cfg'
for your beautifiers. Select code fragment (or all text in file) and type :!astyle for example, to see how it works.

Комментариев нет:

Отправить комментарий

Thanks for your posting!