Keystroke termcap terminfo nextword prevword

Help
2003-01-24
2003-01-24
  • Nobody/Anonymous

    Hi there, just for all who dont know how to bind
    ctrl-left to "previous word" and
    ctrl-right to "next word",

    here is what I did, and how it works for me:
    (I'm using debian/slink/potato/woody)

    1st of all let's use this in bash, too.
    -------------------------------------------
    echo '"\e[5D": backward-word' >> ~/.inputrc
    echo '"\e[5C": forward-word' >> ~/.inputrc
    now, just start a new shell/xterm/loginshell
    and type some words and press ctrl-left
    or ctrl-right.

    2nd part: Now let's do the same for joe!
    -------------------------------------------
    2.1 We edit /etc/joe/termcap:
        - search for a line starting with:
          "jc|xterm|X windows terminal emulator:\"
        - replace the word xterm by asklaskl
        - now add one line to the asklaskl-entry:
          "kr=\E[5C:kl=\E[5D:\"
          but *without* the '"' of course.

        - It should look like this now:

    jc|asklaskl|X windows terminal emulator:\         :xn:\         :kb=\b:ks=\E=:ke=\E>:\         :k1=\E[11~:k2=\E[12~:k3=\E[13~:\         :k4=\E[14~:k5=\E[15~:\         :k6=\E[17~:k7=\E[18~:k8=\E[19~:\         :k9=\E[20~:k0=\E[21~:\         :kh=\E[8~:\         :kr=\E[5C:kl=\E[5D:\         :tc=decansi:

    2.2 We use termidx to build a new
        /etc/joe/termcap.idx:
        termidx</etc/joe/termcap>/etc/joe/termcap.idx
        If we dont have termidx, we
        fetch the joe-source and type:
        ./configure
        make
       ./termidx</etc/joe/termcap>/etc/joe/termcap.idx
        Now we dont need the joe source anymore.
        You can delete it - or not.

    2.3 We edit the system-wide joerc,
        and add some lines:
        - look for a line starting with
          "nextword        ^X     Goto next word"
        - add two new lines:
          "nextword        .kr"
          "prevword        .kl"
        - remember to do it *without* the '"'

    2.4 We need to tell joe not to use
        the broken debian terminfo:
        export JOETERM=asklaskl

    2.5 finished.

    If we want to be very very friendly to our system
    we copy /etc/joe/termcap
    to $HOME/.termcap before we start editing it
    (for example, you are have no root on this box).
    We build the termcap.idx with:
    termidx < $HOME/.termcap > $HOME/.termcap.idx
    And copy /etc/joe/joerc to our home:
    cp /etc/joe/joerc $HOME/.joerc

    HTH

    Thomas Reifferscheid <reiffer@kph.uni-mainz.de>

    joe++

     
    • Nobody/Anonymous

      Another hint:

      if you want to do this fency things just
      by your own and you do NOT know where
      \E[5C does come from, try the following:

      type Ctrl-X in your xterm, then
      press Ctrl-right and magically
      [5C appears on your screen :p

      There is another method pressing Ctrl-V instead of
      Ctrl-X.

      Thomas

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks