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

mapping Capslock-Key to possible?

Expand Messages
  • Markus Schulz
    Hello, after reading the movement in insert mode thread i came to idea to remap the needless capslock key (currently i mapped to Escape with xmodmap) for
    Message 1 of 8 , Jul 30, 2007
      Hello,
      after reading the "movement in insert mode" thread i came to idea to
      remap the needless capslock key (currently i mapped to Escape with
      xmodmap) for easier movement in insert mode.

      Is this possible, to remap and use then something like: <CapsLock>w to
      move to next word ...?

      --
      Markus Schulz

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Markus Schulz
      ... to clarify a little bit, i m searching for a key which i can map to Caps_Lock with xmodmap and then do a :ino for easier movement
      Message 2 of 8 , Jul 31, 2007
        Am Montag, 30. Juli 2007 12:22 schrieb Markus Schulz:
        > Hello,
        > after reading the "movement in insert mode" thread i came to idea to
        > remap the needless capslock key (currently i mapped to Escape with
        > xmodmap) for easier movement in insert mode.
        >
        > Is this possible, to remap and use then something like: <CapsLock>w
        > to move to next word ...?

        to clarify a little bit, i'm searching for a key which i can map to
        Caps_Lock with xmodmap and then do a :ino <New Caps Keysym> <C-o> for
        easier movement in insert mode. Any idea for a "free keysym" which is
        mappable in vim?

        --
        Markus Schulz

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_use" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Tony Mechelynck
        ... Can t you map CapsLock directly to Ctrl-O in Xmodmap? Best regards, Tony. -- Utility is when you have one telephone, luxury is when you have two, opulence
        Message 3 of 8 , Jul 31, 2007
          Markus Schulz wrote:
          > Am Montag, 30. Juli 2007 12:22 schrieb Markus Schulz:
          >> Hello,
          >> after reading the "movement in insert mode" thread i came to idea to
          >> remap the needless capslock key (currently i mapped to Escape with
          >> xmodmap) for easier movement in insert mode.
          >>
          >> Is this possible, to remap and use then something like: <CapsLock>w
          >> to move to next word ...?
          >
          > to clarify a little bit, i'm searching for a key which i can map to
          > Caps_Lock with xmodmap and then do a :ino <New Caps Keysym> <C-o> for
          > easier movement in insert mode. Any idea for a "free keysym" which is
          > mappable in vim?
          >

          Can't you map CapsLock directly to Ctrl-O in Xmodmap?


          Best regards,
          Tony.
          --
          Utility is when you have one telephone, luxury is when you have two,
          opulence is when you have three -- and paradise is when you have none.
          -- Doug Larson

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_use" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • John Little
          ... Yes, run the xmodmap command that lists all the key codes, and pick a function key that your keyboard hasn t got, and Vim should map it. It s xmodmap -pke
          Message 4 of 8 , Jul 31, 2007
            Markus wrote:

            > Is this possible, to remap and use then something like: <CapsLock>w to move to next word ..
            > to clarify a little bit, i'm searching for a key which i can map to Caps_Lock with xmodmap and then do a :ino <New Caps Keysym> <C-o> for easier movement in insert mode. Any idea for a "free keysym" which is mappable in vim?

            Yes, run the xmodmap command that lists all the key codes, and pick a
            function key that your keyboard hasn't got, and Vim should map it.
            It's xmodmap -pke I think.

            (Another approach is to learn to touch type, with all eight fingers,
            and then make the caps lock a control key. Ctrl-o is then at your
            fingertips, as are all the ctrl- combinations east of about D.)

            Tony commented:

            > Can't you map CapsLock directly to Ctrl-O in Xmodmap?

            I don't think so, to X ctrl-o is two keys, not one.

            Regards, John

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_use" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Tony Mechelynck
            ... Map it to 0x0F then? (Vim sees Ctrl-O as 0x0F, as it sees both Esc and Ctrl-[ as 0x1B, both Tab and Ctrl-I as 0x09, both Enter and Ctrl-M as 0x0D, etc.)
            Message 5 of 8 , Jul 31, 2007
              John Little wrote:
              > Markus wrote:
              >
              >> Is this possible, to remap and use then something like: <CapsLock>w to move to next word ..
              >> to clarify a little bit, i'm searching for a key which i can map to Caps_Lock with xmodmap and then do a :ino <New Caps Keysym> <C-o> for easier movement in insert mode. Any idea for a "free keysym" which is mappable in vim?
              >
              > Yes, run the xmodmap command that lists all the key codes, and pick a
              > function key that your keyboard hasn't got, and Vim should map it.
              > It's xmodmap -pke I think.
              >
              > (Another approach is to learn to touch type, with all eight fingers,
              > and then make the caps lock a control key. Ctrl-o is then at your
              > fingertips, as are all the ctrl- combinations east of about D.)
              >
              > Tony commented:
              >
              >> Can't you map CapsLock directly to Ctrl-O in Xmodmap?
              >
              > I don't think so, to X ctrl-o is two keys, not one.
              >
              > Regards, John


              Map it to 0x0F then? (Vim sees Ctrl-O as 0x0F, as it sees both Esc and Ctrl-[
              as 0x1B, both Tab and Ctrl-I as 0x09, both Enter and Ctrl-M as 0x0D, etc.)


              Best regards,
              Tony.
              --
              Life is like a penis: when it's soft you can't beat it, and when it's
              hard you get fucked.

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_use" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            • John Little
              My post last night was a bit muddled, I didn t have xmodmap in front of me last night (er, UTC+12 that is). What you want in .xmodmaprc is clear Lock keysym
              Message 6 of 8 , Aug 1, 2007
                My post last night was a bit muddled, I didn't have xmodmap in front
                of me last night (er, UTC+12 that is). What you want in .xmodmaprc is

                clear Lock
                keysym Caps_Lock = F14

                then map F14 in vim (assuming you haven't already got an F14; XFree86
                goes up to F35). You might add

                add Lock = Scroll_Lock

                to make a useless key useful, in case you really want to shout at someone.

                HTH, John

                --~--~---------~--~----~------------~-------~--~----~
                You received this message from the "vim_use" maillist.
                For more information, visit http://www.vim.org/maillist.php
                -~----------~----~----~----~------~----~------~--~---
              • John Little
                ... I replied ... The X server only maps keys, not characters. The translation of key press events to characters is done in client code; take a look at vim s
                Message 7 of 8 , Aug 1, 2007
                  > > Tony commented:

                  > >> Can't you map CapsLock directly to Ctrl-O in Xmodmap?

                  I replied

                  > > I don't think so, to X ctrl-o is two keys, not one.

                  Then Tony said:

                  > Map it to 0x0F then? (Vim sees Ctrl-O as 0x0F, as it sees both Esc and Ctrl-[
                  > as 0x1B, both Tab and Ctrl-I as 0x09, both Enter and Ctrl-M as 0x0D, etc.)

                  The X server only maps keys, not characters. The translation of key
                  press events to characters is done in client code; take a look at
                  vim's gui_x11.c. If vim wants to treat Esc and Ctrl-[ differently it
                  can.
                  Anyway, my experience with something similar to the OP's requirement
                  (on windows using scancode mapping) was that mapping to some unused
                  but mappable key suited Vim better; the mappings that used it were
                  more obvious and more straightforwardly adjusted to different modes.

                  Regards, John

                  --~--~---------~--~----~------------~-------~--~----~
                  You received this message from the "vim_use" maillist.
                  For more information, visit http://www.vim.org/maillist.php
                  -~----------~----~----~----~------~----~------~--~---
                • Markus Schulz
                  ... thanks, i ve understood this already after your first answer and solved my problem this way. ... yes another useless key, but a bit too far away for me ;)
                  Message 8 of 8 , Aug 7, 2007
                    Am Mittwoch, 1. August 2007 schrieb John Little:
                    > My post last night was a bit muddled, I didn't have xmodmap in front
                    > of me last night (er, UTC+12 that is). What you want in .xmodmaprc
                    > is
                    >
                    > clear Lock
                    > keysym Caps_Lock = F14

                    thanks, i've understood this already after your first answer and solved
                    my problem this way.

                    > then map F14 in vim (assuming you haven't already got an F14; XFree86
                    > goes up to F35). You might add
                    >
                    > add Lock = Scroll_Lock
                    >
                    > to make a useless key useful, in case you really want to shout at
                    > someone.

                    yes another useless key, but a bit too far away for me ;)

                    --
                    Markus Schulz

                    --~--~---------~--~----~------------~-------~--~----~
                    You received this message from the "vim_use" maillist.
                    For more information, visit http://www.vim.org/maillist.php
                    -~----------~----~----~----~------~----~------~--~---
                  Your message has been successfully submitted and would be delivered to recipients shortly.