possible bug (or my mistake ;-)
Hello, I have discovered yesterday evil. I will know be able to benefit both auctex power and vim ergonomy. Since I never tried Viper nor Vimproved, I prefer starting with evil but got some trouble with remapping keys in order to feet to my own version of bépo (french dvorak). Here is a piece of my .emacs: (require 'evil) (evil-mode 1) ;adaptation des touches à mon bépo (define-key evil-normal-state-map "h" 'evil-change) (define-key evil-normal-state-map "H" 'evil-change-line) (define-key evil-normal-state-map "T" 'evil-join) (define-key evil-normal-state-map "l" 'evil-replace) (define-key evil-normal-state-map "L" 'evil-replace-state) (define-key evil-normal-state-map "k" 'evil-substitute) (define-key evil-normal-state-map "K" 'evil-change-whole-line) (define-key evil-motion-state-map "b" 'evil-beginning-of-line) (define-key evil-motion-state-map "é" 'evil-end-of-line) (define-key evil-motion-state-map "è" 'evil-backward-word-begin) (define-key evil-motion-state-map "È" 'evil-backward-WORD-begin) (define-key evil-motion-state-map "c" 'evil-backward-char) (define-key evil-motion-state-map "C" 'evil-window-top) (define-key evil-motion-state-map "t" 'evil-next-line) (define-key evil-motion-state-map "s" 'evil-previous-line) (define-key evil-motion-state-map "r" 'evil-forward-char) (define-key evil-motion-state-map "R" 'evil-window-bottom) (define-key evil-motion-state-map "j" 'evil-find-char-to) (define-key evil-motion-state-map "J" 'evil-find-char-to-backward) ;;; untree: dépendance d’evil----------------------------------------- (require 'undo-tree) ;;if you want replace the standard Emacs' undo system with the undo-tree-mode, uncomment the next line (global-undo-tree-mode) the trouble is that some remapping work, others don't: for instance c, s and r are still acting as change, substitute and replace instead of left, up and right (t does down). h, k i l are remaped as as change, substitute and replace. This is kind astonishing. Did I do something wrong or is it an issue with evil-forward-char and so on? Thanks for your great job, Damien Thiriet PS: I couldn’t check if this mail is plain text or html, please tell me if there are some troubles with coding Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ? Je crée ma boîte mail www.laposte.net
Hi! I also use "bépo" and I confirm this bug. In order to get it work I had to remap each "normal key" to "nil" before mapping it to a "motion key". Ex: (define-key evil-normal-state-map "c" nil) (define-key evil-motion-state-map "c" 'backward-char) Félix On 14/10/2011 10:49, damien.thiriet77 wrote:
Hello,
I have discovered yesterday evil. I will know be able to benefit both auctex power and vim ergonomy. Since I never tried Viper nor Vimproved, I prefer starting with evil but got some trouble with remapping keys in order to feet to my own version of bépo (french dvorak). Here is a piece of my .emacs:
(require 'evil) (evil-mode 1) ;adaptation des touches à mon bépo
(define-key evil-normal-state-map "h" 'evil-change) (define-key evil-normal-state-map "H" 'evil-change-line) (define-key evil-normal-state-map "T" 'evil-join) (define-key evil-normal-state-map "l" 'evil-replace) (define-key evil-normal-state-map "L" 'evil-replace-state) (define-key evil-normal-state-map "k" 'evil-substitute) (define-key evil-normal-state-map "K" 'evil-change-whole-line) (define-key evil-motion-state-map "b" 'evil-beginning-of-line) (define-key evil-motion-state-map "é" 'evil-end-of-line) (define-key evil-motion-state-map "è" 'evil-backward-word-begin) (define-key evil-motion-state-map "È" 'evil-backward-WORD-begin) (define-key evil-motion-state-map "c" 'evil-backward-char) (define-key evil-motion-state-map "C" 'evil-window-top) (define-key evil-motion-state-map "t" 'evil-next-line) (define-key evil-motion-state-map "s" 'evil-previous-line) (define-key evil-motion-state-map "r" 'evil-forward-char) (define-key evil-motion-state-map "R" 'evil-window-bottom) (define-key evil-motion-state-map "j" 'evil-find-char-to) (define-key evil-motion-state-map "J" 'evil-find-char-to-backward)
;;; untree: dépendance d’evil----------------------------------------- (require 'undo-tree) ;;if you want replace the standard Emacs' undo system with the undo-tree-mode, uncomment the next line (global-undo-tree-mode)
the trouble is that some remapping work, others don't: for instance c, s and r are still acting as change, substitute and replace instead of left, up and right (t does down). h, k i l are remaped as as change, substitute and replace. This is kind astonishing. Did I do something wrong or is it an issue with evil-forward-char and so on?
Thanks for your great job,
Damien Thiriet
PS: I couldn’t check if this mail is plain text or html, please tell me if there are some troubles with coding
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ? Je crée ma boîte mail www.laposte.net
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
-- Félix
On Fri, Oct 14, 2011 at 12:04:43PM +0200, Félix Sipma wrote:
Hi!
I also use "bépo" and I confirm this bug. In order to get it work I had to remap each "normal key" to "nil" before mapping it to a "motion key".
Ex:
(define-key evil-normal-state-map "c" nil) (define-key evil-motion-state-map "c" 'backward-char)
This is exactly what you have to do (right now). The problem is that the key-bindings are in different keymaps. And it is important that some keys may be bound in different keymaps, e.g., "i" is bound to 'evil-insert in evil-normal-state-map and to 'evil-inner-text-objects-map in evil-operator-state-map. Perhaps another function which binds some keysequence in one map and removes all active bindings in other maps may be convenient, something like (evil-remap evil-motion-state-map "c" 'backward-char :remove evil-normal-state-map) or the other way around (evil-remap evil-motion-state-map "i" 'what-ever :keep evil-operator-state-map) I have no idea what the best solution is. Frank
Thank you very much for your quick answer, I made it with the (define-key evil-normal-state-map "c" nil) (define-key evil-motion-state-map "c" 'backward-char) It might be useful to put two lines about this remapping issue in the project pdf. I would also suggest a few lines of explanation about each state (insert or visual are quite obvious for me, so does emacs, but I am quite confused about the motion state and couldn’t explain why h,j,k,l are mapped there and not in insert mode). Evil will however greatly improve my work… Damien Thiriet
On Fri, Oct 14, 2011 at 12:04:43PM +0200, Félix Sipma wrote:
Hi!
I also use "bépo" and I confirm this bug. In order to get it work I had to remap each "normal key" to "nil" before mapping it to a "motion key".
Ex:
(define-key evil-normal-state-map "c" nil) (define-key evil-motion-state-map "c" 'backward-char)
This is exactly what you have to do (right now). The problem is that the key-bindings are in different keymaps. And it is important that some keys may be bound in different keymaps, e.g., "i" is bound to 'evil-insert in evil-normal-state-map and to 'evil-inner-text-objects-map in evil-operator-state-map.
Perhaps another function which binds some keysequence in one map and removes all active bindings in other maps may be convenient, something like
(evil-remap evil-motion-state-map "c" 'backward-char :remove evil-normal-state-map)
or the other way around
(evil-remap evil-motion-state-map "i" 'what-ever :keep evil-operator-state-map)
I have no idea what the best solution is.
Frank
Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ? Je crée ma boîte mail www.laposte.net
participants (3)
-
damien.thiriet77 -
Frank Fischer -
Félix Sipma