Skip to content

Instantly share code, notes, and snippets.

@gcentauri
Created January 7, 2018 16:37
Show Gist options
  • Save gcentauri/7d0191311963802bd7847406b8aeb05d to your computer and use it in GitHub Desktop.
Save gcentauri/7d0191311963802bd7847406b8aeb05d to your computer and use it in GitHub Desktop.
redefining xah command mode keys
(defun my-command-mode ()
(define-key xah-fly-key-map (kbd "p") nil)
;; (define-key xah-fly-key-map ...)
;; ...
)
(add-hook 'xah-fly-command-mode-activate-hook 'my-command-mode)
@gcentauri
Copy link
Author

this way you can just use normal define key and qwerty references

Copy link

ghost commented Jan 7, 2018

Ahh Excellent. Maybe I'll give it a try now.

Copy link

ghost commented Jan 7, 2018

What is the form of that argument that I am setting to nil?

from the documentation on define-key:

DEF is anything that can be a key’s definition:
 nil (means key is undefined in this keymap),
 a command (a Lisp function suitable for interactive calling),
 a string (treated as a keyboard macro),
 a keymap (to define a prefix key),
 a symbol (when the key is looked up, the symbol will stand for its
    function definition, which should at that time be one of the above,
    or another symbol whose function definition is used, etc.),
 a cons (STRING . DEFN), meaning that DEFN is the definition
    (DEFN should be a valid definition in its own right),
 or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP,
 or an extended menu item definition.
 (See info node ‘(elisp)Extended Menu Items’.)

It seems like what I want is to define a command that doesn't do anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment