On 07/01/2011, at 09:31, beo wulf wrote:

> Is it possible to have NERDtree loaded on startup, but to have the
> cursor not in the NERDTree buffer?
> 
> I have tried:
> 
> function! LoadNERDTree()
>  :NERDTree
>  normal "<c-w>l"
> endf
> 
> :au VimEnter * :call LoadNERDTree()
> 
> 
> But the problem is that I end up starting in the NERDTree buffer
> rather than the buffer of the file I want to edit.
> 
> Thanks!
> 

You could use this instead of normal:

        feedkeys ("\<c-w>p")

:h :feedkeys
The ctrl-w p  puts the cursor at the last used buffer. Be sure to use double 
quotes in the function.

Cheers,
        Daniel


------------------------------------------------------------
Daniel Corrêa
+55 (45) 9938.3993
http://about.me/dnlcorrea



> -- 
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to