3

I want to remap Ctrl-] which is used for jumping to the tags to another key binding.

These mappings work:

:map <F2> <C-]> :map <A-1> <C-]> 

But this mapping doesn't work:

:map <C-1> <C-]> 

What might be the reason for this?

3
  • What does Vim show when you type <C-v><C-1>? I think it must be possible to map this in Gvim, but I do not think that you will be able to map this in Vim. Commented Jun 11, 2010 at 16:45
  • 1
    And, it is good to use *noremap instead of *map unless you know that you definitely need to use *map. It can save your time because you may run into the situation when your mapping does not work as expected because some characters are remapped somewhere else. Commented Jun 11, 2010 at 16:48
  • Failed to map <C-1> in gvim-7.2.303, typing <C-1> just produces 1. Commented Jun 11, 2010 at 16:54

2 Answers 2

1

I believe the problem is that Ctrl+1 is not a valid ASCII character. From this list

(search for "^^" or "^@" to see the table )

you will see that there are several keybindings such as ctrl+@ Ctrl+^ and Ctrl+]

so you are not actually calling Ctrl+2 or Ctrl+6 but their ASCII equivalents.

VIM is designed to be lightweight and fairly platform independent. so if it isn't in the list of ASCII characters you cannot make a binding to it.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried <C-,> and other symbols as well. I cannot map them neither.
0

It might be getting trapped/filtered by your OS. If you check the mappings, is it listed?

1 Comment

Yes I can see it in the mappings list.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.