Saturday, May 1, 2010

Re: How to :new a window below the current window?

On May 1, 6:13 pm, Tim Chase <v...@tim.thechases.com> wrote:
> On 05/01/2010 05:59 PM, Peng Yu wrote:
>
> > :new by default open a window above the current window. Is there a
> > command to open a new window below the current one?
>
> You can use
>
>    :below new
>
> which you can read about at
>
>    :help :below
>
> If you want it to always split below, you can investigate the
> 'splitbelow' option
>
>    :help 'splitbelow'
>
> which you can set in your vimrc so that new/split windows are
> created below the current one instead of above it.  However, it's
> easy enough to override with the ":bel" command.

"open file under cursor
map <C-O> :exe "below new ".expand("<cfile>")<CR>
map <C-S-O> :exe "new ".expand("<cfile>")<CR>

I put the above comand in ~/.vimrc. I expect that ctrl+shift+o open a
new window above the current one and ctrl+o open a new window below
the current one. However, both of them open a new window above the
current one. Would you please let me know how to fix the first command?

--
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

No comments:

Post a Comment