Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unshifted symbols in Emacs

Tags:

emacs

perl

I'd like a minor mode which allows the shifted symbols on the number keys to be accessible in an unshifted fashion (and the digits to then be shifted). It seems this might be helpful with Perl code ($, @, %, etc...). Ideally, there'd be a key for toggling this mode. Sort of like capslock but only for the number keys.

Does such a mode already exist?

like image 656
dharmatech Avatar asked Jun 08 '11 11:06

dharmatech


1 Answers

One way to roll your own would be something like this:

(define-minor-mode snoopy-mode
  "Toggle snoopy mode.
   With no argument, this command toggles the mode.
   Non-null prefix argument turns on the mode.
   Null prefix argument turns off the mode."
  ;;   The initial value.
  nil
  ;; The indicator for the mode line.
  " Snoopy"
  ;; The minor mode bindings.
  '(("1" . (lambda () (interactive) (insert-char ?! 1)))
    ("!" . (lambda () (interactive) (insert-char ?1 1)))
    ;;etc
))

See minor modes and keymaps.

like image 134
jaybee Avatar answered Sep 29 '22 01:09

jaybee