On 02/05/10 01:49, Peng Yu wrote:


On May 1, 6:13 pm, Tim Chase<[email protected]>  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?


Ctrl-O and Ctrl-Shift-O are both 0x0F; if you map them to different {rhs}es, the last one wins. Also, this hides the standard meaning of Ctrl-O, namely, "go to older place in jumplist". Try mapping them to, let's say, F8 and Shift-F8 instead.

Best regards,
Tony.
--
Moon, n.:
        1. A celestial object whose phase is very important to
hackers.  See PHASE OF THE MOON.  2. Dave Moon (m...@mc).

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