0

This is really odd. Here's the key mapping from my .vimrc:

noremap <C-n> :vert new<CR>

The expected behaviour when I press CTRL-n is that it opens a vertical window but it somehow opens a horizontal window on top of the current.

The problem only arises for the mappings. When I try :vert new from Vim, I get what I want, a new vertical window.

I have also tried :vnew and :vsplit new, they all work fine when I manually initiate them. Does not work with CTRL-n.

  • Please share your complete version ($ vim --version) and the content of your ~/.vimrc. – romainl Jun 10 '14 at 19:31
  • From $ vim --version: VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 12 2013 00:23:33) This is my .vimrc. Check out line 146. – maverick97 Jun 11 '14 at 4:46
  • I asked for your complete version. – romainl Jun 11 '14 at 5:19
1

This line:

noremap  <C-N>    :new<CR>

overrides the previous one because <C-N> is the same as <C-n>.

Choose your mappings more wisely.

  • Thanks, it worked. :) Then, how do I map keys that are capitalized? I tried something like <C><S>n and <C>N. Didn't work, how do you map it? – maverick97 Jun 11 '14 at 7:51
  • You don't. <C-S-n> would be the canonical representation of Ctrl+N (IIRC) but Vim won't make a difference between Ctrl+N and Ctrl+n anyway. See :help ctrl-{char}. – romainl Jun 11 '14 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.