ansible-role--vim/templates/ft.ocaml-opam.j2

39 lines
1.3 KiB
Text
Raw Normal View History

2015-12-27 17:48:53 +00:00
" ## added by OPAM user-setup for vim / base ## 8a3125e39f347f6b9a1b167d8e564281 ## 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()
let l:file = s:opam_share_dir . "/vim/syntax/ocp-indent.vim"
execute "source " . l:file
endfunction
let s:opam_configuration['ocp-indent'] = function('OpamConfOcpIndent')
function! OpamConfOcpIndex()
let l:dir = s:opam_share_dir . "/ocp-index/vim"
execute "set rtp+=" . l:dir
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_available_tools
call s:opam_configuration[tool]()
endfor
" ## end of OPAM user-setup addition for vim / base ## keep this line
" Ocaml Type Annotation
nnoremap <F2> :MerlinTypeOf<CR>
nnoremap <F3> :MerlinTypeOf<CR>