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

mac-like arrow key navigation?

Expand Messages
  • dc
    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
    Message 1 of 6 , Nov 27, 2009
    • 0 Attachment
      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

      --
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
    • caruso_g
      ... Welcome aboard. :) ... I am sorry, I do not have them, but I do not understand why you should need it. The great magic about [Mac]Vim is that you do not
      Message 2 of 6 , Nov 28, 2009
      • 0 Attachment
        > enjoying macvim, and its great for block editing.

        Welcome aboard. :)

        > but does anyone have a mapping file for normal mac-like motion in
        > insert mode?

        I am sorry, I do not have them, but I do not understand why you should
        need it.
        The great magic about [Mac]Vim is that you do not need anymore to move
        your hand to the arrows or anything else.
        Just use Movements/Selection keys and you will be so much faster then
        alt+shift+(log movement of the right hand)+left arrow
        Really, give it a try.

        > opt-left = move a word to left

        b

        > shift-opt-left = select a word to left

        vb

        > cmd-opt-left = go to beginning of line

        0
        (or ^ to the first not blank character of a line!)

        > opt-delete = delete a word

        d[a]w
        (D-elete [A ]W-ord)

        > flipping to command-mode for each word motion is kinda tediious

        Really, it will take you no more then a week to be completely addicted
        to it (I often find myself typing Vim Movement keys in "Pages/TextMate/
        etc." :D )

        > 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

        I
        (uppercase i)

        >  imap <C-e> <Esc>$a

        A
        (uppercase a)

        --
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
      • Niklas Lindström
        Hi, ... In command mode, you can move using (start of command) and (end). And more, see. ... Or if you need to edit the command a lot, press
        Message 3 of 6 , Nov 28, 2009
        • 0 Attachment
          Hi,

          > 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

          In command mode, you can move using <C-b> (start of command) and <C-a>
          (end). And more, see.

          :help cmdline-editing
          :help emacs-keys

          Or if you need to edit the command a lot, press <C-f> to open the
          current command in the [Command Line] window.

          Basically it's a normal vim buffer where hitting return executes the
          line you are on (as in regular command mode) and closes the command
          line window. Pressing <C-c> returns to regular command mode, ":q"
          closes it without running. You have your entire command line history
          in the buffer as well.

          You can also start this directly by pressing "q:" instead of ":" (and
          "q/", "q?" for "/" and "?" respectively). See:

          :help command-line-window

          Best regards,
          Niklas

          --
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
        • 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 4 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 5 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 6 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.