Skip to content

Instantly share code, notes, and snippets.

@akiradeveloper
Created August 14, 2012 23:28
Show Gist options
  • Save akiradeveloper/3353873 to your computer and use it in GitHub Desktop.
Save akiradeveloper/3353873 to your computer and use it in GitHub Desktop.
vimscriptの読み込み順
擬似コードでいうとこういう感じなのではないかと推測.
runtimepath = [..., .vim, .vim/after]
def read_script_common(types):
types.each do |type|
runtimepath.each do |rp|
source File.join(rp, type)
# 単純に $ vim とした時
def launch_vim():
read_script_common(['plugin'])
# vimを開いたあと, :e file
def open_buffer(file):
filetype <- file
# filetypeに合ったものを読む.
read_script_common(['ftplugin', 'indent', ...])
# $ vim file
def open_file(file):
launch_vim(); open_buffer(file)
plugin/any.vim
after/plugin/any.vim
ftplugin/haskell.vim
after/ftplugin/haskell.vim
indent/haskell.vim
after/indent.haskell.vim
@akiradeveloper
Copy link
Author

擬似コード修正

@akiradeveloper
Copy link
Author

:set rtp でruntimepathを表示

runtimepath=/.vim/bundle/vim-ruby,/.vim/bundle/vim-textobj-indent,/.vim/bundle/textobj-user,/.vim/bundle/html-template-syntax,/.vim/bundle/syntastic,/.vim/bundle/neco-ghc,
/.vim/bundle/ghcmod-vim,/.vim/bundle/vim2hs,/.vim/bundle/haskellmode-vim,/.vim/bundle/vim-markdown,/.vim/bundle/vim-fugitive,/.vim/bundle/vim-localrc,/.vim/bundle/vim-quick
run,
/.vim/bundle/vim-ref,/.vim/bundle/unite.vim,/.vim/bundle/vimproc,/.vim/bundle/vimfiler,/.vim/bundle/neocomplcache,/.vim/bundle/neobundle.vim,/.vim/bundle/vital.vim,/.v
im/bundle/L9,
/.vim/bundle/dummy-vim-plugin,/.vim,/usr/local/opt/vim-7.3/share/vim/vimfiles,/usr/local/opt/vim-7.3/share/vim/vim73,/usr/local/opt/vim-7.3/share/vim/vimfiles/after
,
/.vim/after,/.vim/bundle/neobundle.vim/,/.vim/bundle/vim2hs/after,/.vim/bundle/ghcmod-vim/after,/.vim/bundle/html-template-syntax/after

@akiradeveloper
Copy link
Author

擬似コード(推測)
def NeoBundle(plugin):
runtimepath.add_head(plugin)
runtimepath.add_tail(plugin/after) if exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment