Skip to content
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

Only one file name allow when changing current working directory automatically #8

Closed
johnathanz opened this issue Sep 5, 2014 · 2 comments

Comments

@johnathanz
Copy link

When changing current working directory automatically with the command in vimrc:
au BufEnter * if &ft != 'help' | ProjectRootCD | endif

Get the error:
Error detected while processing BufEnter Auto commands for "*":
E172: Only one file name allowed: ProjectRootCD | endif

@dbakker
Copy link
Owner

dbakker commented Sep 5, 2014

Confirmed. From reading the documentation, it's not possible to use | inside autocommands.

The easiest solution would be to change it to:

autocmd BufEnter * ProjectRootCD

I think I'll change the documentation to that, and perhaps move the 'help' logic into ProjectRootCD itself.

@dbakker
Copy link
Owner

dbakker commented Sep 5, 2014

Okay, never mind my last comment. The way this can be done is:

au BufEnter * if &ft != 'help' | call ProjectRootCD() | endif

Which is wrong in the builtin documentation. I'll update it. Thanks for reporting!

@dbakker dbakker closed this as completed in 9386e34 Sep 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants