简体   繁体   中英

Evil in emacs: cannot remap “s”: buffer is read-only

I'm trying to remap some evil keys to navigate using htns. htn works fine, but s always gives me the "buffer is read-only" error. I'm assuming I need to remap save buffer, but I'm getting lost in the key rebinding api. My .emacs looks like

(define-key evil-motion-state-map (kbd "n") 'evil-next-line)
(define-key evil-motion-state-map (kbd "s") 'evil-previous-line)
(define-key evil-motion-state-map (kbd "h") 'evil-forward-char)
(define-key evil-motion-state-map (kbd "t") 'evil-backward-char)

It's ok if I use the normal state map instead:

(define-key evil-normal-state-map (kbd "s") 'evil-previous-line)

Does that suit your needs ?

I guess you had this error because the binding was not working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM