Setjmp
Setjmp

Reputation: 28372

GNU emacs 24.x: Turn off evil-mode when using buffer selection menu of BufferSelection package

I am using the bs-show function via the mapping:

(global-set-key (kbd "C-x C-b") 'bs-show)

However, since I also use evil-mode I find that the single key commands do not work until I switch from normal ("N") mode to emacs ("E") mode within evil each time I run the bs-show function. How can I disable evil mode within the BufferSelection menu on a permanent basis?

Upvotes: 1

Views: 1167

Answers (2)

Adam Gent
Adam Gent

Reputation: 49085

For what it's worth if you do want bs-mode (which I still prefer over all the new stuff) to be vim/evil like I found this person's configuration to work well:

; BS-menu
(defadvice bs-mode (before bs-mode-override-keybindings activate)
  ;; use the standard bs bindings as a base
  (evil-make-overriding-map bs-mode-map 'normal t)
  (evil-define-key 'normal bs-mode-map "h" 'evil-backward-char)
  (evil-define-key 'normal bs-mode-map "q" 'bs-abort)
  (evil-define-key 'normal bs-mode-map "j" 'bs-down)
  (evil-define-key 'normal bs-mode-map "k" 'bs-up)
  (evil-define-key 'normal bs-mode-map "l" 'evil-forward-char)
  (evil-define-key 'normal bs-mode-map "RET" 'bs-select))

Upvotes: 1

Henrik
Henrik

Reputation: 982

Rather than disable evil-mode altogether, perhaps you could have evil start in Emacs mode for bs-mode, like so:

(evil-set-initial-state 'bs-mode 'emacs)

Upvotes: 2

Related Questions