1

I've added these keybinding configuration in my Spacemacs dot file, so that I can toggle the terminal by press the \ key.

;; Keybindings
(define-key evil-normal-state-map (kbd "\\") 'spacemacs/default-pop-shell)
(define-key evil-motion-state-map (kbd "\\") 'spacemacs/default-pop-shell)

By default, the terminal starts in evil-insert-state. However, I have to go to evil-normal-state to close the terminal window with \, which means, when I open the terminal again, it would be in evil-normal-state.

This inconsistence makes me feel bad. How can I make the popup terminal start in evil-normal-state?

3

Perhaps (evil-set-initial-state 'term-mode 'normal) will do what you want.

  • Unfortunately it doesn't... – nalzok Feb 13 '17 at 2:31
  • Does (evil-set-initial-state 'spacemacs/default-pop-shell 'normal)? – mclear Feb 13 '17 at 2:55
  • No, still not working... However, I found this works: (evil-set-initial-state 'term-mode 'normal). You can edit your answer and I'll accept it. – nalzok Feb 13 '17 at 3:01
  • Glad that worked out – mclear Feb 13 '17 at 3:06

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.