Vim does not quit in terminal by escape and q or x or qw keys
I am using debian wheezy, I installed vim, it works quite well; excpet it does not quit in terminal by pressing the keys escape and pressing q, x or wq. I have to close the window adn then it closed.
What misktak most probably I have made.... |
You're missing the : prefix for the wq!
:wq! = write, quit/exit :q! = exit, no save or... ESC twice - ZZ is what I usually use. https://www.linuxquestions.org/quest...or-4175469764/ |
Vim does not quit
Thanks habitual for such informative response. but still with these keys it did not quit properly
|
I suggest you search on Google or similar for how to use vi/vim. The key combinations you're asking about are extremely well established and explained, verbatim, thousands of times over.
It is literally a matter of: Code:
vi file |
Quote:
you can save with this command-> ESC : wq or wq! |
When I've been editing for a while, and maybe got distracted, I habitually hit ESC a couple of times before trying something in command mode. Even if I may have already been in command mode. Habit. Doesn't hurt anything. And then you're sure you're in command mode before you start typing commands. Same thing when I want to go into insert mode after having been distracted. I hit ESC a couple of times before hitting "i" (or whatever insert command key I want). Nothing worse than thinking you are in insert mode typing text when you are actually in commnd mode typing commands. You will mess up your file really horribly and really fast in that situation!
|
As above, ensure you are in Cmd mode by hitting ESC once or twice (repeat doesn't hurt).
Now you can use cmds Code:
:q # quit, no save (will ask to save changes if any have been made) |
All times are GMT -5. The time now is 04:19 PM. |