1

(it's a new topic whose starting point is this question)

To make it short, I think I can't make mapping with 2-keys combination in vim (<key1-key2>, or <A-j> for example). One-key mapping is okay.

However, 2 (or more, I didn't try) keys mapping work just fine in gvim !

Anyone has a clue ? Thanks for the help !


(if you want to know which mapping I tried, I followed this tutorial. It worked when I tried with <F_something>, but not with the mapping of the tutorial. Again, it was okay in gvim)

Community
  • 1
  • 1
Bamban
  • 107
  • 2
  • 14

1 Answers1

3

From Vim's point of view, <C-o>, <C-O> or <C-S-o> can't be distinguished from each other and the situation is even more complicated with <A-... mappings.

While Vim allows you to do nnoremap <C-S-o> :echo "hello"<CR> without complaining, you'll get hello whether you press <Shift> or not.

I suggest you use <leader> instead: :h mapleader.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • Ok, thanks a lot, i managed to make it work with `,` key. I gave up using `Alt`. – Bamban Jun 17 '13 at 10:41
  • However, with this trick, I could not find a way to use a shortcut in insert mode. Is there something I haven't thought about ? – Bamban Jun 17 '13 at 14:23
  • Which key would you suggest to use ? I tried `,` but obviously, in visual mode it only write a coma. – Bamban Jun 17 '13 at 14:43
  • My bad, I might have forgotten to source my .vimrc :/ Thanks again for your help. – Bamban Jun 17 '13 at 14:59