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

Re: Mappings

Expand Messages
  • Russell Shaw
    ... This is really great: set keymodel=startsel,stopsel enables shift-arrow keys for visual vnoremap y vnoremap d vnoremap
    Message 1 of 3 , Nov 29, 2003
    • 0 Attachment
      Antoine J. Mechelynck wrote:
      > Russell Shaw <rjshaw@...> wrote:
      >
      >>Hi,
      >>In windows, i can do: <SHIFT>+<DOWN> (shift key and numeric keypad
      >>"down" key simultaneously), and it gives the effect of pressing
      >>v (visual), then pressing the "down" key to extend a selection.
      >>How do i do that noremap mapping?
      >
      > This effeft is not the result of a mapping: when "startsel" is present in
      > the 'keymodel' option, then pressing a shifted arrow key starts Select mode
      > (which is a variant of Visual mode, but where an 'isprint' key will
      > _replace_ the selection and start Insert mode). If 'keymodel' (q.v.) also
      > includes "stopsel", you need to hold the Shift key down to extend the
      > selection with arrow keys.
      >
      > I think (but haven't tested it) that you may reassign that action to any key
      > with (let's say)
      >
      > :noremap <F5> <S-Left>
      > :noremap <F6> <S-Down>
      > :noremap <F7> <S-Up>
      > :noremap <F8> <S-Right>
      >
      > (similarly <S-Home>, <S-End>, <S-PageUp>, <S-PageDown>)
      >
      > provided that 'keymodel' includes "startsel".
      >
      > Beware: using the ":behave" command alters 'keymodel':
      >
      > :behave mswin " side-effect: set keymodel=startsel,stopsel
      >
      > :behave xterm " side-effect: set keymodel=
      >
      > I prefer :set keymodel=startsel " YMMV
      >
      > HTH,
      > Tony.

      This is really great:

      set keymodel=startsel,stopsel " enables shift-arrow keys for visual
      vnoremap <C-Insert> y
      vnoremap <S-Delete> d
      vnoremap <S-Insert> P
      inoremap <C-Insert> y
      inoremap <S-Delete> d
      inoremap <S-Insert> <C-O>P

      However, after a year of learning vim, i feel guilty
      about corrupting my brain with this stuff now.
    Your message has been successfully submitted and would be delivered to recipients shortly.