doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unmap! the key sequences is no effect.

ijah4 opened this issue · comments

I want to unmap some keybindings for setting new ones. so I do it according to general's method

(unmap! 'nvm   "SPC :" "SPC ~" "SPC ." "SPC X")
(unmap! 'm   "," "z .")

The key , z . is unbinded, but the SPC * keys still work by default.

Although the following code is working, i want to know the reason that the above way is not working。

(map! :leader
      "X"    nil
      ":"    nil
      "~"    nil
      (:prefix ("/" . "search")     "b"  nil ))

Could you give me some advice.

unmap! is an alias to general-unbind, which doesn't understand 'nvm. You'd have to do:

(unmap! '(normal visual motion) "SPC :" "SPC ~" "SPC ." "SPC X")
(unmap! 'motion "," "z .")

The code (unmap! '(normal visual motion) "SPC :" "SPC ~" "SPC ." "SPC X") throw an error:

general--define-key-dispatch: Key sequence SPC : starts with non-prefix key SPC

In general's FAQ, the author has given the answer:

(general-define-key
 :keymaps 'normal
 :prefix "s"
 ;; prefix keys are prepended to other keys, so "" refers to the prefix itself
 "" nil
 "a" #'def
 ;; ...
 )

It means that i can't use general-unbind to unbind the prefix keys that have been used. the above mathod is the only way to solve the problem. Is it right?