{"id":1578,"date":"2016-11-18T13:07:01","date_gmt":"2016-11-18T04:07:01","guid":{"rendered":"https:\/\/blog.ymyzk.com\/?p=1578"},"modified":"2016-11-18T13:07:01","modified_gmt":"2016-11-18T04:07:01","slug":"dein-vim-merlin-lazy-loading","status":"publish","type":"post","link":"https:\/\/blog.ymyzk.com\/2016\/11\/dein-vim-merlin-lazy-loading\/","title":{"rendered":"dein.vim \u3092\u7528\u3044\u3066 Merlin \u3092\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3059\u308b"},"content":{"rendered":"
Merlin<\/a> \u306f OCaml \u306e\u305f\u3081\u306e Vim \u3084 Emacs \u304b\u3089\u5229\u7528\u53ef\u80fd\u306a\u88dc\u5b8c\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059. \u30c7\u30d5\u30a9\u30eb\u30c8\u306e Vim \u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3067\u306f, Vim \u306e\u8d77\u52d5\u901f\u5ea6\u306b\u60aa\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u305f\u3081, \u30d7\u30e9\u30b0\u30a4\u30f3\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u00a0dein.vim<\/a> \u3092\u7528\u3044\u3066\u9045\u5ef6\u8aad\u307f\u8fbc\u307f\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059.<\/p>\n <\/p>\n Merlin \u306f OPAM \u3092\u4f7f\u3046\u3068\u7c21\u5358\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u307e\u3059.<\/p>\n Merlin \u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3059\u308b\u3068, \u6b21\u306e\u3088\u3046\u306a Vim \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u624b\u9806\u304c\u8868\u793a\u3055\u308c\u307e\u3059.<\/p>\n \u3053\u306e\u624b\u9806\u306b\u5f93\u3044, \u4ee5\u4e0b\u3092 \u6b21\u306b\u88dc\u5b8c\u7528\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u304b\u3089 Merlin \u3092\u4f7f\u3046\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059. \u3053\u3053\u3067\u306f neocomplete.vim<\/a> \u3092\u5229\u7528\u3057\u307e\u3059.<\/p>\n \u3053\u3053\u307e\u3067\u306e\u8a2d\u5b9a\u304c\u7d42\u308f\u308b\u3068, neocomplete \u3092\u901a\u3058\u3066 Merlin \u306e\u88dc\u5b8c\u6a5f\u80fd\u3092\u5229\u7528\u3067\u304d\u307e\u3059.<\/p>\nMerlin \u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7<\/h2>\n
opam install merlin<\/code><\/pre>\n
Quick setup for VIM\r\n-------------------\r\nAppend this to your .vimrc to add merlin to vim's runtime-path:\r\nlet g:opamshare = substitute(system('opam config var share'),'\\n$','','''')\r\nexecute \"set rtp+=\" . g:opamshare . \"\/merlin\/vim\"\r\n\r\nAlso run the following line in vim to index the documentation:\r\n:execute \"helptags \" . g:opamshare . \"\/merlin\/vim\/doc\"<\/code><\/pre>\n
.vimrc<\/code> \u7b49\u306b\u8ffd\u8a18\u3057\u307e\u3059.<\/p>\n
let g:opamshare = substitute(system('opam config var share'),'\\n$','','''')\r\nexecute \"set rtp+=\" . g:opamshare . \"\/merlin\/vim\"<\/code><\/pre>\n
if !exists('g:neocomplete#sources#omni#input_patterns')\r\n let g:neocomplete#sources#omni#input_patterns = {}\r\nendif\r\nlet g:neocomplete#sources#omni#input_patterns.ocaml = '[^. *\\t]\\.\\w*\\|\\h\\w*|#'<\/code><\/pre>\n