Allow executing a custom command after opening project directory #1

Merged
merged 2 commits into from Jan 6, 2012
View
@@ -10,7 +10,7 @@ command! -nargs=1 -complete=custom,ProjectComplete Open :call Open(<f-args>)
function! Open(project)
call OpenDir(g:project_dir . '/' . a:project)
- execute 'normal l'
+ execute 'normal l'
endfunction
function! OpenDir(path)
@@ -23,13 +23,17 @@ function! OpenDir(path)
new
endif
silent only
- execute 'NERDTree ' . a:path
+ if exists('g:open_dir_callback')
+ execute g:open_dir_callback
+ else
+ execute 'NERDTree ' . a:path
+ endif
endfunction
function! OpenVimrc()
call OpenDir("~/.vim")
execute 'normal I'
- execute 'normal l'
+ execute 'normal l'
execute 'edit .vimrc'
endfunction