I'm moving from vim to spacemacs, and the only little frustration I have at the moment is that in vim my workflow tends to involve quitting vim a lot (with :q). I find myself continually exiting spacemacs by mistake - and having to wait for it to restart. Habits die hard. How can I either remap ':q' to quit the buffer (and not spacemacs) or disable ':q' completely to force myself to learn to kill buffers the spacemacs way?
Asked
Active
Viewed 1,350 times
2 Answers
9
Adding the following to my config file (~/.spacemacs) resolved the problem:
(evil-ex-define-cmd "q[uit]" nil)
This can also be used to modify the behaviour of the ex command line by replacing nil with a function name, e.g.
(evil-ex-define-cmd "q[uit]" 'evil-window-delete )

Mark
- 440
- 4
- 9
3
I've never used spacemacs before or evil mode but it would make sense to rebind the key to not do anything like this:
(define-key evil-ex-map "q" nil)

Jules
- 1,225
- 7
- 13
-
1Unfortunately this doesn't quite get there, but after some searching I found the following solution work (evil-ex-define-cmd "q[uit]" nil) – Mark Jun 17 '16 at 11:31
-
1@Mark Why not add that as an answer to your question and accept it? – Jeffrey Bauer Jul 08 '16 at 14:47