<div>Sorry, (kbd "DEL") doesn't work, should be (kbd "<backspace>"). I thought they were the same.</div><div><br></div><div><br></div><div>On Thu, Aug 11, 2011 at 3:19 PM, York Zhao <<a href="mailto:gtdplatform@gmail.com">gtdplatform@gmail.com</a>> wrote:</div>
<div>I finally got the <backspace> binded in ibuffer by "forcing" rebind like this:</div><div><br></div><div>(eval-after-load 'ibuffer</div><div> '(progn</div><div> ;; use the standard ibuffer bindings as a base</div>
<div> (set-keymap-parent</div><div> (evil-get-auxiliary-keymap ibuffer-mode-map 'normal t)</div><div> (assq-delete-all 'menu-bar (copy-keymap ibuffer-mode-map)))</div><div> (evil-define-key 'normal ibuffer-mode-map "j" 'ibuffer-forward-line)</div>
<div> (evil-define-key 'normal ibuffer-mode-map "k" 'ibuffer-backward-line)</div><div> (evil-define-key 'normal ibuffer-mode-map "J" 'ibuffer-jump-to-buffer) ; "j"</div>
<div> (evil-define-key 'normal ibuffer-mode-map (kbd "DEL") 'ibuffer-unmark-backward)))</div><div><br></div><div>But the question is: why wasn't this binding "overwritten" from the "copy-keymap"?</div>
<div><br></div><div>Thanks,</div><div><br></div><div>York</div><div><br></div><div><br></div><div>On Thu, Aug 11, 2011 at 3:04 PM, York Zhao <<a href="mailto:gtdplatform@gmail.com">gtdplatform@gmail.com</a>> wrote:</div>
<div>Hi,</div><div><br></div><div>I have this code to inherite most of the ibuffer key bindings while still keep the "j" and "k" bindings.</div><div><br></div><div>(eval-after-load 'ibuffer</div><div>
'(progn</div><div> ;; use the standard ibuffer bindings as a base</div><div> (set-keymap-parent</div><div> (evil-get-auxiliary-keymap ibuffer-mode-map 'normal t)</div><div> (assq-delete-all 'menu-bar (copy-keymap ibuffer-mode-map)))</div>
<div> (evil-define-key 'normal ibuffer-mode-map "j" 'ibuffer-forward-line)</div><div> (evil-define-key 'normal ibuffer-mode-map "k" 'ibuffer-backward-line)</div><div> (evil-define-key 'normal ibuffer-mode-map "J" 'ibuffer-jump-to-buffer) ; "j"</div>
<div> ))</div><div><br></div><div>This works fine however if I rebind the <backspace> before the previous code like this:</div><div><br></div><div>(define-key evil-normal-state-map (kbd "<backspace>") 'scroll-down)</div>
<div><br></div><div>The <backspace> key would then "fixed" to my binding (scroll-down) instead of the ibuffer binding. Is there any "better" way of rebinding evil keys? Or, is it possible for Evil to handle this situation?</div>
<div><br></div><div>Thanks,</div><div><br></div><div>York</div><div><br></div>