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

擬似コード(推測)
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