2009/4/28 Gary Johnson <[email protected]> > > On 2009-04-28, Pablo Giménez wrote: > > Hi vims. > > Well I haveaa buch of keymaos using the Shift key that works perfectly in > > gvim, but not in the terminal, for instance: > > [...] > > > I use these mappings to make selections using the shift key as in regular > > editors, but no one og them do nothing in the terminal. > > The thing that is strange for me is that these other maps works: > > nnoremap <C-S-Left> vb > > nnoremap <C-S-Right> ve > > vnoremap <C-S-Left> b > > vnoremap <C-S-Right> e > > inoremap <C-S-Left> <Esc><Left>vb > > inoremap <C-S-Right> <Esc><Right>ve > > > > So I guess that meybe the problem is with the PageDown/Up and Home/End > keys > > and not with the Shift. > > Any ideas???? > > GUI programs such as gvim receive keyboard input in the form of > keycodes, that is, some indication of which key was typed along with > any modifier keys that were being pressed at the time. Terminal > emulators also receive keyboard input in this form, but they send to > their client programs (such as vim) only 8-bit characters. Some > keys such as the arrow keys and the function keys (f1, et al.) are > indicated to the clients by sequences of 7-bit (ASCII) characters. > For example, when I press the left arrow on this keyboard, the > terminal emulator sends <esc>OD to vim, where <esc> is the ASCII > Escape character, decimal value 27. > > Terminal emulators typically send unique characters or sequences of > characters beginning with the Escape character (escape sequences) > only for symbols visible on the keyboard, not for arbitrary > combinations of keys and modifiers. Notable exceptions, as you have > discovered, are the arrow keys with Shift and/or Ctrl modifiers to > allow terminal-based editors to adopt popular GUI editor paradigms. > > So, you're not going to be able to use with vim in a terminal all > the mappings you can use with gvim. Which ones you can use depends > on the particular terminal emulator you're using. To find out what > character or charter sequence your terminal is emitting for a given > key, put vim into insert mode, type Ctrl-V, then type the key in > question. If Home and Shift-Home, for example, generate the same > character sequence, then vim won't be able to distinguish them.
Thanks Gary for he explanation, I understand. I have checked and yes in my terminal, a xterm, is returning the same codes for both Home and Ctrl-Home, in fact any combination of Home returns always the same code. So is there any way so setup a xterm to send to client applicatins keycodes instead of the ASCII 8bits codes??? thx > > > HTH, > Gary > > > > > > -- Un saludo Best Regards Pablo Giménez --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
