Announcement

Collapse
No announcement yet.

Hand Postion on Keyboard for VI and Emacs

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Hand Postion on Keyboard for VI and Emacs

    I've recently converted my laptop to Kubuntu and love my Linux experience. Now this question may be very naive but I honestly feel I must be doing something wrong. Emacs and VI seem to have such a following, I've been using both. What I've found though is that I feel so awkward hitting the crtl key!

    I'm not sure if I'm reaching for it weird but the fact that I have to move left wrist back and then hit another key makes it feel wrong. I would be fine with it but use of VI and Emacs requires you to hit ctrl all the time. Does this become more natural over time? (I've been editing with VI and Emacs for a couple weeks now). How do you place your hands? I'd love some feed back. Thanks!


    #2
    Re: Hand Postion on Keyboard for VI and Emacs

    One option (which I use myself) is to use the CapsLock key as an additional Ctrl key (or alternatively switch CapsLock and Ctrl Keys).

    After all, the CapsLock is a pretty useless key at such a nice position

    You can do this globally (xkb) with SystemSettings>Regional&Language>KeyboardLayout>Xk bOptions>'Make CapsLock an additional Ctrl'

    Comment


      #3
      Re: Hand Postion on Keyboard for VI and Emacs

      Aha, I'm going to try that out! Thankyou!

      Comment


        #4
        Re: Hand Postion on Keyboard for VI and Emacs

        I was successfully able to swap my ctrl key for my capslock key using the regional settings. But in the process of turning on the enabling the xkb the volume buttons on my laptop seized to work. So after doing some research I found that perhaps I could just remap the keyboard via
        xmodmap.

        I created .xmodmap in my home directory and created the following file:

        ! swap left control and caps lock

        remove Lock = Caps_Lock
        remove Control = Control_L

        keysym Control_L = Caps_Lock
        keysym Caps_Lock = Control_L

        add Lock = Caps_Lock
        add Control = Control_L

        and then tried to get my changes to go:
        xmodmap ~/.xmodmap

        But got errors:
        xmodmap: /home/wavewash/.xmodmap:3: bad keysym in remove modifier list 'Caps_Lock', no corresponding keycodes
        xmodmap: /home/wavewash/.xmodmap:7: bad keysym target keysym 'Caps_Lock', no corresponding keycodes
        xmodmap: 2 errors encountered, aborting.

        not sure if I'm typing these incorrectly as they seem to correspond:
        shift Shift_L (0x32), Shift_R (0x3e)
        lock Control_L (0x42)
        control Control_L (0x25), Control_R (0x6d)
        mod1 Alt_L (0x40), Alt_L (0x7d), Meta_L (0x9c)
        mod2 Num_Lock (0x4d)
        mod3
        mod4 Super_L (0x7f), Hyper_L (0x80)
        mod5 Mode_switch (0x5d), ISO_Level3_Shift (0x71), ISO_Level3_Shift (0x7c)


        any help would be appreciated.

        Comment


          #5
          Re: Hand Postion on Keyboard for VI and Emacs

          I got it to work.

          Changed my .xmodmap file to read:

          keycode 66 = Control_L
          clear Lock
          add Control = Control_L

          and then from command line:
          xmodmap .xmodmap

          and that did the trick

          Now I'm trying to get that to run when I log in.

          I tried to put "xmodmap .xmodmap" in /etc/X11/xinit/xinitrc

          changing that to

          . /etc/X11/Xsession
          xmodmap ./home/wavewash/.xmodmap

          but that didn't work. So then I tried putting it in /home/wavewash/.bashrc at the bottom which also didn't work. I'm sort of lost as to how to get this command to run on startup.

          Thanks!

          Comment


            #6
            Re: Hand Postion on Keyboard for VI and Emacs

            If you rename it to .Xmodmap (case-sensitive, ~/.Xmodmap), it should run at X startup via '/etc/X11/Xsession.d/80ubuntu-xmodmap'

            Comment

            Working...
            X