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

Re: mac-like arrow key navigation?

Expand Messages
  • björn
    ... I agree with Niklas suggestion, but if you really insist on wanting the above bindings you can just add the lines if has( gui_macvim ) let
    Message 1 of 6 , Dec 1, 2009
    • 0 Attachment
      2009/11/27 dc:
      > 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.

      I agree with Niklas' suggestion, but if you really insist on wanting
      the above bindings you can just add the lines

      if has("gui_macvim")
      let macvim_hig_shift_movement = 1
      endif

      to your ~/.vimrc file and open a new window (see ":h macvim-shift-movement").

      Björn

      --
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... Even if you have no or key on your keyboard, I believe you can still use these keys in the {rhe} of mappings, like this: noremap! --
      Message 2 of 6 , 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 have no <Home> or <Ctrl> key on your keyboard, I believe
        you can still use these keys in the {rhe} of mappings, like this:

        noremap! <M-Left>

        --
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Tony Mechelynck
        ... Even if you don t have a or key, I believe they can still be used in the {rhs} of mappings, as follows: noremap! noremap!
        Message 3 of 6 , 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.

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

          Best regards,
          Tony.
          --
          "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
        Your message has been successfully submitted and would be delivered to recipients shortly.