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

key chording in vim

Expand Messages
  • michael raba
    hello, I want to do the following with gvim: Hold down the s key, then press 1. Type hello world Note1: if I just press s, it acts like normal. Note2: If I
    Message 1 of 3 , Apr 14, 2013
    • 0 Attachment
      hello,

      I want to do the following with gvim:

      Hold down the 's' key, then press 1.
      Type "hello world"

      Note1: if I just press s, it acts like normal.
      Note2: If I hold down 1 and press s, it should not do anything

      Is this possible to do natively?

      Thanks in advance

      Michael Raba

      --
      --
      You received this message from the "vim_use" 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_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Tony Mechelynck
      ... No. Vim gets its keyboard input in cooked mode, and that means that if you hold down the s key, after a short time (configurable in the BIOS at boot
      Message 2 of 3 , Apr 14, 2013
      • 0 Attachment
        On 14/04/13 23:48, michael raba wrote:
        > hello,
        >
        > I want to do the following with gvim:
        >
        > Hold down the 's' key, then press 1.
        > Type "hello world"
        >
        > Note1: if I just press s, it acts like normal.
        > Note2: If I hold down 1 and press s, it should not do anything
        >
        > Is this possible to do natively?

        No. Vim gets its keyboard input in "cooked" mode, and that means that if
        you hold down the s key, after a short time (configurable in the BIOS at
        boot time) the keyboard repeat will kick in and you will get a string of
        s letters. That string will stop if you press 1 but Vim will have no way
        to know that the s key is still down.

        What you can do is have Vim type "Hello world" if you press and release
        s then press and release 1. See :help "map.txt" and check both mappings
        and abbreviations. If, in addition, you want Vim not to do its usual
        when you press 1 followed by s (which is the same as s i.e. delete the
        character at the cursor and start Insert mode) you will have to define
        an additional mapping to override that:

        :nnoremap s1 :echomsg "Hello world"<CR>
        :nnoremap 1s <Nop>

        >
        > Thanks in advance
        >
        > Michael Raba
        >

        Best regards,
        Tony.
        --
        You are the only person to ever get this message.

        --
        --
        You received this message from the "vim_use" 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_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • michael raba
        This plugin appears to do somewhat what I want http://www.vim.org/scripts/script.php?script_id=2425 Except that Requirement 2) isn t met. -- -- You received
        Message 3 of 3 , Apr 14, 2013
        • 0 Attachment
          This plugin appears to do somewhat what I want

          http://www.vim.org/scripts/script.php?script_id=2425

          Except that Requirement 2) isn't met.

          --
          --
          You received this message from the "vim_use" 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_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+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.