vim erlang环境搭建
1.需要安装vim插件列表: 插件管理插件pathgoen, http://www.vim.org/scripts/script.php?script_id=2332项目管理插件Project http://www.vim.org/scripts/script.php?script_id=69taglist插件 http://www.vim.org/scripts/script.php?script_id=273vimerl插件 http://vim.sourceforge.net/scripts/script.php?script_id=273taglist依赖于ctags程序生成的tags文件, http://sourceforge.net/projects/ctags/
拷贝下载文件中的ctag.exe到系统目录下,在项目根目录下使用“ctag -R”命令生成tags文件,这样在项目根目录下打开vim,会自动加载tags文件,也可以在vim使用“set tags=d:/myproject/tags”设置tags文件路径
2.vimerl在windows平台上的修改vimerl插件在windows平台上不能直接使用,主要原因是erlang脚本文件的执行方式不一样,所以需要修改几个地方:智能提示修改文件autoload/erlang_complete.vim,其中一行let functions = system(s:erlang_complete_file . ' ' . a:module)s:erlang_complete_file前面加上escript.exe所在路径let functions = system('escript.exe ' . s:erlang_complete_file . ' ' . a:module)
语法检查找到compiler/erlang.vim文件,if match(getline(1), "#!.*escript") != -1setlocal makeprg=escript\ -s\ %elseexecute "setlocal makeprg=" . s:erlang_check_file . "\\ \%"endif修改为if match(getline(1), "#!.*escript") != -1setlocal makeprg=escript.exe\ -s\ %elseexecute "setlocal makeprg=escript.exe\\ " . s:erlang_check_file . "\\ \%"endiferlang.vim
注意execute命令参数中空格之前要用\\,%表示当前文件,
增加自己 的头文件目录有时候,vimerl不能识别erlang文件,找到文件compiler/erlang_check.erlmain([File]) -> Dir = filename:dirname(File), Defs = [strong_validation, warn_export_all, warn_export_vars, warn_shadow_vars, warn_obsolete_guard, warn_unused_import, report, {i, Dir ++ "/include"}, {i, Dir ++ "/../include"}, {i, Dir ++ "/../../include"}], ...
在上面的列表添加自己 的头文件目录即可
注意:vim版本一定要安装7.3以上,否则vimerl插件某些功能可能不支持,如语法检查