Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

161–170 of 489 posts

Re: Helping a Million Developers Exit Vim

#161
post #27

Earlier quoted context omitted.

Add in the bonus confusion that you may not have even been trying to run vim, and in fact may not know what it is (hey, everyone's a beginner some time), but have landed there due to a default $EDITOR value. [EDIT] also, a typical mid-level computer user's tendency to slap "ESC" when panicked. Ha!

Which OS/Linux distribution set default $EDITOR to vim? Personally I've never seen one, and I don't think vim is a sane default value for $EDITOR.

I dunno if it's actually vim or some variation on it, but it is the default on, for example, Arch Linux, although I believe most other distros dropped me into it as well (e.g. git commit / rebase -i).

If there is such a thing as user hostile in the world of CLI tools, then dropping the user unannounced into vi with some open buffer most definitely counts as user hostile.

Re: Helping a Million Developers Exit Vim

#162
post #80

(Attribution is questionable, but as a geezer I feel the need to make sure the younger generations at least are familiar with this:) ed is the standard text editor Let's look at a typical novice's session with the mighty ed: golem> ed ? help ? ? ? quit ? exit ? bye ? hello? ? eat flaming death ? ^C ? ^C ? ^D ? --- Note the consistent user interface and error reportage. Ed is generous enough to flag errors, yet pruden…

"When I use an editor, I don't want eight extra KILOBYTES of worthless help screens and cursor positioning code! I just want an EDitor!! Not a “viitor”. Not a “emacsitor”. Those aren't even WORDS!!!! ED! ED! ED IS THE STANDARD!!!" https://www.gnu.org/fun/jokes/ed-msg.txt

Using vi/vim lets one enter a secret dark corner of programmer society.

Memorize vi keystrokes is knowing the secret handshakes.

Able to Exit vim is finding the door to enlightenment.

If vi comes with an easy "back" button like all browsers, no-one will learn it. One needs to be trapped inside for a while to feel the power of the dark side.

Re: Helping a Million Developers Exit Vim

#163
post #97

Earlier quoted context omitted.

There is a common convention, though, which is: don't use modal interfaces, modal interfaces are bad. The problem vim has is that its UI is entirely organized around modes, which makes the "people are terrible at using modal interfaces" problem a hard one for it to cope with.

If you took the modal interface away from vim, you wouldn't have vim anymore. If you don't want a modal interface, don't use vim. You may as well expect Porsche to move the 911's engine to the front.

> If you took the modal interface away from vim, you wouldn't have vim anymore. If you don't want a modal interface, don't use vim.

The vast majority of people don't use vim, so this "solution" has already been widely adopted. (Which in turn causes people who like vim to periodically wonder why more people don't use it.)

The problem comes because there are scenarios where you don't have a choice as to which editor to use; if you're shelling into a server with limited privileges, for instance, vi/vim may be the only even remotely modern editor available. So lots of people find themselves forced to use it, and these are the people for whom the Stack Overflow thread is useful.

Re: Helping a Million Developers Exit Vim

#164
post #140

I saw the bumper sticker ":w saves" and thought, to myself I wonder how many people "get" that. I suggested a long time ago that vi/vim bind ^C to exit. It currently is equivalent to 'esc' (it puts you into command mode if you aren't there and types the message "type :quit to exit Vim". I'd much rather it popped up 'exit vim? y/n?' and the next key would determine if you exited or not.

That looks more like emacs behavior though, vim rarely (never?) prompts the user for anything. You enter a command, you get a reaction (either an action like quits vim, or a message indicating something happened) -- which I personally prefer much more than getting annoying prompts.

I don't disagree. And I like that vim doesn't prompt you a lot, but it is the one corner case where such prompting could be useful.

Re: Helping a Million Developers Exit Vim

#165
post #121

Earlier quoted context omitted.

I'll bet between the reflog and aliases you could do that.

How would you undo "git reflog expire"? How would you undo "git push origin -f"?

> git reflog expire

Is there a valid reason to do this in the first place?

> git push origin -f

No standard way to undo that. Only do it if you must, and you absolutely do what's going to happen. Always do a "got remote update" immediately before the force-push and double-check that the remote branch points to what you expect.

As a general rule, "--force" is short for "you better be prepared to deal with the consequences".

Re: Helping a Million Developers Exit Vim

#166

Earlier quoted context omitted.

I'll bet between the reflog and aliases you could do that.

I'm requesting the exact syntax I just wrote. EDIT: the replies to this don't get how feature requests work. yes, I could write this basic feature myself. thanks.

So write a script and assign an alias.

Re: Helping a Million Developers Exit Vim

#167

I'm somewhat amazed but mostly amused that the Vim developers care so little about user experience that they continue to ignore that people have trouble with exiting their tool and refuse to adapt to a more expected convention for exiting it.

In my opinion the problem is more, that console beginners are told that CTRL+C is a magical bullet that will save them from any obstacles they might encounter in the depths of the cli.

It's not like other editors behave much differently than vim. Try for example to get out of an "git log" with CTRL-C. Or figure out what the key combo ^x in nano means as a novice.

Re: Helping a Million Developers Exit Vim

#168

Earlier quoted context omitted.

That's the point. That behavior is contrary to the expectation. Ctrl+C should not display a message: Ctrl+C should quit immediately.

On many editors ctrl-c is the copy key. Not a good key to exit on...

It's the other way around - mapping copy to ctrl-c was a bit stupid...

Re: Helping a Million Developers Exit Vim

#169

I'm somewhat amazed but mostly amused that the Vim developers care so little about user experience that they continue to ignore that people have trouble with exiting their tool and refuse to adapt to a more expected convention for exiting it.

Actually, I would propose the UI for vim is very self-consistent.

Re: Helping a Million Developers Exit Vim

#170
post #121

Earlier quoted context omitted.

I'll bet between the reflog and aliases you could do that.

How would you undo "git reflog expire"? How would you undo "git push origin -f"?

> How would you undo "git push origin -f"?

Remote reflog contains this info (if enabled).

Of course not all commands would be reversible, especially not plumbing.

Post reply on HN