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

Re: MacVim, remapping Alt-key as Ctrl-key

Expand Messages
  • Chris Schneider
    I dont have any idea if you can do it at the vim level, but it looks like this tool can do key remapping per application. See that the example has excel-only
    Message 1 of 7 , Mar 7, 2013
    • 0 Attachment
      I dont have any idea if you can do it at the vim level, but it looks like this tool can do key remapping per application. See that the example has excel-only mappings. Maybe play with this a bit?

      http://pqrs.org/macosx/keyremap4macbook/document-private-xml.html.en

      - Chris Schneider

      On Mar 6, 2013, at 2:42 PM, bobby wankenoby <llenaelvacio@...> wrote:

      But I don't want to change the behaviour of my Option keys for my whole OS, I
      know how to do that, and how to do it in iTerm2 too.

      What I need is to change it in MacVim, just it.






      --
      View this message in context: http://vim.1045645.n5.nabble.com/MacVim-remapping-Alt-key-as-Ctrl-key-tp5714335p5714341.html
      Sent from the Vim - Mac mailing list archive at Nabble.com.

      --
      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_mac" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.


      --
      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
       
      ---
      You received this message because you are subscribed to the Google Groups "vim_mac" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
       
       
    • Aaron Cruz
      ... Here is an excerpt from my .vimrc that may get you started. Sorry not more specific, buit I don t have time for experimenting. Plus, this snippet is useful
      Message 2 of 7 , Mar 8, 2013
      • 0 Attachment
        On Wednesday, March 6, 2013 4:19:59 PM UTC+1, bobby wankenoby wrote:
        > I am a MacVim user, and I would like to know if it's possible to make the Alt-Option key behave as a Ctrl key.
        >
        > Thanks for your time gentlemen.

        Here is an excerpt from my .vimrc that may get you started. Sorry not more specific, buit I don't have time for experimenting.
        Plus, this snippet is useful as well :)

        The key mappings are
        M = Cmd
        D = Option
        C = Ctrl

        """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
        " Move a line of text using ALT+[jk] or Comamnd+[jk] on mac
        nmap <M-j> mz:m+<cr>`z
        nmap <M-k> mz:m-2<cr>`z
        vmap <M-j> :m'>+<cr>`<my`>mzgv`yo`z
        vmap <M-k> :m'<-2<cr>`>my`<mzgv`yo`z

        if has("mac") || has("macunix")
        nmap <D-j> <M-j>
        nmap <D-k> <M-k>
        vmap <D-j> <M-j>
        vmap <D-k> <M-k>
        endif
        """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

        --
        --
        You received this message from the "vim_mac" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_mac" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • bobby wankenoby
        Yes, I couldn t find a way of doing it in MacVim, but you are right Chris, KeyRemap4Macbook did the trick. It is a FANTASTIC piece of software, the
        Message 3 of 7 , Mar 8, 2013
        • 0 Attachment
          Yes, I couldn't find a way of doing it in MacVim, but you are right Chris,
          KeyRemap4Macbook did the trick. It is a FANTASTIC piece of software, the
          documentation is just excellent, I recommend it to everybody in difficult
          mapping situations.
          It allows you to customize mappings for each app, in an xml file that you
          can open from inside the app. It's absolutely poka-yoke.
          This is what I wrote in private.xml, for my situation:

          <appdef>
          <appname>MacVim</appname>
          <equal>org.vim.MacVim</equal>
          </appdef>


          <item>
          <name>Change Right Option key to Control</name>
          <identifier>private.remap_rightOption_to_control</identifier>
          <only>MacVim</only>
          <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::CONTROL_R</autogen>
          </item>

          Problem solved!




          --
          View this message in context: http://vim.1045645.n5.nabble.com/MacVim-remapping-Alt-key-as-Ctrl-key-tp5714335p5714369.html
          Sent from the Vim - Mac mailing list archive at Nabble.com.

          --
          --
          You received this message from the "vim_mac" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_mac" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.