help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Find bindings for all modes


From: Tim Johnson
Subject: Re: Find bindings for all modes
Date: Tue, 28 Oct 2014 16:31:05 -0800
User-agent: Mutt/1.4.2.3i

* John Mastro <john.b.mastro@gmail.com> [141028 14:30]:
> Tim Johnson <tim@akwebsoft.com> wrote:
> >    I'd like to use C-j as a prefix key.
> >    Note: I have limited mobility in my hands and always have the
> >    control key to the left of my "A" key.
> 
> I wanted to do something similar in order to have a general-purpose
> prefix key on the right hand side of the keyboard. (I strongly prefer to
> use opposite hands for the modifier(s) and they keys themselves. So
> `C-c` or `C-x r` are fine, but I'm not a big fan of e.g. `C-x o`. This
> is primarily a "preference" thing, although I do think that using
> opposite hands is more ergonomic than not).
> 
> What I settled on for now is to steal C-h. I actually use the help
> commands quite a bit, but I find <f1> to be "good enough" for accessing
> them.

  I have done the same to use C-h for backward-delete

> If you don't mind, let us (the list) know what you settle on - I'm
> always interested to hear about Emacs users' key binding innovations.

  I've done considerable keybinding in the past, using emacs in gui
  mode on linux. So I've done considerable rewriting for OS X and
  terminal environment what follows is untested but should give an
  idea :

;; Could be a "template" for other rebindings
(defun tj-control-j ()
  "Function to call when control-j is rebound"
  (interactive)
  (cond
    ((string-equal mode-name "Lisp Interaction")
     (eval-print-last-sexp))
    (t
      (electric-newline-and-maybe-indent))))
;; set up the keymap
; Movement related bindings
(global-unset-key "\C-j")
(defvar tj-go-map (make-sparse-keymap) "Control-j")
(define-prefix-command 'tj-go-map)
(global-set-key "\C-j" 'tj-go-map)
;; rebind the original C-j
(define-key tj-go-map (kbd "j") 'tj-control-j)

No doubt there is going to be some glitches, but the next
few days will finish the story ...
cheers
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]