Created
January 19, 2016 16:14
-
-
Save kmtr/9d379b6ec0eae2f6e010 to your computer and use it in GitHub Desktop.
VimでOCamlを書くためにmerlinとocp-indentを設定する ref: http://qiita.com/kmtr/items/25661e445278d6587de0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install ocaml --with-x11 | |
$ brew install opam |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ opam install merlin | |
$ opam install ocp-indent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:opamshare = substitute(system('opam config var share'),'\n$','','''') | |
execute 'set rtp+=' . g:opamshare . '/merlin/vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NeoBundle 'scrooloose/syntastic' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let g:syntastic_ocaml_checkers = ['merlin'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute 'set rtp^=' . g:opamshare . '/ocp-indent/vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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