15

I'm using an alternate keyboard layout (Colemak) and I want to move the universal-argument command to a different key in Emacs, C-l instead of C-u. I tried the following, but it doesn't let me chain multiple universal arguments together multiplicatively (C-l C-l C-l) and it breaks C-l C-u too (which should move up 4 lines):

(global-set-key "\C-l" 'universal-argument)
(global-set-key "\C-u" 'previous-line)
ninjudd
  • 553
  • 4
  • 11

1 Answers1

20

When you use the prefix argument, Emacs uses a keymap temporarily to handle the universal argument functionality. So, you need to make the changes you've made there too:

(define-key universal-argument-map "\C-l" 'universal-argument-more)
(define-key universal-argument-map "\C-u" nil)

The first sets up C-l to be the continuation of universal-argument, and the second un-defines the C-u from that map b/c you no longer want it to be the universal argument.

Trey Jackson
  • 73,529
  • 11
  • 197
  • 229