èªä½ãã©ã°ã¤ã³ã neobundle.vim ã§ç®¡çãã
ãã®è¨äºã¯ Vim Advent Calendar 2012 326æ¥ç®ã®è¨äºã«ãªãã¾ãã
[追è¨]
è²ã ã¨ã³ã¼ããä¿®æ£ãã¾ããã
æ¨æ¥ Lingr ã® Vim é¨å±ã§
ãneobundle.vim ã§èªä½ãã©ã°ã¤ã³ã®ç®¡çã¯ã©ãããã®ãã
ã¿ãããªè©±ãåºã¦ããã®ã§ä»åã¯ããããè¡ã£ã¦ãã管çæ¹æ³ã®ç´¹ä»ã§ããã¦ã¿ããã¨æãã¾ãã
[ä¿åãã£ã¬ã¯ããª]
neobundle.vim ã§ç®¡çãã¦ãããã©ã°ã¤ã³ã¯åºæ¬çã«ã¯ neobundle#rc({dir}) ã§è¨å®ãããã£ã¬ã¯ããªã«ä¿åããã¾ãã
call neobundle#rc(expand($HOME."/neobundle")) " $HOME."/neobundle" ã«ãã©ã°ã¤ã³ãã¡ã¤ã«ãä¿åããã NeoBundle "Shougo/vimproc.vim" NeoBundle "Shougo/unite.vim" NeoBundle "Shougo/vimfiler.vim" NeoBundle "Shougo/vimshell.vim"
ããããèªä½ãã©ã°ã¤ã³ã¯ä»ã®ãã©ã°ã¤ã³ã¨ã¯å¥ã®å ´æã«ä¿åãããäºãããã¨æãã¾ãã
ï¼e.g.èªä½ãã©ã°ã¤ã³ã¯ Dropbox ã®ä¸ã«æ¾ãè¾¼ã¿ãã
ãã®å ´å㯠:NeoBundle æã«åå¥ã«ä¿åãããã£ã¬ã¯ããªãæå®ããäºãã§ãã¾ãã
call neobundle#rc(expand($HOME."/neobundle")) " $HOME."/neobundle" ã«ãã©ã°ã¤ã³ãã¡ã¤ã«ãä¿åããã NeoBundle "Shougo/vimproc.vim" NeoBundle "Shougo/unite.vim" " "base" ã§æå®ãããã£ã¬ã¯ããªã«ä¿åã»èªã¿è¾¼ã¿ãè¡ããã NeoBundle "vim-marching", { \ "base" : "C:/Dropbox/vim/plugin" \ "type" : "nosync" \} NeoBundle "vim-operator-search", { \ "base" : "C:/Dropbox/vim/plugin" \ "type" : "nosync" \}
ããã§èªä½ãã©ã°ã¤ã³ã«å¯¾ãã¦ä¿åãã¦ãããã£ã¬ã¯ããªãæå®ããäºãã§ãã¾ãã
[:NeoBundleUpdate ã§æ´æ°ãããªãããã«ãã]
èªä½ãã©ã°ã¤ã³ã®å ´åã:NeoBundleUpdate ã§ã®æ´æ°ã¯ã»ã¨ãã©æå³ãããã¾ããã
"stay_same" ãè¨å®ãã¦ãã㨠:NeoBundleUpdate ã§æ´æ°ãè¡ãããªãããã«ããäºãã§ãã¾ãã
ã¾ãã:NeoBundleUpdate! ã§ãæ´æ°ãããªãããã«ããå ´åã¯ã"type" : "nosync" ãè¨å®ãã¦ããã¨ããã§ãããã
call neobundle#rc(expand($HOME."/neobundle")) " $HOME."/neobundle" ã«ãã©ã°ã¤ã³ãã¡ã¤ã«ãä¿åããã NeoBundle "Shougo/vimproc.vim" NeoBundle "Shougo/unite.vim" " :NeoBundleUpdate ã§æ´æ°ãããªãã " :NeoBundleUpdate! ã§ã¯æ´æ°ããã NeoBundle "vim-marching", { \ "base" : "C:/Dropbox/vim/plugin", \ "stay_same" : 1, \} " :NeoBundleUpdate! ã§ãæ´æ°ãããªã NeoBundle "vim-operator-search", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \}
èªä½ãã©ã°ã¤ã³ã®å ´å㯠"type" : "nosync" ãè¨å®ãã¦ããã¨ããã¨æãã¾ãã
[èªä½ãã©ã°ã¤ã³ç¨ã®ã³ãã³ããå®ç¾©ãã]
ãã¦ãèªä½ãã©ã°ã¤ã³ã¯ä¸è¨ã®ãããªè¨å®ã使ç¨ããã¨ããã§ãããã
ãããã:NeoBundle ãããã³ã«ãªãã·ã§ã³ãè¨å®ããã®ã¯æéã§ãã
" åãè¨å®ãç¶ãã®ã¯ç¡é§ NeoBundle "vim-operator-search", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \} NeoBundle "vim-watchdogs", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \} NeoBundle "vim-reanimate", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \} NeoBundle "unite-qfixhowm", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \} NeoBundleOrigin "vim-textobj-multiblock", { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync" \}
ããããå ´åã¯ã³ãã³ããå®ç¾©ããã¨ããã§ãããã
command! -nargs=1 \ MyNeoBundle \ NeoBundle <args>, { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync", \ } MyNeoBundle "vim-operator-search" MyNeoBundle "vim-watchdogs" MyNeoBundle "vim-reanimate" MyNeoBundle "unite-qfixhowm" MyNeoBundle "vim-textobj-multiblock"
ããã§ã ãã¶ã¹ãããªãã¾ããã
ã¾ããåå¥ã« lazy ã autoload ãªã©ã®ãªãã·ã§ã³ãè¨å®ããã®ã§ããã°æ¬¡ã®ãããªã³ãã³ãã®æ¹ãããã§ãããã
function! s:neobundle_origin(name, ...) let base_option = { \ "base" : "C:/Dropbox/vim/plugin", \ "type" : "nosync", \ } let option = extend(base_option, get(a:, 1, {})) execute "NeoBundle" string(a:name) "," string(option) endfunction command! -nargs=* \ MyNeoBundle \ call s:neobundle_origin(<args>) " "lazy" : "1" ã§ããã° :NeoBundleLazy ã§å®ç¾©ãã NeoBundleOrigin "vim-euphoric_player", { \ "lazy" : 1, \ 'autoload' : { \ "unite_sources" : ["euphoric_player_playlist", "euphoric_player_tracks"], \ } \} NeoBundleOrigin "vim-sugarpot", { \ "layz" : 1, \ 'autoload' : { \ 'commands' : [ \ { \ "name" : "SugarpotPreview", \ "complete" : "file", \ } \ ] \ } \}
ã¨ããããããªæãã§èªä½ãã©ã°ã¤ã³ã使ç¨ããå ´åã«ã neobundle.vim ãæ´»ç¨ãã¦ã¿ãã¨ããã¨æãã¾ãã