From 53856e40330ce3e4abf713fed8f1015adcd79bdb Mon Sep 17 00:00:00 2001 From: katherine Date: Sun, 11 Nov 2018 00:31:06 -0700 Subject: ocaml support stuff for zsh and vim integration and utop config --- .vimrc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 3 deletions(-) (limited to '.vimrc') diff --git a/.vimrc b/.vimrc index f59c948..d3c2967 100644 --- a/.vimrc +++ b/.vimrc @@ -18,6 +18,7 @@ Plugin 'gmarik/Vundle.vim' "FILETYPES Plugin 'kchmck/vim-coffee-script' +Plugin 'rhysd/vim-crystal' Plugin 'elixir-lang/vim-elixir' Plugin 'plasticboy/vim-markdown' Plugin 'shmibs/mips.vim' @@ -26,13 +27,13 @@ Plugin 'wlangstroth/vim-racket' Plugin 'rust-lang/rust.vim' Plugin 'cakebaker/scss-syntax.vim' Plugin 'cespare/vim-toml' -Plugin 'rhysd/vim-crystal' +Plugin 'ziglang/zig.vim' "FUNCTIONALITY Plugin 'junegunn/vim-easy-align' Plugin 'xolox/vim-misc' -Plugin 'xolox/vim-easytags' +Plugin 'shmibs/vim-easytags' Plugin 'tommcdo/vim-exchange' @@ -123,6 +124,43 @@ endfunction call s:Lightline_palette_init() +"async easytags +let g:easytags_async = 1 +let g:easytags_always_enabled = 1 + +"opam stuff +if executable("opam") + 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 +endif """""""""""""""""""""" @@ -274,8 +312,9 @@ autocmd FileType make call Settings_script() autocmd FileType mail call Settings_mail() autocmd FileType markdown call Settings_markdown() autocmd FileType matlab call Settings_matlab() -autocmd FileType nim call Settings_nim() autocmd FileType mkd call Settings_text() +autocmd FileType nim call Settings_nim() +autocmd FileType ocaml call Settings_ocaml() autocmd FileType perl call Settings_perl() autocmd FileType php call Settings_html() autocmd FileType python call Settings_script() @@ -286,6 +325,7 @@ autocmd FileType sh call Settings_script() autocmd FileType text call Settings_text() autocmd FileType vim call Settings_vim() autocmd FileType yaml call Settings_script2() +autocmd FileType zig call Settings_c() autocmd FileType zsh call Settings_shell() "command for reading filetype skeletons @@ -434,6 +474,16 @@ function! Settings_nim() nnoremap -- O]#hhi#[ endfunction +function! Settings_ocaml() + "settings + setlocal shiftwidth=2 + setlocal tabstop=2 + setlocal softtabstop=2 + "mappings + nnoremap -- O*)hhi(** + nnoremap -_ A*)hhi(* +endfunction + function! Settings_script() "settings setlocal shiftwidth=4 -- cgit v1.2.3