simple mapping: split on new buffer

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

simple mapping: split on new buffer

jkilbour
I wish to map <C-w>n (to open a a new buffer in a split window)to <C-n>n,
as I don't like the reach of <C-w>.

I added
map <C-b>b <C-w>n
to my _vimrc, which did not work. How can I do this?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: simple mapping: split on new buffer

Tim Chase-2
> I wish to map <C-w>n (to open a a new buffer in a split
> window)to <C-n>n, as I don't like the reach of <C-w>.
>
> I added map <C-b>b <C-w>n to my _vimrc, which did not work.
> How can I do this?

Well, obviously, if you want <c-n>n to open a window, mapping
<c-b>b won't do it for you :*)

However, that mapping does work for me.  You may, however, be
continuing to hold down the control key.  Thus, you may also have to

map <c-b><c-b> <c-w>n

rather than your original.

Also, IIUC, this should only work in normal mode--not in the
other ones, and if either <c-w> or "n" is mapped to something
else, it may take precidence.  So you may want to make it

nnoremap <c-b><c-b> <c-w>n

Alternatively, if for some reason, you still have trouble, you
might try

nnoremap <c-b><c-b> :new<cr>

which will use the Ex command (though it's really a Vim command,
as it's not in "real/old" vi...does that make it a "Vex" command?)

Just a few options to explore.  However, all of these options
work here locally.  If you continue to have trouble with the
mappings, see what happens when you start vim with

        vim -u NONE -U NONE

to make sure there aren't any funky mappings or other things
getting loaded at the startup.

Substitute <c-b> with <c-n> where desired, if that was your
original intent :)

-tim





Reply | Threaded
Open this post in threaded view
|

Re: simple mapping: split on new buffer

A.J.Mechelynck
Tim Chase wrote:
[...]
> Alternatively, if for some reason, you still have trouble, you
> might try
>
> nnoremap <c-b><c-b> :new<cr>
>
> which will use the Ex command (though it's really a Vim command,
> as it's not in "real/old" vi...does that make it a "Vex" command?)
[...]

I guess it makes it an "exim" command (see ":help exim")

Best regards,
Tony.