Proposal: let g:netrw_keepdir = 0 #27

Closed
idbrii opened this Issue Jan 29, 2013 · 3 comments

Comments

Projects
None yet
3 participants

idbrii commented Jan 29, 2013

Navigating in netrw to change the cwd makes so much sense to me that it seems like it should be the default. Although, I'm not sure how much you want to change the behaviour of other plugins.

teranex commented Jan 29, 2013

I disagree with this. I use the Rooter plugin and an autocommand to automatically cd to the root of the project whenever I open a file which is inside a repository (='project'). This makes it easy to use ctrlp for the entire project, use Ack to search the entire project etc. So while I'm working my CD never changes and always points to the root of my project.

idbrii commented Jan 29, 2013

Looking around my vim settings, I realize that probably makes the most sense if you use autochdir or something similar. I use this:

au BufReadPost * if &ft != 'help' | silent! cd %:p:h | endif

So when I edit files or refresh my buffer (I have nnoremap <S-space> :e<CR>), then I'm in that file's directory. Opening directories in netrw probably makes me think of opening files (and chdiring to them).

@teranex: My projects have hierarchies so deep that I can't imagine using something like Rooter. I guess that would be useful for Ack (although how do you search within the current subtree?). I use ctrlp's root markers and a search index (codesearch + notgrep). I can see how this default breaks anyone who doesn't auto change their cwd.

Owner

tpope commented Jan 29, 2013

Yeah, this is pretty clearly not a good fit.

tpope closed this Jan 29, 2013

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