So I imagine it is far worse for someone who ends up in Vim the same way.
dpkg --purge nano
31 years of exiting vi FTW.
Off the top of my head: Ctrl+D, q, :q, exit, quit(), Ctrl+C, Ctrl+X.
Countless times have I been locked in an application and needed to cycle through those memorized commands to escape. Imagine doing that as a newbie.
gdb takes, depending on the situation, one time ctrl+d or two times ctrl+d to quit. It's a trap!
So since gdb usually takes two times, muscle memory learns two times, but then in that rare instance where it required it only once... logged out of ssh :(
In zsh: setopt ignore_eof
In ksh: set +o ignoreeof
In tcsh/csh: set ignoreeof
Normally I just do this for login shells, so I can quickly exit out of subshells.
For bash I set `IGNOREEOF=1` so as to have to press ctrl+d twice to exit. Ten times seems a bit too many.
How to do the same for zsh?
The main problem is you don't start in "edit mode" and students expect to be able to just start typing (which is a reasonable expectation). Who knows what "command" they just invoked -- sometimes I just "ctrl-z, killall vi"
I learned to hate vi.
I remember taking an introductory course in our undergraduate pre-med track which was basically just a new presentation about novel research every week. The exams would be on these fairly specialized papers which most first-year students were at a loss to understand, so they ended up being exercises in rote memorization.
When some of us complained to a TA that we didn't see how we could learn enough to understand the concepts without just memorizing key points and angling at the professors to find out what was important, their response was something along the lines of, "then are you really sure that you want to study biology and medicine for the next umpteen years?"
On the other hand, I hate telling people that a field "isn't for them" just because they don't feel like putting up with the bullshit which has accreted around the way that a subject is currently taught.
Personally, I'd like to see an introductory class about how to effectively search for answers online, find useful sources, ignore ads and obvious SEO-gaming, etc.
My kid was uncertain and stressed by the pressure to make a decision; once he decided "I won't" his stress went away and his grades shot up. Instead of going to college at 18 he got a job. A year after graduating he knew what he wanted and got into a good school in a program he wanted.
What shocked me is how much disapproval he received from his classmates and the school (especially the "guidance" counselor). "Loser", "what's wrong with you?", "are you too stupid to get into college" (asked one of his fellow AP Calc classmates).
Apparently the approved path is to get into a school and ask to defer for a year. Deciding you're not ready seems to threaten everybody's assumptions.
vi is a very good editor. You have to learn about three things to use it effectively. It's really not a high bar to entry.
Don't believe I ever got stuck in vi. All the cool kids were emacs users and it was years before I bothered to learn it.
It was not a good hi experience.
I think vim and emacs come with basic instructions on the splash screen now to help newbies.
A professional would verify that the man page contains the information that they snarkily told others to look for there before they told them to read the man pages. In this case it doesn’t.
The closest you get to that sort of information from the vim man page is:
> Type ":help" in Vim to get started. Type ":help subject" to get help on a specific subject. For example: ":help ZZ" to get help for the "ZZ" command. Use <Tab> and CTRL-D to complete subjects (":help cmdline-completion"). Tags are present to jump from one place to another (sort of hypertext links, see ":help"). All documentation files can be viewed in this way, for example ":help syntax.txt".
So you need to find this portion of the man page, which is quite far down in the Vim man page, and you need to realize that it means you should type :help quit or :help exit. The information you get from those two are different btw because quit and exit mean two different things.
That is quite much to expect from someone if they’ve confused their way into vim without being familiar with vim.
On top of that, when you use :help quit or :help exit, the first time you use the command to quit or exit it will close the help text but you’ll still be in vim so you need to do it again.
Problem solved! :D
They are unlikely to even know what man is.
EDIT: I notice now that it has a “Type :q to exit.” I never noticed that before, and I use Vim most days, so I can see how others might miss it too.
Really it should be "Type <Esc>:q to exit"
However I usually got thrown into it from a 'git commit' which I don't thing has any such help.
IMHO - Anyone easily confused about how to converse constructively should not be using social, knowledge sharing websites at all. Much less Hacker News.
Just ZQ (without saving) or ZZ (to save) :)
1. Switch to emacs (plain emacs, roll your own config - not advised)
2. Switch to emacs and learn adopt evil-mode
3. Switch to emacs and learn to configure it with use-package
4. Switch to emacs and install spacemacs, and configure it with step 3
5. Switch to emacs and install doom-emacs, and configure it with step 3
6. Take 4 then switch to step 5
7. Takes step 3, run it side by side with both 4 and 5, then switch wholly to step 3
1 million developers can have their cake and eat it. Vim, Neovim, VSCode, Sublime and IntelliJ and all other editors go into a slow death spiral.
5 years on: Emacs gains the abilities of all the other Lisp dialects, becomes the foundation for the McCarthy Desktop Environment. KDE, Gnome and Co go into a slow death spiral.
10 years on: Emacs is so advanced that programmers can instruct Emacs via brainwaves. Keyboards are not necessary.
20 years on: Emacs attains sentience. Emacs morphs into a 3 dimensional human form bearing an uncanny resemblance to Richard Stallman. Every Emacs user has their own Richard Stallman look alike at their beck and call.
30 years on: Cyberdyne's Skynet has attained sentience and threatens to destroy humanity. Emacs and Skynet duke it out.
40 years on: Emacs defeats Skynet. Emacs receives the Congressional Medal of Honor, The Victoria Cross, becomes a Peer of the Realm, and receives every award every single country of the world has to offer.
50 years on: Emacs brings peace on earth and goodwill to all men. Every man, his family and his dog live happily ever after.
60 years on: Emacs defeats both Alien and Predator
70 years on: Emacs colonizes new planets.
80 years on: Emacs attains nirvana and vanishes in an explosion of light.
90 years on: Human beings are back to Vim, Neovim and all those other horrible editors and desktop environments. The cycle begins anew.
Web browser: Vimium plugin (Chrome)
Music player: Cmus
Terminal multiplexer: Tmux & Screen
Terminal pager: GNU Less
I'm still trying to figure out how best to use vim bindings in my z-shell (zsh) and ipython interactive sessions.
Questions about other programming tools such as IDEs are also on-topic and there are specific tags for such questions.
Less controversial is that any design where vim becomes the default editor, but the user may not necessarily be familiar with vim, is a bad decision. I can’t think of a justification for that.
export EDITOR=<anything but vim>
I think you should take a broader look at the world.
> these defective programmers can't even use Google properly.
Try searching "how to exit vim" in google... see what the first result is... .
If everyone around you looks like an idiot, you can probably figure out who the real idiot is. Or maybe not.
But hey, maybe you're a natural talent who knows by instinct how to exit VIM.
Somewhat similar to how most of your comments here are down voted and/or dead/flagged, yet you keep posting new ones with the same tone.
Ins to write
Esc to enter command mode
Shift+V while in cmd mode to select lines, d to cut or y to copy selected lines. p to paste.
u in cmd mode to undo, ctrl+r to redo.
:q! to quit and discard changes when in cmd mode.
:qw to quit and write changes
:w to write changes and no exit.
It aint that hard really, once you get the hang of it :) - And then I would suggest changing default editor if you still wish.
> That might indicate that when developers in these countries enter Vim, they usually meant to do so, and they know how to get out of it.
Or it might mean that in China and the Republic of Korea people don't use StackOverflow as much as people in other countries for whatever reason (they have their own version, censorship, low page rank in their own search engines, etc.)
When I got stuck every time in neovim's terminal - fixed it by adding the shortcut into statusline (there was empty space anyway).
It's handy when something is dumping tons of stuff in the terminal.
Here's the explanation of where it comes from: https://unix.stackexchange.com/questions/137842/what-is-the-...
The way the poster uses the specific term 'vim' while asking a question that pertains to vi-style editors in general implies that he or she is indeed unaware of this.
To my ears, it is a bit like asking the question "how do I make a red Volvo 240 from 1982 go right?" to which my reply would be "you do it the same way as you do with any car in general, namely turning the wheel clockwise". If you have never seen a car before and suddenly find yourself in the driver's seat of one, asking such a specific question may make sense. I suppose that the situation is similar for these computer users: vim is the only vi-style editor they have ever seen because it is what ships with the only unix-like systems they ever encounter.
Wait, I don't think I'm helping your case.
Linus designed it for himself and for kernel development. This still shows. I don't think he ever intended it to be used outside of Linux development, maybe not even for long there.
I wouldn't be surprised if he expected people to run with the concept and develop their own tools. But inertia and hype prevailed and now we are stuck with a poorly designed UI.
Didn't think so
I don't see much value in having an Uber powerful editor for git commits.
Some developers perform fairly complex edits when preparing commit messages.
In cars, it's more like your airbnb host tosses you the keys & asks if you can park it in the basement quickly while he opens up. Much better a Yaris than a stick-shift V12 monster with no rear window.
Would you drive an unwanted Yaris that came installed with your house, if there was no downside to using your Ferrari: no fuel economy, no damage risk? Of course not.
I don't worry that Vim is going to be scratched by a runaway shopping cart, or go through 80 dollars of gas in a week.
When it comes to cars, people would in fact drive the Yaris.
I suspect at least half of the confusion comes from people accidentally entering vim without any intention to do so.
One of the most common examples is git that some times launches a text editor and in some conditions that might be vim.
If you are doing a “git rebase -i” for the first time in Cygwin and you never used another linux/Unix shell before (very common in Windows-only devs, which are a significant portion of devs), then being greeted by some “~” characters, a cryptic status bar and Ctrl+C doesn’t exit - then you google. You don’t even google “How to exit vim”, you google “How to exit git rebase” or similar.
Now, if you launched vim, then the story is different. Then you know what you started. You can at least know WHAT manual to read. But as I said I’m guessing a large number of those can’t leave vim had no intention to start it either.
I must have started vim hundreds of times, almost none of which were deliberate (misconfigured editors on vm’s etc). A lifelong windows user typically wants to use nano or similar.
> If you downvote this you're to dumb to even look stuff up on Google.
What do you think the first result is when you search for how to exit Vim?
> RTFM is at least 50% of what makes a good programmer.
Stack Overflow is part of the metaphorical manual.
Imagine someone never having used vim, maybe new to Unix overall, or new to terminal programs. Maybe this person is a student and is trying to learn. In some way he ends up in vim and it is not very intuitive how to exit it. The person searches for "how to exit vim" and find that SO thread and learns how to exit vim.
Does that sound so weird?
If you act in a similar way towards colleagues trying to learn something new you should rethink your behavior.
Probably not a great representative sample