Skip to content

Add rooter_change_directory_for_project_files option #117

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugin/rooter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ if !exists('g:rooter_change_directory_for_non_project_files')
let g:rooter_change_directory_for_non_project_files = ''
endif

if !exists('g:rooter_change_directory_for_project_files')
let g:rooter_change_directory_for_project_files = 'root'
endif

if !exists('g:rooter_silent_chdir')
let g:rooter_silent_chdir = 0
endif
Expand Down Expand Up @@ -79,7 +83,12 @@ function! s:rooter()
return
endif

call s:cd(root)
if g:rooter_change_directory_for_project_files ==? 'root'
let dir = root
elseif g:rooter_change_directory_for_non_project_files ==? 'current'
let dir = s:current()
endif
call s:cd(dir)
endfunction


Expand Down