0

I found the workaround for mapping Alt key on gnome-terminal in this topic. After editing the vimrc file, my Vim now recognizes Alt-j as ê (which is a non-english character), how can I fix it?

Thanks

Community
  • 1
  • 1
boh
  • 1,477
  • 2
  • 16
  • 35

1 Answers1

3

As explained in the referenced topic, for Vim, Alt + character combinations are represented by ASCII characters with the 8th bit set, which is identical to certain special characters (such as ê). As long as you don't need to type those characters (e.g. because you write in French :-), you can ignore this curiosity; just write your mapping with either <A-j> or the literal ê notation (but after any :set encoding=... in your .vimrc, because that affects how these are interpreted).

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
  • I tried to map gg but it doesnt work, while map gg still work well. – boh Jan 28 '13 at 09:26
  • 1
    @navie strange, it does work here. On your question you mentioned ``, but you said `` on your comment; is there any chance that you mapped uppercase (`J`) and tested with lowercase (`j`)? – mMontu Jan 28 '13 at 10:25
  • I second @mMontu's suggestion: For Alt mappings, the case of the character _does_ matter (for Ctrl it does not, because Vim cannot differentiate shifted chars there). So `` is really ``. – Ingo Karkat Jan 28 '13 at 10:42
  • Be sure that you aren't changing you encoding, as pointed out in the answer, after setting up the mapping (like in your gvimrc). I ran into that myself recently and it caused some consternation. – dash-tom-bang Jan 29 '13 at 03:31
  • Thanks Ingo Karkat amd mMontu, I actually got both the encoding and Upper case problems :P – boh Jan 30 '13 at 05:46