Skip to content

Instantly share code, notes, and snippets.

@kmtr
Created January 19, 2016 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmtr/9d379b6ec0eae2f6e010 to your computer and use it in GitHub Desktop.
Save kmtr/9d379b6ec0eae2f6e010 to your computer and use it in GitHub Desktop.
VimでOCamlを書くためにmerlinとocp-indentを設定する ref: http://qiita.com/kmtr/items/25661e445278d6587de0
$ brew install ocaml --with-x11
$ brew install opam
$ opam install merlin
$ opam install ocp-indent
let g:opamshare = substitute(system('opam config var share'),'\n$','','''')
execute 'set rtp+=' . g:opamshare . '/merlin/vim'
NeoBundle 'scrooloose/syntastic'
let g:syntastic_ocaml_checkers = ['merlin']
execute 'set rtp^=' . g:opamshare . '/ocp-indent/vim'
function! s:ocaml_format()
let now_line = line('.')
exec ':%! ocp-indent'
exec ':' . now_line
endfunction
augroup ocaml_format
autocmd!
autocmd BufWrite,FileWritePre,FileAppendPre *.mli\= call s:ocaml_format()
augroup END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment