Closed Chandlercjy closed 5 years ago
Below code is working for me. I hope this would be helpful.
(require 'term)
(defun term-send-esc ()
"Send ESC in term mode."
(interactive)
(term-send-raw-string "\e"))
;; to quit fzf with ESC key
(define-key term-raw-map (kbd "<escape>") 'term-send-esc)
Thank you! But it doesn't work for me. Maybe it's because I use evil-mode.
Do you use evil-mode too?
I use evil-mode too. I didnt mention it, but it only woks on GUI emacs. Please check this link when it comes to the terminal, if you use emacs on terminal.
Thank you! Though it doesn't work, I may try to get used to C-g :<
I think I also had to mention this.
Your case maybe has to do with evil-state.
I also had to set initial state of term mode to emacs-state so that I can cancel fzf with ESC key.
Please try to add below code as well.
(evil-set-initial-state 'term-mode 'emacs)
Finally, it works!!! Thank you sooooooo much!
Good to hear that! I'm glad it's been helpful.
Hi,
Though the question has been asked: https://github.com/bling/fzf.el/issues/10
I still don't know how to map?
Besides, I use evil-mode, I found that if I press ESC in FZF window, it will turn to evil-normal-mode.
Could you give me more detail? Thank you!