Vegard Øye <vegard_oye <at> hotmail.com> writes:
On 2011-04-22 20:36 +0200, Isaac wrote:
Hello, I am still trying to remap c-z (to make it undo, but use C-\ for toggling), any suggestions to do it efficiently?
For "ESC" and "C-z", Viper defines a set of "intercept maps" which have precedence over all other maps. This should do what you want:
(define-key viper-vi-intercept-map "\C-\\" 'viper-toggle-key-action) (define-key viper-vi-intercept-map "\C-z" 'undo-tree-undo) (define-key viper-emacs-intercept-map "\C-\\" 'viper-change-state-to-vi) (define-key viper-emacs-intercept-map "\C-z" 'undo-tree-undo)
Hi Vegard, this resolved the issue that I have, thanks! I just added two additional lines (vimpulse-imap "\C-z" 'undo-tree-undo) (vimpulse-imap "\C-\\" 'viper-change-state-to-vi) so that in the vimpulse insert mode they are also mapped correctedly. Best regards, Isaac