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

Re: Cmd-Enter like in TextMate

Expand Messages
  • Andy Todd
    ... Is it ctrl or cmd o ? Sadly neither of them seems to exhibit this behaviour for me, I must have something else mapped to the appropriate key. Regards,
    Message 1 of 6 , Apr 12, 2009
    • 0 Attachment
      Nico Weber wrote:
      >>> I wonder if it is possible to map Cmd-Enter as it is in TextMate — go
      >>> to end of line and hit enter. I've tried things like
      >>> nmap <D-Enter> <D-Right><cr>
      >>> But it doesn't seem to work.
      >> I'm assuming you're wanting this to happen while you're in insert
      >> mode. Try this:
      >>
      >> imap <D-Enter> <Esc>A<CR>
      >
      > or
      >
      > imap <D-Enter> <Esc>o
      >
      > Also, you can hit ctrl-o in insert mode to execute one normal mode
      > command, which comes in handy every now and then (e.g. cmd-o o, cmd-o
      > O, etc).
      >
      > Nico

      Is it 'ctrl' or 'cmd' o ?

      Sadly neither of them seems to exhibit this behaviour for me, I must
      have something else mapped to the appropriate key.

      Regards,
      Andy
      --
      From the desk of Andrew J Todd esq - http://www.halfcooked.com/

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Skammer
      ... Thanks guys, that worked perfectly. And I didn t know the trick with o and O in normal mode. Pretty handy one. I ve added this mapping either: imap
      Message 2 of 6 , Apr 12, 2009
      • 0 Attachment
        > or
        >
        >      imap <D-Enter> <Esc>o

        Thanks guys, that worked perfectly. And I didn't know the trick with o
        and O in normal mode. Pretty handy one.
        I've added this mapping either:
        imap <D-S-Enter> <Esc>O

        I believe it's very mac-style, so it's nice to have things like this
        in your macvim configuration.

        Thanks again. I better go and read more about VIM ;)
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Nico Weber
        ... ctrl-o, sorry. In insert mode, try ctrl-o followed by o or O (or any other normal mode command). You can use `:imap ` to check this is mapped to
        Message 3 of 6 , Apr 12, 2009
        • 0 Attachment
          >> Also, you can hit ctrl-o in insert mode to execute one normal mode
          >> command, which comes in handy every now and then (e.g. cmd-o o, cmd-o
          >> O, etc).
          >>
          >> Nico
          >
          > Is it 'ctrl' or 'cmd' o ?

          ctrl-o, sorry. In insert mode, try ctrl-o followed by o or O (or any
          other normal mode command). You can use `:imap <ctrl-o>` to check this
          is mapped to something else (over here, this displays "no mapping
          found").

          Nico

          --~--~---------~--~----~------------~-------~--~----~
          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.