I'm new to Emacs. I have Emacs 24.3.1 with evil mode installed. I'm trying to bind gw
as a prefix to the various evil-window
functions. For example, I would like gwl
to focus the window to the right, and gwh
the window to the left. Of course, this is done in vim like so: nnoremap gw <c-w>
.
In .emacs.d/config/init-bindings.el
, I added:
(define-key evil-normal-state-map (kbd "g w h") 'evil-window-left)
(define-key evil-normal-state-map (kbd "g w j") 'evil-window-down)
(define-key evil-normal-state-map (kbd "g w k") 'evil-window-up)
(define-key evil-normal-state-map (kbd "g w l") 'evil-window-right)
(define-key evil-normal-state-map (kbd "g w v") 'evil-window-vnew)
And emacs reports this error:
error: Key sequence g w h starts with non-prefix key g w
- How do I make
gw
a prefix key? - Is there any reason this might be a bad idea (conflicts with important emacs defaults)?