r/programming • • May 23 '17

Stack Overflow: Helping One Million Developers Exit Vim

https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/
9.2k Upvotes

1.1k comments sorted by

View all comments

Show parent comment

1

u/DuBistKomisch May 24 '17

huh? :q! forces a quit in vim for me, even with an unsaved file

dark blue being unreadable is your terminal emulator's fault

don't really understand what case vim would only shows the tail of the path, I've never seen it, is it just a really long path?

afaik :se compatible is the default if invoked as vi, complaining about having to configure stuff is retarded

wouldn't have to worry about swap files so much if you weren't killing vim processes all the time...

1

u/michaelpaoli May 24 '17

Yes, :q! should always work to quit, but in vim(1), sometimes it does not!!!
(another work-around I've found when it gives that behavior is set the file to /dev/null, write it out, and then quit, e.g.:

:f /dev/null
:w!
:q!

That seems to (mostly?) work when :q! fails in vim )

And tail of the path, yes, vim(1) screws with that and doesn't give the full literal, notably also including in % and # substitutions - this can be highly annoying, e.g.:

 $ cd /some_deep_path && vi /some_deep_path/[ab]

We'll say we have files a and b in that directory. Let's say we jump between the files a bit with :n, :rew, etc. Now, within vim, use cd to change to some other directory. With nvi and true vi, % and # reference /some_deep_path/a and /some_deep_path/b, whereas with vim they'll be a and b - this violates principle of least surprise and can cause serious problems, e.g. execute a command in vi using % and #, should reference /some_deep_path/a and /some_deep_path/b, not a and b - remember we changed directories within the editor. If I wanted % and # to be a and b and not their full paths, I would have used a and b as arguments upon invocation, but I explicitly and intentionally didn't - and generally for darn good reason. E.g. I may be editing a bunch of index.* files in various directories - and editor not referencing what I told it to can create all kinds or problems. Anyway, just one of many many many issues/problems with vim.

Nothing "retarded" about complaining about configuring stuff, an no, invoking vim as vi isn't sufficient - at least in many cases, to get it into it's (so-called) "compatible" mode.

Uhm, dark blue on black being unreadable isn't terminal editor's fault - that's a horrible combination for readability. If I wanted comments to be damn near invisible I wouldn't have written them, or I'd strip the things out. Anyway, vim sucks lots ... quite annoying. Thus far I've only found one thing that vim got right that nvi didn't get exactly right (and that is also correct in classic vi).

Note also that some of vim's behavior is inconsistent - not all of these bugs/issues show up all of the time, but most of them show up quite frequently enough to be quite annoying/problematic.

Anyway, a whole lot of what vim does and its default, options, behavior, etc. - highly sub-optimal, and significantly not compatible with vi!