pathogen 사용시 .vimrc 질문입니다.

isty2e의 이미지

현재 pathogen 설치 상태에서 nerdtree, nerdcommenter, rainbow parentheses, scratch, snipmate를 사용중입니다.

" pathogen
filetype off
call pathogen#runtime_append_all_bundles()
filetype plugin indent on
 
...
 
" plugin-specific ones
" nerdtree
nnoremap <leader>nt <ESC>:NERDTree<CR>
" rainbow parentheses
nnoremap <leader>rp :RainbowParenthesesToggle<CR>
" scratch
nnoremap <silent> <leader><Tab> :Scratch<CR>

이렇게 .vimrc를 만들었는데... 맨 뒷부분에 있는 plugin-specific한 것을 플러그인이 있을 때만 작동하도록 하고 싶습니다. 다른 시스템에서도 써야 하니까요.

제가 알기로 pathogen은 플러그인을 로드한다기보다는 runtime path를 조절해서 플러그인을 우회해서 로드한다고 알고 있는데, 이 상황에서 if-has나 if-exists(사실 뭘 써야 할지 잘 모르겠습니다만)로 넣어도 작동이 안 된다더군요.

구글링을 해도 마땅히 찾을 수가 없어 질문드립니다.

neocoin의 이미지

그냥 file path를 검사하시는건 어떤가요?
이렇게 말이죠.

echo isdirectory(expand("~/.vim/bundle"))
 
if isdirectory(expand("~/.vim/bundle/plugin_name"))
  echo "exist!"
endif
isty2e의 이미지

흠, 그런 방법이 있군요. 감사합니다.

헌데 나중에 vundle을 쓰게 된다면 그 때는 또 어찌될지...