Loading ...
Sorry, an error occurred while loading the content.

97600Re: Mappings to shift-keys within terminal mode

Expand Messages
  • Tony Mechelynck
    Nov 1, 2008
      On 02/11/08 00:17, peter holm wrote:
      > lör 2008-11-01 klockan 15:59 +0100 skrev Tony Mechelynck:
      >> On 01/11/08 11:19, peter holm wrote:
      >>> I have a few mappings to the shift keys (to mimike the BorlandC Editor)
      >>> Well - i don't get it to work in terminal.
      >>> Any idea?
      >>> /Peter Holm
      >> Which shift keys? On which OS? On which terminal or terminal emulator?
      >> "Borland C" makes me believe you're on Windows, but in the Windows
      >> console (the "dos box" as used by cmd.exe) there should be no problem.
      >> But naming "terminal" with no article seems to point to MacOsX, where
      >> the most common terminal emulator is called Terminal.app. Or are you
      >> using "terminal" as a generic name for any kind of text console
      >> including the Linux text console, the konsole application which is part
      >> of KDE, the gnome-terminal which is of course part of Gnome, the xterm
      >> console which is a generic terminal emulator for X11 systems, etc.?
      >> However, all these text consoles have different properties, their $TERM
      >> or 'term' values are different, etc.
      >> If you are trying to map the Shift key without another key to be hit
      >> together with it, or if you are trying to distinguish between left-shift
      >> and right-shift, Vim can't do it.
      >> Shift-F1 to Shift-F12 ought to work, but I notice that here in konsole
      >> Shift-F12 isn't seen by Vim. The other ones are though. In the Linux
      >> console however, my Vim sees Shift-F1 to Shift-F8 but doesn't know what
      >> they are; Shift-F9 to Shift-F12 it just doesn't see.
      >> Shift-Up etc. may or may not work depending on whether the
      >> termcap/terminfo entries Vim is using match what your keyboard interface
      >> is sending.
      >> In general, it's better to give enough specific details for people to
      >> understand exactly what you're trying to do and what happens or doesn't
      >> happen.
      >> Best regards,
      >> Tony.
      > Sorry . that was bad from my side, and i appricate very much your
      > detaljed ansver despite my lack of information.
      > My system is ubuntu 8.10, and i want this mappings to work.
      > http://groups.google.com/group/vim_use/browse_thread/thread/12892e26ed72f3f5?pli=1
      > In Short- i would like to, at first- get this settings to work in the
      > linux terminal, then (hopefully) i would like to get it to to work in
      > xterm and kde-konsloe as well.
      > 00
      > I ma not very sure how to change my settings to get it to work in
      > linux-terminal, and i appricate all the help i can get.
      > My settngs in linux-terminal is
      > TTY=linux
      > the only change i have done is
      > stty -ixon
      > in my .bashrc

      Well, I'm on openSUSE Linux, which is maybe not identical with Ubuntu
      but at least it's not too different.

      I just loaded Vim here in my Linux console, and when I hit Shift-Up,
      Shift-Down, Shift-Left, Shift-Right, Shift-Ins or Shift-Del Vim sees the
      same key without the Shift modifier. Shift-PgUp and Shift-PgDn it
      doesn't see at all.

      The best suggestion I can offer is to choose a different {lhs} for the
      mappings. Maybe F5 to F8 because they are almost straight up from hjkl.
      The resulting mappings would be as follows:

      imap <F5> <esc>v<Left>
      vmap <F5> <Left>
      imap <F6> <esc>v<Down>
      vmap <F6> <Down>
      imap <F7> <Esc>v<Up>
      vmap <F7> <Up>
      imap <F8> <esc>v<Right>
      vmap <F8> <Right>

      Best regards,
      "An ounce of prevention is worth a pound of purge."

      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Show all 9 messages in this topic