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

How to open a file by command? #297

Closed
billychan opened this issue Oct 29, 2013 · 1 comment
Closed

How to open a file by command? #297

billychan opened this issue Oct 29, 2013 · 1 comment

Comments

@billychan
Copy link

I always have a NERDtree window open at left. I'm so lazy that I don't even want to jump to left window to browse file up and down :)

So I created a key mapping

:nnoremap nj <C-W><C-H>jo

Basically it is expected to jump to left window, down to next file and open it for me.

However VIM gave me an error saying something like "E21: can't modify", I guess that's because o had not been converted to NERDtree command yet.

I searched around and can't find such a direct command to use as o in NERDtree window so that I can call it like

<C-W><C-H>j:PleaseOpenThatFileForMe

Anybody has a hint?

Thanks!

@PhilRunninger
Copy link
Member

:nnoremap uses the original definition of keystrokes. o has been remapped in the NERDTree buffer, so you need to use :nmap instead. I'm going to go ahead and close this because this is a very old issue, and you've probably moved on from this. You can reopen it if necessary.

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