diff options
author | AChavali <aryadevchavali1@gmail.com> | 2020-03-02 23:20:22 +0000 |
---|---|---|
committer | AChavali <aryadevchavali1@gmail.com> | 2020-03-02 23:20:22 +0000 |
commit | 3a10e77e6afa3a61c9b0c5eaca66efac56bf9643 (patch) | |
tree | 689c0c577f614eb70a1b1d8918cacfe4a2b16d79 | |
parent | c714af9aaba27a610802709d0c4f11629547f7ae (diff) | |
download | dotfiles-3a10e77e6afa3a61c9b0c5eaca66efac56bf9643.tar.gz dotfiles-3a10e77e6afa3a61c9b0c5eaca66efac56bf9643.tar.bz2 dotfiles-3a10e77e6afa3a61c9b0c5eaca66efac56bf9643.zip |
+opam config to vimrc
-rw-r--r-- | vimrc | 32 |
1 files changed, 32 insertions, 0 deletions
@@ -110,3 +110,35 @@ nnoremap <leader>pg :!ctags-exuberant -R --exclude=Makefile . "" Tags nnoremap <leader>tt :Tags<CR> +" ## added by OPAM user-setup for vim / base ## 93ee63e278bdfc07d1139a748ed3fff2 ## you can edit, but keep this line +let s:opam_share_dir = system("opam config var share") +let s:opam_share_dir = substitute(s:opam_share_dir, '[\r\n]*$', '', '') + +let s:opam_configuration = {} + +function! OpamConfOcpIndent() + execute "set rtp^=" . s:opam_share_dir . "/ocp-indent/vim" +endfunction +let s:opam_configuration['ocp-indent'] = function('OpamConfOcpIndent') + +function! OpamConfOcpIndex() + execute "set rtp+=" . s:opam_share_dir . "/ocp-index/vim" +endfunction +let s:opam_configuration['ocp-index'] = function('OpamConfOcpIndex') + +function! OpamConfMerlin() + let l:dir = s:opam_share_dir . "/merlin/vim" + execute "set rtp+=" . l:dir +endfunction +let s:opam_configuration['merlin'] = function('OpamConfMerlin') + +let s:opam_packages = ["ocp-indent", "ocp-index", "merlin"] +let s:opam_check_cmdline = ["opam list --installed --short --safe --color=never"] + s:opam_packages +let s:opam_available_tools = split(system(join(s:opam_check_cmdline))) +for tool in s:opam_packages + " Respect package order (merlin should be after ocp-index) + if count(s:opam_available_tools, tool) > 0 + call s:opam_configuration[tool]() + endif +endfor +" ## end of OPAM user-setup addition for vim / base ## keep this line |