1

I just started using evil-mode after having used elscreen for a long time. evil-mode will bind the C-z key to evil-emacs-state but do you know how I can rebind either this function, or the elscreen emacs key?

  • Evil does not use elscreen in any way, so your whole question starts with a false premise. – wasamasa May 27 '15 at 23:48
  • @wasamasa, sorry I had the wrong information. From what I gather, there are extra packages to evil-mode which implement vim tabs using elscreen, but not part of evil-mode itself. I removed that sentence. – hatmatrix May 28 '15 at 0:10
3

I believe you have three options:

1- Change elscreen key prefix:

(setq elscreen-prefix-key "\C-.")

2- Manually override evil C-z binding:

(define-key evil-normal-state-map "\C-z\C-c" 'elscreen-create)
(define-key evil-normal-state-map "\C-zc"    'elscreen-create)
(define-key evil-normal-state-map "\C-zC"    'elscreen-clone)
(define-key evil-normal-state-map "\C-z\C-k" 'elscreen-kill)
(define-key evil-normal-state-map "\C-zk"    'elscreen-kill)
(define-key evil-normal-state-map "\C-z\M-k" 'elscreen-kill-screen-and-buffers)
(define-key evil-normal-state-map "\C-zK"    'elscreen-kill-others)
(define-key evil-normal-state-map "\C-z\C-p" 'elscreen-previous)
(define-key evil-normal-state-map "\C-zp"    'elscreen-previous)
(define-key evil-normal-state-map "\C-z\C-n" 'elscreen-next)
(define-key evil-normal-state-map "\C-zn"    'elscreen-next)
(define-key evil-normal-state-map "\C-z\C-a" 'elscreen-toggle)
(define-key evil-normal-state-map "\C-za"    'elscreen-toggle)
(define-key evil-normal-state-map "\C-z'"    'elscreen-goto)
(define-key evil-normal-state-map "\C-z\""   'elscreen-select-and-goto)
(define-key evil-normal-state-map "\C-z0"    'elscreen-jump-0)
(define-key evil-normal-state-map "\C-z1"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z2"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z3"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z4"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z5"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z6"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z7"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z8"    'elscreen-jump)
(define-key evil-normal-state-map "\C-z9"    'elscreen-jump-9)
(define-key evil-normal-state-map "\C-z\C-s" 'elscreen-swap)
(define-key evil-normal-state-map "\C-z\C-w" 'elscreen-display-screen-name-list)
(define-key evil-normal-state-map "\C-zw"    'elscreen-display-screen-name-list)
(define-key evil-normal-state-map "\C-z\C-m" 'elscreen-display-last-message)
(define-key evil-normal-state-map "\C-zm"    'elscreen-display-last-message)
(define-key evil-normal-state-map "\C-z\C-t" 'elscreen-display-time)
(define-key evil-normal-state-map "\C-zt"    'elscreen-display-time)
(define-key evil-normal-state-map "\C-zA"    'elscreen-screen-nickname)
(define-key evil-normal-state-map "\C-zb"    'elscreen-find-and-goto-by-buffer)
(define-key evil-normal-state-map "\C-z\C-f" 'elscreen-find-file)
(define-key evil-normal-state-map "\C-z\C-r" 'elscreen-find-file-read-only)
(define-key evil-normal-state-map "\C-zd"    'elscreen-dired)
(define-key evil-normal-state-map "\C-z\M-x" 'elscreen-execute-extended-command)
(define-key evil-normal-state-map "\C-zi"    'elscreen-toggle-display-screen-number)
(define-key evil-normal-state-map "\C-zT"    'elscreen-toggle-display-tab)
(define-key evil-normal-state-map "\C-z?"    'elscreen-help)
(define-key evil-normal-state-map "\C-zv"    'elscreen-display-version)
(define-key evil-normal-state-map "\C-zj"    'elscreen-link)
(define-key evil-normal-state-map "\C-zs"    'elscreen-split)

3 Make your custom bindings to evil, like:

(define-key evil-normal-state-map "gt" 'elscreen-next)
(define-key evil-normal-state-map "gT" 'elscreen-previous)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.