Closed ethanyu336 closed 6 years ago
ace-window
can be canceled with C-g.
@abo-abo thank your reply, I know C-g can do this, my expectation Is to able to specify another key to do the same, I have another key to keyboar-quit more frequently. :D。
You'll have to customize aw-dispatch-function
to handle your custom key binding.
Also avy-key-to-char-alist
.
@abo-abo Thanks for your patient explanation, now I can customized a char "x" for keyboard-quit, but what i actually want to use is a C-SPC, Below is some code i've tried. Is using C-SPC possible?Thanks again!
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l))
(eval-after-load "ace-window" '(progn
(add-hook 'ace-window-display-mode-hook
'(progn
(defvar avy-key-to-char-alist
'(
;; ((kbd "C-SPC") "x")
;; ((kbd "C-SPC") ?x)
((kbd "C-SPC") x)
))
))
))
(defvar aw-dispatch-alist
'(
(?x keyboard-quit)
))
This should work:
(add-to-list 'avy-key-to-char-alist '(67108896 . ?x))
(setq aw-dispatch-function
(lambda (char)
(if (= char (aref (kbd "C-SPC") 0))
(throw 'done 'exit)
(aw-dispatch-default char))))
@abo-abo works! you're so cool! big thanks again for your patience. :D
You're welcome.
Thank you for such a good plugin, I hope there is a customized key-binding option for cancel windows jumping in ace-window,function like C-g , that would be perfect, maybe can be called "cancel-key"?
Generally, we have a local keymap ,but there is no way define that for ace-window, emmm..not that much practical..but ace-window must be more perfect with this :D