Live data from Hacker News

Helping a Million Developers Exit Vim

stackoverflow.blog

381–390 of 489 posts

Re: Helping a Million Developers Exit Vim

#381
post #354

Earlier quoted context omitted.

I just hate programs that change patterns that are standard everywhere else. E.g. 99% of software uses control+c and control+v to do copy and pasting, so of course software that maps it to something totally different is going to be very frustrating. The same thing with vim using nonstandard way of quitting. Discoverability is another problem. You can have weird keyboard commands, but make it possible to find them wit…

> The same thing with vim using nonstandard way of quitting. How do you quit man? How do you quit less? 'q' to quit is pretty standard in the TUI world.

q is only quit when run as a command. In normal mode, it's record.

Re: Helping a Million Developers Exit Vim

#382

I met my wife because she was stuck in VI. I was a unix sysadmin in the early 90s, and she was a grad student. She came to me for help (like most of the 1st years did) because she couldn't get out of vi. However, to be fair, this was not her fault per-say. She actually knew how to use vi, but just couldn't find the ESC key. Does anybody remember the DEC keyboards where there was no traditional ESC key, but it was F11…

Most people have no idea why vi made sense way back when (and, in my opinion, does not today). I used VT100 terminals for years on both mainframe and CP/M systems. Keyboards were not very standardized before then, the mouse did not exist and most text editors had to use all sorts of convoluted commands to allow you to do anything. http://www.vintagecomputer.net/digital/VT100/DEC_VT100_SYSBO... I ran the first version…

It is the only editing system that makes sense to me. That's because modal editing means fewer modifier-key combinations are needed, and no mouse is needed. Compare with.. any other editor, where the only thing that might save you from RSI is enabling sticky keys, and even then, if it isn't emacs you still have to heavily use a mouse.

For a great number of tasks, being a vim or emacs pro means doing things faster than any other editor could do them (except, maybe refactoring). And vim will save you from from more RSI than emacs by having fewer modifier key combinations.

Every IDE needs a vi mode.

Wherever I can I use tmux+cscope+ctags+vim+shell as my IDE. One tmux session per-project, nested in one big tmux session for all projects. Window #0 has a cscope with a an $EDITOR wrapper that opens new edits in new, appropriately titled tmux windows and returns control to cscope. Windows #1 through #4 are for a shell. The rest are for editing files opened via cscope. It's a dream for C/C++, even Java. cscope needs support for more languages, that's true, certainly, but this gets me quite far.

Re: Helping a Million Developers Exit Vim

#383
post #283

Earlier quoted context omitted.

Yes, please do chmod your SSH key, netrc, and other sensitive files as world readable! Sincerely, that other guy on your multi-user OS.

Not sure if is there is something more subtle in the note but around 2001 (or even later until today) chmod -R 777 was pretty popular advice to solve all kinds of 'problems'. Usally 0644 is a sane default for web stuff.

Yep, that's exactly what he meant: Here's how to get out of vi when you get stuck there, and here's how to undo the stupid thing you just did to try make your website work. For web stuff you usually do want 0644, or 0664 if the files are owned by your user account and not apache.

Re: Helping a Million Developers Exit Vim

#384

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.

VIM works in a certain way. Once you understand it, the mechanism for exiting fits in just with the rest of the patterns. Why should they create a special case for exiting versus other operations? "Why is it so hard to search? Use ctrl-f instead of /" "Why is it so hard to cut and paste?" "why is it so hard to move the cursor?" You'd have a different editor if you changed the keybindings. Vim's defining feature is th…

vi's defining characteristic, which vim inherits, is that it is _modal_. That means that it has modes, like input mode (where what you type is added to the file), and command mode (where what you type are commands to the editor).

Modal editing is fantastic: it means you don't need a meta key, or multiple modifier key combinations to do things (for which your wrists will thank you!). It frees up keybindings for different purposes, which is partly how modal editing ends up needing fewer modifier key combinations.

Best thing in editing technology yet.

Re: Helping a Million Developers Exit Vim

#385

Want to edit text use Vim, want to edit code - use proper IDE.

Proper IDE is fine, but then you switch to/embed another language and suffer. Btw, my colleagues often fail to perform simple tasks with proper IDEs, e.g. grepping entire project folder, not only files added to the project. Or moving through sources effectively, leaving interesting checkpoints in splits. Or respecting sw/ts/et settings per-file. Or formatting a table. IDEs are too high-level for these things, because they can refactor-omg-rename for ideally correct static language sources.

Re: Helping a Million Developers Exit Vim

#386
post #146

Earlier quoted context omitted.

Emacs is definitely difficult to exit from. The difference is emacs usually isn't the default/fallback EDITOR on the system, so you rarely get dropped into it unknowingly/unexpectedly.

Also: Emacs is rarely if ever used in the terminal today, and exiting it through the standard desktop protocol ([X], Ctrl-[Shift]-Q, Alt+F4, ...) always works.

I use emacs in a terminal all the time (usually in a tmux session, actually). That's how I learned it (in pre-GUI days) and so it feels pretty natural. I never use the mouse with emacs, even in a GUI session.

Re: Helping a Million Developers Exit Vim

#387
post #90

Earlier quoted context omitted.

I find that with a specific and known edit, it's far easier to do using sed and awk. In particular awk Has better power-to-weight ratio at traditional text processing. I think typical awk scripts could very well be shorter than the equivalent python scripts that do the same thing.

I have written hundred+ line awk programs. For stream text editing it is excellent at what it does and it's install base is huge. Rarely do I encounter a *nix machine without it on there.

> Rarely do I encounter a nix machine without it on there.

Isn't it posix mandated?

Re: Helping a Million Developers Exit Vim

#388
post #224

Earlier quoted context omitted.

There's certainly a trade-off between learning curve and long-term productivity. But the problem here is that vi/m gives shitty feedback, that's all. It should say "Press and type :quit to quit VIM" but it doesn't. Most first-time users lack a mental model of input modes, so they get stuck.

After pressing Ctrl-C a few times, the status bar says 'Type :quit to exit Vim' for me. Not sure what else people try to exit vim.

There's always C-z, but that actually works.

Re: Helping a Million Developers Exit Vim

#389

I met my wife because she was stuck in VI. I was a unix sysadmin in the early 90s, and she was a grad student. She came to me for help (like most of the 1st years did) because she couldn't get out of vi. However, to be fair, this was not her fault per-say. She actually knew how to use vi, but just couldn't find the ESC key. Does anybody remember the DEC keyboards where there was no traditional ESC key, but it was F11…

"So how did you meet your wife?" "She badly needed an escape, and I showed her the way." ...sorry, terrible pun.

At least you didn't use "Feleventh Heaven".
Post reply on HN