Change :ls to bring up ibuffer in Emacs evil-mode

557 Views Asked by At

Out of the box, :ls in evil-mode invokes M-x list-buffers. What do I need to put into my .emacs to rebind this to run M-x ibufferinstead?

2

There are 2 best solutions below

0
On

Changing this has nothing to do with evil-mode: (defalias 'list-buffers 'ibuffer)

0
On

Specifying (defalias 'list-buffers 'ibuffer) didn't work for me.

In looking at source file 'evil-maps.el' I found another method.

Add to your .emacs file:

  ;; bind ':ls' command to 'ibuffer instead of 'list-buffers
    (evil-ex-define-cmd "ls" 'ibuffer)

This method should be able to map any evil ex command.