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

11156Re: mac-like arrow key navigation?

Expand Messages
  • Tony Mechelynck
    Dec 28, 2009
    • 0 Attachment
      On Nov 27, 11:31 pm, dc <dc.pik...@...> wrote:
      > hi -
      > enjoying macvim, and its great for block editing.
      > but does anyone have a mapping file for normal mac-like motion in
      > insert mode?
      > eg
      > opt-left = move a word to left
      > shift-opt-left = select a word to left
      > cmd-opt-left = go to beginning of line
      > opt-delete = delete a word
      > etc.
      > flipping to command-mode for each word motion is kinda tediious
      > i tried like:
      >  imap <M-Left> <Esc>bi
      > without luck.
      > btw these start/end of line emacs style keys are indispensable, it
      > would just be great if they worked on the vi command mode as well as
      > in the editor. hitting :e and editing a path, theres no easy way to
      > just edit the command
      >  imap <C-a> <Esc>0i
      >  imap <C-e> <Esc>$a

      Even if you don't have a <Ctrl> or <Home> key, I believe they can
      still be used in the {rhs} of mappings, as follows:

      noremap! <M-Left> <C-Left>
      noremap! <S-M-Left> <S-C-Left>
      noremap! <D-M-Left> <Home>
      noremap! <D-M-Right> <End>
      noremap! <D-Del> <C-W>

      etc. But I'm not on a Mac so I can't test it. They should work at
      least in Console Vim (I suppose); for MacVim I'm not sure how much it
      differs from "mainline" gvim. Note that I'm intentionally using
      "noremap!" rather than "inoremap", in order to get the same result in
      both Insert and Command-line modes.

      :help ins-special-special
      and for the latter mapping (of course)
      :help i_CTRL-W

      Best regards,
      "I'd love to go out with you, but I did my own thing and now I've got
      to undo it."

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