Coder Social home page Coder Social logo

xterm-keybinder's Introduction

xterm-keybinder

This package lets you key binds that normally terminal Emacs can not use. (i.e., C-M-g)

Summary of available key binds

Modifiers Description
S Space key with shift
C [2-8] (note: xterm.el supports other key binds)
C-S [A-Z]
C-M "g" and space keys
M-S [A-Z]
C-M-S [A-Z]
s or s-S from space to "~" (almost 8 bits characters without control sequences)
H or H-S same as s-S, but use Hyper modifier

Usage for XTerm

You may need following configuration in your .Xresources file:

XTerm*VT100.eightBitInput: false
XTerm*vt100.formatOtherKeys: 1

Put below configuration to your .emacs

(add-hook
 'tty-setup-hook
 '(lambda ()
    (cl-case (assoc-default 'terminal-initted (terminal-parameters))
      (terminal-init-xterm
       (xterm-keybinder-setup)))))

Then start your emacs with xterm and the option

#!/bin/sh
xtermopt=path/to/this-repository/xterm-option
eval "xterm -xrm `${xtermopt}` -e emacsclient -t -a ''"

On your started Emacs, you can use C-M prefix and C-S prefix keybinds.

FYI, I'm configuring like this

Usage for URxvt

Put below configuration to your .emacs

(require 'cl-lib)
(add-hook
 'tty-setup-hook
 '(lambda ()
    (cl-case (assoc-default 'terminal-initted (terminal-parameters))
      (terminal-init-rxvt
       (when (getenv "COLORTERM" (selected-frame))
         (urxvt-keybinder-setup))))))

Start URxvt daemon:

urxvtd -q -o -f

Then start your emacs using emacs-urxvt-client file.

emacs_urxvt_client=/path/to/emacs-urxvt-client \
${emacs-urxvt-client} -e emacscliet -t &

(The main content of emacs-urxvt-client file is just a configuration to use emacs keybindings.)

Note

If you put xterm-option of this package in your xterm resource, you may have trouble because some applications already used overridden key sequences.

Contribution

I'm really beginner of xterm, so let me know if you have better idea. Pull Requests are always welcome :)

xterm-keybinder's People

Contributors

yuutayamada avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.