r/programming • • Aug 06 '22

Vim, infamous for its steep learning curve, often leaves new users confused where to start. Today is the 10th anniversary of the infamous "How do I exit Vim" question, which made news when it first hit 1 million views.

https://stackoverflow.com/questions/11828270/how-do-i-exit-vim
5.3k Upvotes

621 comments sorted by

743

u/HerbyHoover Aug 06 '22

That's great. In the interest of sharing another great StackOverflow VIM post. Your problem with Vim is that you don't grok Vi

451

u/bcstpu Aug 06 '22

Been looking for that for years, thanks.

As someone who's been using Vim/Vim emulation for ages, I've seen it described as (I sadly lost the SO answer link for it) "Vim users are akin to wizards, mapping parts of their brain to metacommand processing so as to perform feats others consider unthinkable effortlessly, but have given up a piece of themselves, such as the ability to see the color blue or remember your mother's face".

37

u/Sinujutsu Aug 06 '22

Such an accurate description lol

6

u/DonnyTheWalrus Aug 07 '22

Part of me feels like I should be learning vi/vim to unlock some sort of next level productivity. However, I feel like I can count on one hand the number of times that editing speed has been my bottleneck. I'm a reasonably proficient VS/VS Code user and know & use most of VSC's shortcuts, many of which have unlocked big productivity boosts. But if I'm using an objectively less whiz bang editor and I'm already finding thinking speed to be a much bigger bottleneck than editing speed, I'm just not sure it's worth the effort.

Perhaps it's because by the time I started learning programming about 7 years ago, IDE code completion was already ubiquitous. If I didn't have access to the insano levels of prediction we have today I could easily see editing speed being a bigger deal.

→ More replies (3)

10

u/[deleted] Aug 07 '22

Vim took my gender.

19

u/Zaemz Aug 07 '22

It didn't take anything away, it gave you clarity.

Vim gifted you your identity.

→ More replies (2)
→ More replies (2)
→ More replies (1)

232

u/[deleted] Aug 06 '22

I like the comment:

Holy code monkeys,..that's one in-depth answer. What's great is that you probably wrote in in vim in about 10 keystrokes.

25

u/Tricky-Alps2810 Aug 07 '22

Only a Vim user would sit for twenty minutes trying to work out how to type something in 10 keystrokes rather than just writing out the whole thing directly ...

→ More replies (2)

35

u/FujiKeynote Aug 06 '22

I'm probably far from the only one, but that answer is what in fact made me properly consider Vim ten years ago. Ten years later, still one of the best accidental software decisions in my CS journey

→ More replies (2)

83

u/plan_x64 Aug 06 '22

I use Vim daily but this answer kind of reads like a meme of the “A monad is just a monoid in the category of endofunctors, what's the problem?”

10

u/iheartrms Aug 07 '22 edited Aug 07 '22

I, too, once tried to learn Haskell.

Spacesuits, burritos, barrels of toxic waste....ok, but how do I print "Hello World"?

6

u/_pka Aug 07 '22

print “Hello World” :D

→ More replies (10)

75

u/[deleted] Aug 06 '22

I’ve been using vi/vim as my preferred editor for 20 years now and I know I only scratch the surface of its capabilities, but even at that shallow level, switching to anything else feels so inefficient.

Thank god for the vim keybindings in vscode and other editors.

153

u/elmstfreddie Aug 06 '22

I always find this whole thing silly because editing speed has never been my "bottleneck" in completing code projects

68

u/Hrothen Aug 06 '22

If you write code faster you can spend more time on not knowing what code to write and still finish in the same amount of time.

→ More replies (2)

58

u/TheMaskedHamster Aug 06 '22

Text manipulation is (usually) not the bulk of my time when editing code. But man does it help my sanity to not waste any more time on it than I have to.

→ More replies (2)

35

u/demonguard Aug 06 '22

I think it's mostly about removing friction. I don't spend the majority of my time typing/editing, but the faster and easier I can make my small edit (without taking your hands off the keyboard or whatever the benefit of your preferred input styles may be), the faster my overall iteration loop is.

→ More replies (16)
→ More replies (4)

17

u/Fluxriflex Aug 06 '22

Unrelated, but what does grok mean? I see it used in programming conversations a lot.

47

u/[deleted] Aug 06 '22

It just means "to understand". Comes from Robert Heinleins "Stranger in a strange land". In that book tho it has a more nuanced definition if I recall

8

u/[deleted] Aug 07 '22 edited May 19 '24

vast axiomatic sink ancient nail close spectacular person decide cheerful

This post was mass deleted and anonymized with Redact

17

u/Fluxriflex Aug 06 '22

Ah, thank you! I grok it now!

→ More replies (3)
→ More replies (2)

21

u/[deleted] Aug 06 '22

it's origins are the book are the Robert Heinlein book Stranger in a strange land, which was about a martian who came here to earth. Grok was a martian word he used as a description of deeply understanding something to the point that it was intuitive.

3

u/amertune Aug 06 '22

It means to comprehend/understand

→ More replies (2)

3

u/JoeMiyagi Aug 07 '22

This was actually the post that radically improved my productivity in Vim. The “language” of Vim is the key to generalizing and being able to guess commands. Thanks for digging this up, I couldn’t remember where I had first read it!

3

u/HerbyHoover Aug 07 '22

I don't use Vim as my go-to editor when I do program but that post definitely left an impression on me after all these years.

15

u/[deleted] Aug 07 '22

No, the problem with Vim is that it sucks when all you want to do is edit some fucking config file and now you gotta learn about insert mode, etc.

Once you learn it I'm sure it's fine. And I fully realize it predates other options and is great because it works across a terminal. But when all you want to do is quickly edit some dinky file, something like nano is faster and easier, if it's on the system.

Or you just wind up learning it enough to get by.

Source: The retiring sysadmin was super full of himself and chortling when I didn't remember immediately how to use it, like he had somehow won a prize. I let him know that I'd used it before, but not since the mid-1990s when I installed Redhat Linux off of many CDs while enlisted in the USAF, and made their CD-ROM tower available on the LAN to much adulation. (The USAF loved having their AFRs/AFIs "online". We didn't have the Internet yet. Anyway, the guy was a smug prick.

→ More replies (2)

44

u/Reverent Aug 06 '22

I lump vim into the Dvorak keyboard crowd, people so convinced of their superiority that they learned an inscrutable input method to prove it.

59

u/silly_frog_lf Aug 06 '22

I use Vim. I am not superior. I don't feel superior. It is closer to touch typing. You go through a lot of effort. You are used to doing it that way. You sometimes wonder if it was worth it or not

31

u/Servious Aug 07 '22

Man why are so many people convinced that the only reason anyone would ever do anything technical or complex is to feel superior?

I just like pressing buttons man

→ More replies (2)

27

u/[deleted] Aug 06 '22

The problem is your perception. Most people don't care about showing off "their superiority," whatever that is supposed to mean. Vim happens to be a great tool--so great that you can't imagine what it's capable of until you use it for a decent amount of time. That is fun and I can see why somebody would be enthusiastic about sharing what they've discovered.

→ More replies (6)
→ More replies (11)

4

u/SaintWacko Aug 07 '22

Holy shit. I've been using vim exclusively for about five years now, but that answer shows me I've barely scratched the surface

→ More replies (16)

158

u/efvie Aug 06 '22

I’ve used Vim forever… but now I use Vim on VSCode. It’s the first implementation (or actually two, vscode-vim and -nvim) that doesn’t feel like too much of a compromise or too slow. Don’t think I’m going back.

This is a great opportunity for a whole bunch of new coders to see if they can exit Vim!

22

u/steven4012 Aug 06 '22

Does it allow for new text objects? Vanilla vim's "language" feels too limited

13

u/efvie Aug 06 '22 edited Aug 06 '22

I don’t think either currently allows defining those on top of the extension, but you could in the extension itself. And they’ve already added an 'expanding selection'. Or write it as a plugin extension, effectively, and bind it to whatever you want.

The VSCode extension API is really good, which is one of the big reasons I’m staying.

→ More replies (9)

17

u/lelanthran Aug 06 '22

I’ve used Vim forever… but now I use Vim on VSCode. It’s the first implementation (or actually two, vscode-vim and -nvim) that doesn’t feel like too much of a compromise or too slow.

I'm trying to get used to the Vim mode in VSCode, but it very often differs in small ways that make me grind me teeth[1]. Still using it though.

[1] The undo/redo is impressively vexing, compared to Vim. I'll often find myself having lost changes while trying to browse the undo/redo tree.

4

u/efvie Aug 06 '22

Yeah, that must be one of the trickiest corners to get right. I have never been a heavy tree or even register user so there may be some issues I just haven’t hit at all (although getting the simple yank buffers and the system clipboard interoperating so that it feels natural took a little more finessing than I’d like.)

7

u/KallistiTMP Aug 06 '22 edited Aug 30 '25

entertain soft dam license fuel ripe smell shelter person rainstorm

This post was mass deleted and anonymized with Redact

6

u/efvie Aug 06 '22

Sort of but not quite, I think! LSP (or coc+lsp really) gives me a pretty good IDE experience but it’s really the vscode ecosystem that I think sets it apart. I don’t use that many extensions, but there are a lot (of good quality too), and I can write my own with considerably more ease than I could in vimscript.

→ More replies (6)
→ More replies (2)

641

u/FriedRiceAndMath Aug 06 '22

I just hit Escape about 75 times to make really sure it’s in command mode, then :q

17

u/marssaxman Aug 06 '22

I don't even bother, I just open up another shell and killall vi.

4

u/dagbrown Aug 07 '22

I tried that on an old SysV box once. Not vim, but some other thing.

To be fair, it certainly did kill what I wanted it to kill.

32

u/hapygallagher Aug 06 '22

I really don't get what's so hard, there's a purpose built exit vim button right on the case of your computer.

7

u/MonokelPinguin Aug 06 '22

Doesn't work in case you are stuck in ex mode. (you need to enter the visual command first.)

16

u/[deleted] Aug 06 '22

ZZ ftw

11

u/devraj7 Aug 06 '22

Rookie move. You should use :x.

9

u/AnsibleAdams Aug 06 '22

:q quits no save

:wq saves file, then quits

:x saves file, then quits, uses one less keystroke

38

u/lelanthran Aug 06 '22

:q quits no save

:wq saves file, then quits

:x saves file, then quits, uses one less keystroke

Here's an important one :cq - that quits with an error code

How is that useful, you ask? Well, let's say you're in the middle of writing your git commit message (after doing git commit -a) in the Vim that was launched by git. You've already saved, so if you simply :q the commit goes ahead with whatever you entered into the editor.

If you :cq git gets an error return from the $EDITOR, and aborts the commit, thus saving you the time needed to undo that commit.

→ More replies (4)

6

u/CarlRJ Aug 06 '22 edited Aug 06 '22
CommandAction
:q<CR>quits vi if nothing needs saving (error if unsaved changes)
:q!<CR>quits vi discarding any unsaved changes
:wq<CR>writes file, then quits
:x<CR>writes file if changed, then quits, using one less keystroke than :wq<CR>
ZZwrites file if changed, then quits, using one less keystroke than :x<CR>
→ More replies (4)

7

u/FriedRiceAndMath Aug 06 '22

:x:x:x
^c^x
Eat flaming death:x

Unclear how to exit using this sequence. Please advise:x

EDIT: had to workaround Reddit markup parser

3

u/Eiixb Aug 06 '22

I've been tapping escape twice since forever.

3

u/[deleted] Aug 06 '22

ZQ to quit without saving or ZZ to save and quit

2

u/GaryChalmers Aug 07 '22

I usually use wq!. That way Vim won't bug me with any prompts.

→ More replies (32)

183

u/turniphat Aug 06 '22

I first struggled with exiting vim 26 years ago.

28

u/[deleted] Aug 06 '22

not to call you an idiot, but why dont you reboot?

24

u/liquidivy Aug 06 '22

Massive props to their power company though for not having a single outage in that time.

5

u/[deleted] Aug 06 '22

Parallel redundant UPS sources spliced into the original power cord now.

What I want to know is what OS version are they using? Likely a SunOS, Solaris, HPUX, AIX or Xenix? By now they'd have needed to install a way to get RAID 1 disks with hot-swap to keep the system up as disks fail.

5

u/Olap Aug 06 '22

Rookie numbers, gotta up those numbers

→ More replies (1)

25

u/tubbana Aug 06 '22 edited May 02 '25

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum

23

u/[deleted] Aug 06 '22 edited Apr 08 '25

market seemly air capable observation retire gold longing fall sort

This post was mass deleted and anonymized with Redact

4

u/[deleted] Aug 07 '22

I draw this to my students each semester and they seem to grasp vi afterwards.

Jesus those poor students. Is he teaching them how to quit Vim or how to quit computer science degrees?

2

u/greebo42 Aug 06 '22

I just read thru the post, and I really like that state machine!

Now I can hit <:> or <ESC> with intent

40

u/noneofthatmatters Aug 06 '22

I just remember the head of our Comp. Sci department giving a workshop on Vim and continuously fucking up commands. I've always been a very surface-level user of Vim (hence product manager, not engineer) but always impressed by those who use it as a sub-langauge.

30

u/THICC_DICC_PRICC Aug 06 '22

To be fair to the guy, everyone seems to forget how to type when doing it in front of other people. I’ve seen complete wizards when no one is looking transform into grandmas when showing something to someone

4

u/glacialthinker Aug 07 '22

You can't easily translate muscle-memory to actual keys, except by just using the muscle-memory.

Any time I need to tell someone what I did, or how to do something in Vim, I have to type it out and then I'm mildly shocked at the gobbledegook. If I try to skip the typing and just say what to do... I'm in for a rough patch of mental gymnastics, and likely a lot of mistakes and embarrassment.

61

u/pinpinbo Aug 06 '22

You don’t have to master vim, you just have to memorize 20 commands or so.

16

u/_tskj_ Aug 06 '22

Most of which are very mnemonic by design, it only takes you half an hour, hour, once to remember them for the rest of your life.

35

u/obvithrowaway34434 Aug 06 '22

Most of which are very mnemonic by design

Absolutely not by design, original vi key bindings were create entirely based on the existing keyboard layout at that time (lack of arrow keys is one example) with all the limitations therein. Many of them were also created as visual mode versions of ed commands. All the mnemonic stuff came later in an attempt to make it easier to remember the keybindings. The keybindings would be something completely different if Vi was created two decades later.

11

u/_tskj_ Aug 06 '22

Huh interesting, I don't know enough of the story. It seems very obvious to me that "d" for delete, "w" for word, and so on, is mnemonic by design, but of course there is much more to vim than that.

→ More replies (3)
→ More replies (5)

2

u/wiriux Aug 06 '22

21 if you want to impress.

2

u/maquinary Aug 07 '22

I am glad to see that. I just want to turn (Neo)Vim into an IDE like Visual Studio Code.

2

u/phire Aug 07 '22

I don't think I ever got beyond memorising about 5 or 6 commands, and I used vim as my primary editor for several years.

Most of the time I was just using it as nano with multi-line delete commands.

282

u/pogogram Aug 06 '22

The one thing I truly despise about the community in a general sense is this extreme aversion to people openly saying they don’t know something. God forbid you say that on stackoverflow.

“What? You don’t know what a modulus operator is? You absolute fucking troglodyte, why do you even exist? I was using those in the womb while I was programming my own fully immersive virtual reality games. You should be ashamed of yourself. I will not answer your question but instead keep bragging about how amazing I am. “

It’s this maddening thing that serves no purpose. There is literally nothing wrong with people not knowing something even if you think it’s simple or obvious. We all had to learn that obvious thing at some point. A lack of information doesn’t equal a lack of intelligence.

127

u/Fyren-1131 Aug 06 '22

Someone once explained that SO is not a forum to be used as discussion for problems, it's more akin to a dictionary / wiki of problems (since original answers from users may be edited / maintained by entirely different users after the original user made the answer).

Not that it defends the asinine elitism that's rampant there, but it kinda gives ground to the notion that repeat questions serve no purpose.

68

u/plokman Aug 06 '22

The problem with that is tech evolves much faster than a language. A good answer 5 years ago may be an awful answer today

36

u/Fyren-1131 Aug 06 '22

True, but the answers are maintained. I don't know the process of that, but often when I find a question asked a long while ago, the answer may have updated and new paragraphs added by other people over its lifetime.

→ More replies (1)
→ More replies (6)

16

u/THICC_DICC_PRICC Aug 06 '22

It’s this maddening thing that serves no purpose.

As someone who’s active on stack overflow, you know what’s really maddening? For about 80% of the questions in our feeds, if I google the question title verbatim, the first result has their answer. You shouldn’t be asking easily searchable questions on stackoverflow, you’re just burning people out who are there to help for free, and you’re clogging up the question pipeline with useless junk, leading to important questions going unnoticed. Fucking look it up, and you deserve to be berated if you’re on a fucking website, therefore you have internet and google, and you still choose to ask a question instead of typing in your question word for word into google.

→ More replies (9)

41

u/BuriedStPatrick Aug 06 '22

What I find most frustrating are the people who "answer" with the question: "why would you want to do that?"

It so utterly misses the mark of what a person is trying to achieve and it does come off as mocking a person for not understanding everything about the program.

There are of course "bad" questions out there with missing context and misunderstandings. But if you truly want to help a person like that, it's better to get to the core of what they're trying to achieve, maybe think a bit outside the box as to why they would think something would work a certain way before just putting up a wall of technical jargon they have to pass first.

73

u/fredoverflow Aug 06 '22

What I find most frustrating are the people who "answer" with the question: "why would you want to do that?"

tbf https://en.wikipedia.org/wiki/XY_problem is rampant among beginners

9

u/chengiz Aug 06 '22

Yes that is true but a lot who answer that way are not really interested in the problem. If it turns out the problem was not xy, they either give up and the question remains unanswered, or keep "explaining" how you cannot possibly be correct (because that would imply they were wrong in some way).

6

u/blbil Aug 06 '22

Holy shit, it has a name!

Thank you for this brilliant intel.

→ More replies (13)

11

u/pogogram Aug 06 '22

I try to remind myself that having knowledge doesn’t automatically make people good teachers. And sometimes people default to saying don’t do a thing without realizing other don’t have the same context floating around their head. I try to encourage the process of always answer the question, then say here is a reason not to do it this way and then show the better way. You help someone learn a better lesson without making feel stupid for simply not knowing and they will most likely pass that information on in a similar fashion.

6

u/f3n1xgamer Aug 06 '22

i dont think its bad sometimes, people don't even understand the problem they are trying to solve

→ More replies (9)

10

u/oniony Aug 06 '22

Turns out, even after over twenty years in the industry, I didn't know the difference between the modulo and remainder operators until a few months back.

33

u/Lich_Hegemon Aug 06 '22 edited Aug 06 '22

For those unaware. The modulo of a number is always positive. The remainder of a division can be negative.

If you do -5 / 2, the result is -2 with reminder -1 because (-2 * 2) - 1 = -5. That's the reminder and that's why it produces negative results.

Modulo instead is instead related to modulo arithmetic, which constrains numbers to a subset of integers from 0 to the modulo - 1, wrapping around any results that go past these bounds. -5 % 3 == 1 because -5 wraps past 0 around to 2 once for -2, and twice for 1.

→ More replies (1)
→ More replies (11)

46

u/TerminatedProccess Aug 06 '22

I'm so old I use vi.. none of that new fangled vim futuristic internet stuff for me! hawking up some phlem

14

u/dchaid Aug 06 '22

You can’t spell vintage without…some letters…

15

u/NotFromSkane Aug 06 '22

Do you really? Most distros just symlink vi to vim (and sometimes even vi to nvim)

4

u/isarl Aug 06 '22

Just curious – do you know which ones link vi to nvim, and do you know if any link vim to nvim?

5

u/NotFromSkane Aug 06 '22

I don't know because I haven't used it recently (at all) but I believe that Debian systems link vi to nvim if vim isn't there to do it first. Never seen vim to nvim

→ More replies (3)
→ More replies (3)
→ More replies (2)

179

u/[deleted] Aug 06 '22

Fundamental problem for vim is an exaggeration of the problem of TUIs generally: lack of arbitrary discoverability. Mouse-oriented GUIs let me just click stuff and see what happens, and generally, most of the the stuff that can happen is somewhere in the immediate GUI for me to click. Menus and menu bars supplement this when design reaches an impasse of making everything immediate in the GUI, but they're still fundamentally discoverable.

Vim has a shit ton of crazy features, so much that hardened veterans who've used vim for most their adult life will still be shocked to learn about a feature they didn't know about. Why?

Because the only way to discover features is to read everything under :h. Have you read the man pages for everything on your UNIX-y OS? Exactly, now replicate that entire problem in the context of everything that can be possibly be done in vim.

How many regular (neo)vim users learn something about their editor of choice from blog posts, random comments on reddit/HN, asking SO questions, reading someone else's config on GitHub, etc? That's a failure to give your user the ability to "fuck around and find out", for lack of a better term. This is trivial in mouse-oriented GUIs.

But again, that's not a specifically vim issue, its endemic to TUIs (hence bash completions and all the other hacks to make discoverability accesible). As well, there are some projects to ameliorate this in vim like the which-key family of plugins[0][1] and others like them.

48

u/chucker23n Aug 06 '22

Vim has a shit ton of crazy features, so much that hardened veterans who've used vim for most their adult life will still be shocked to learn about a feature they didn't know about. Why?

Because the only way to discover features is to read everything under :h.

To be fair, this is true of the big GUI apps out there as well. Few people will use the majority of features Microsoft Word and Adobe Photoshop have to offer, and Microsoft in particular has for many years tried to grapple with that problem (first by introducing toolbars to surface common tasks, then in Word 2000 by changing menus to only show common items at first, a feature they quickly abandoned, then in Word 2007 by merging menu bar and toolbar into the ribbon, a controversial approach from the start, and so forth).

But yes, GUI apps tend to be far better than CLI apps at discoverability. Just… at a certain point, there are diminishing returns.

→ More replies (6)

7

u/DeLift Aug 06 '22

Which-key is a godsend. It's one of those features you never knew you wanted until you see it.

17

u/_tskj_ Aug 06 '22

Like yeah it's a hassle to learn, but it's also an incredible tool I couldn't work without. I am a professional after all, I'm expected to spend some time becoming proficient in my tool of choice. That being said, I don't use vim in the terminal except rarely to edit some quick files, most of my development I do in IntelliJ and VS Code, both of which provide excellent vim plugins, which is what I rely on for most of my work. Like I said, it's such a powerful tool I would quit being a professional developer if I had to edit code without it, but it's also perfectly possible to integrate with a GUI or IDE for the rest of the things you need to do.

→ More replies (2)

6

u/KallistiTMP Aug 06 '22 edited Aug 30 '25

worm party narrow aromatic thought voracious enjoy seemly pot caption

This post was mass deleted and anonymized with Redact

→ More replies (5)

3

u/lelanthran Aug 06 '22

Mouse-oriented GUIs let me just click stuff and see what happens, and generally, most of the the stuff that can happen is somewhere in the immediate GUI for me to click. Menus and menu bars supplement this when design reaches an impasse of making everything immediate in the GUI, but they're still fundamentally discoverable.

With the feature list of vim, and the composibility of verbs, you'd need a menu hierarchy a few thousand levels deep to replace all the commands with clickability.

Think about how many times, when typing in some text (a reddit comment box in the browser, a chat in slack, a reply in your email editor, your git commit messages, etc) you use non-alphabetic keys (Home/End/Arrows with the shift and/or to select/navigate whole words or whole lines, backspace, delete, CTRL-v, CTRL-c, etc).

Now imagine if every single one of those keys were replaced by an onscreen mouse-clickable button instead. Just how crippled would your typing experience be?

For the more common stuff, Vim has it in the menus anyway (use the gui).

→ More replies (17)

16

u/SLiV9 Aug 06 '22

Do you know what's actually much worse that Vim: any latex command line tool. If you want to interrupt it while compiling you can hit ctrl-C. Cool, that's normal. But if it encounters an error, it asks you to type in a solution somehow. And in that case ctrl-C does nothing, but you can hit ctrl-D?? Sometimes! But if you are unlucky, or if you press enter by accident, you are stuck some sort of hell from which there is no escape. (Well ok, it's "X, enter", I believe.)

→ More replies (1)

6

u/meldroc Aug 06 '22

Ah, I was a Jedi in the VI vs. Emacs war just like your father! Before the dark time. Before the FAANG Empire...

6

u/[deleted] Aug 07 '22

I love the answer from the guy who drew a picture of a finite state machine in order to describe how to use a text editor.

32

u/PCUpscale Aug 06 '22

I would say that emacs is a bit more complicated than vim, but okay

15

u/[deleted] Aug 06 '22

An OS is more complicated than a text editor in most cases

29

u/[deleted] Aug 06 '22

Just because you need an extra hand for emacs key bindings.

7

u/Pesthuf Aug 06 '22

Wanna play impossible mode?

Emacs key bindings... on an international keyboard layout.

→ More replies (1)

0

u/[deleted] Aug 06 '22

[deleted]

→ More replies (1)

5

u/bdc41 Aug 07 '22

Thirty five years user. Have not had to learn another editor since I became proficient. I would have to learn an editor every two years before. Long live VIM and Fortran.

22

u/CurtisLeow Aug 06 '22

Vim Tutor is really helpful. IMO Vim should open Vim Tutor instead the first time a profile launches the app.

36

u/BatshitTerror Aug 06 '22

That would piss me off everytime I setup a new VM or open vi in a container

29

u/baconbrand Aug 06 '22

Hey! Listen!

12

u/isarl Aug 06 '22

One harmless way to handle both concerns would be to simply put a mention of the tutor and how to invoke it on the blurb that appears over the empty buffer when opening Vim. That way it's discoverable in the same way without actually getting in your way.

→ More replies (1)

2

u/heehawmcgraw Aug 06 '22

Maybe the first 10 time so they can be reminded of :q when they forget 3 months later. Or it should just replace the opening page with a font 120 bolded :q

9

u/jothki Aug 07 '22

The worst part of Vim is how it's sometimes inflicted on innocent users who were just trying to carry out a git commit. I'd bet that that makes up at least half of the views for that question.

139

u/[deleted] Aug 06 '22

As someone who has been programming for over 15 years, I honestly fucking hate vim. "Acktually, if you get gud it's so productive" shut the fuck up. People who spent years getting good at that idiotic interface simply don't want to let go.

55

u/heehawmcgraw Aug 06 '22

I learned it in a day and now save enormous amounts of time editing dynamic data sets among countless other things while programming. It's fairly intuitive once you get past the hurr durr memes and actually use it properly. It's just a better text editor than the rest of the options even without customizing it.

→ More replies (46)

38

u/IncognitoErgoCvm Aug 06 '22

Vim is just an editor, not a replacement for your entire IDE. I use vim as the editor in IntelliJ.

14

u/[deleted] Aug 06 '22

I use it for config files and git commit comments and that's it.

→ More replies (1)
→ More replies (3)

32

u/XCapitan_1 Aug 06 '22

Nowadays the neovim experience as good as VS Code, especially thanks to LSP, DAP, and tree sitter. The same can be said about Emacs, which I use (with vim bindings though).

I'm more perplexed by the gravity of opinions in the editor wars after all these years hehe

4

u/Fyren-1131 Aug 06 '22

As far as IDEs go I get that the big ones are probably similar, but moving from one to another you probably will notice some differences that leave you puzzled. Some relate to performance, others in feature richness.

6

u/unicodemonkey Aug 06 '22

vim-like UI falls apart if you are switching between multiple keyboard layouts.
E.g. Cmd+Q works the same regardless of the keyboard layout. ZZ or :wq will not work (or will fuck something up) until you switch back to the Latin-based layout.

7

u/Lich_Hegemon Aug 06 '22

All keybindings that rely on symbols that must use a modifier key to be accessed in other keyboards become useless.

No, I cannot just press [, I need to press Shift + { to get that symbol and you interpret that to mean something entirely different. Turns out I'm actually supposed to know that ´ is the key that I want because it happens to lie in the same position that [ would occupy if I was using a US layout.

8

u/Hopeful_Cat_3227 Aug 06 '22

just run vim in Emacs

6

u/paretoOptimalDev Aug 06 '22

Well... that's just evil!

→ More replies (1)
→ More replies (1)

73

u/Sir__Veillance Aug 06 '22

Yeah I’ve literally never understood it. If I’m doing actual work I’ll use a real IDE with a multitude of extremely useful features and a GUI.

If I’m just trying to edit a file in the console real fast I’ll use Nano because it’s the least frustrating.

7

u/jorgp2 Aug 06 '22

Nano is fucking amazing, too bad it's not always included out of the box.

3

u/Dwedit Aug 06 '22

Midnight Commander's editor is the least frustrating for me. Most resemblance to MS DOS's edit.com.

3

u/PhlegethonAcheron Aug 06 '22

Look into micro, it's like sublime text on the terminal.

→ More replies (28)

19

u/maest Aug 06 '22

"I hate it when other people use tools I don't like/understand".

k

10

u/AdvicePerson Aug 06 '22

Conversely, disparaging a tool that you don't understand is not the flex you think it is.

13

u/Pesthuf Aug 06 '22

Being an expert in Vim makes you amazing at quickly editing text... in ways that are usually pretty irrelevant for code editing.

→ More replies (2)

2

u/a_nobody_really_99 Aug 07 '22

Why are you upset that others enjoy something you do not? They be them using their vim and you be you dude. There are going to be cases where you log into a minimalistic device with a small memory footprint and limited storage and guess what, it has vim and no other editor. You will be glad you knew vi then. Just because someone knows vim doesn’t mean they don’t use other editors. It just means they have an extra tool. It never hurts to to know more.

→ More replies (21)

3

u/lykwydchykyn Aug 07 '22

I used to struggle with severe to moderate cantexitvimitis. Then I asked my doctor about Escapecolon-WQ. With Escapecolon-WQ, I never have to worry about being trapped in vim.

Escapecolon-WQ: be free again.

(Use only as directed. Side effects may include writing blog articles about text editors, hatred of emacs users, hacker-becoming, and sporadic appearance of :wq in word processing documents. Contact your doctor immediately if you have feelings of uninstalling your desktop environment as a terminal condition can result).

→ More replies (1)

9

u/Phinaeus Aug 06 '22

You guys exited vim? I'm still in here

22

u/MpVpRb Aug 06 '22

I used vi in the 70s. It was maddening and frustrating, but it was all there was. Fortunately, editors evolved. Why it still exists today is mystifying. Is it a case of old bad ideas never die?

20

u/TheMaskedHamster Aug 06 '22

The guys who invented vi, and what it inherited from ed, had to come up with ways to let the limited computer keyboard perform a wide range of functions to edit text quickly and efficiently.

Times have changed, but those methods to get things done with the keyboard are still efficient today.

The problem with vi is that there is no gentle slope entry point. People bang their head against it because they don't understand why it works the way it does or how to do what they need to be done--right from the beginning when they need to save and exit. Why would most people feel like giving vi the patience to meet it on its own terms when they feel that it shot them in the foot on their first meeting?

But that doesn't change what it can do. I use VS Code today, because I want everything a modern UI can give me... but I use a vim plugin so that I can still edit text efficiently. I've even reduced massive jobs at work by installing a web browser plugin so I could use vim commands to edit text in web forms.

It is not everyone's cup of tea... but it can do some things very well.

13

u/Fyren-1131 Aug 06 '22

Can you give some examples of what kinds of text editing jobs you cannot do using an IDE or a more lightweight text editor?

→ More replies (27)

3

u/unicodemonkey Aug 06 '22

These guys also likely didnt't care about multiple input languages and the problem remains unsolved in vim to this day.

→ More replies (2)
→ More replies (2)
→ More replies (1)

13

u/[deleted] Aug 06 '22 edited Aug 06 '22

Vim made me rethink the way I do file edition and work. I wasn't into TUI before this but now I think about how I could make a good TUI alternative to the bloated GUIs out there

8

u/Lich_Hegemon Aug 06 '22

It's a tradeoff, TUIs are better for experienced users because they are uncluttered. Everything is hidden behind keystrokes and commands. At the same time they are worse for beginners... because everything is hidden behind keystrokes and commands.

GUIs have the opposite problem. Experienced users are punished because they have a bunch of stuff they either don't need to use because they already know the bindings, or that they have to put up with because they need to navigate to the right button. But beginners can quite literally see all that's available to them right from the start, so they can try and learn.

New tools like Sublime and VSCode try to strike a middle ground with the command palette, and it mostly works. It allows users to access all the functionality of the software without needing to lift their fingers from the keyboard.

→ More replies (1)

4

u/heehawmcgraw Aug 06 '22

Terminal dweller UNITE

10

u/Beastintheomlet Aug 06 '22

I’m pretty new to programming but I’d always heard how faster you can do stuff in the command line and always thought it was maybe a little faster… turns out I can type a file path and move,copy,delete and open stuff much quicker than dragging the cursor around. It’s addictive once you get used to TUI for stuff.

4

u/EpiphanyMoments Aug 06 '22

I use nano instead

4

u/[deleted] Aug 06 '22

"Steep learning curve" if you want to deploy all the commands. But pretty easy and straightforward after doing vimtutor for a couple of hours. The more I use vim (it's been more than 20 years now) the more I love it, which also makes that learning curve less daunting.

6

u/jazzmester Aug 06 '22

I hate that question, it's so simple. :wqa\nWe call on our Lord of Damnation, Baphomet. ⬆⬆⬇⬇⬅➡⬅➡🅱🅰 I don't get what's the problem here.

Or alternatively, ^Zbg\nkill %1\n

5

u/arcticfox Aug 07 '22

I've been running vim for 30 years...

but that's only because I can't figure out how to quit.

2

u/boobsbr Aug 06 '22

How do I exit ed?

0

u/[deleted] Aug 06 '22

[deleted]

3

u/boobsbr Aug 07 '22

ed will not corrupt your precious bodily fluids!

2

u/macchiato_kubideh Aug 06 '22

In 2009 I was on my first job in an old school IT company and I was working on a tv set top box. It has no really ui, they had just showed me how to use a command line with it. I was about 19 and too scared to ask anyone anything. Every time I was stuck in Vim I would just restart the whole set top box.

2

u/mrpogues Aug 07 '22

about 25 years ago I started work on a system built on SunOS. As part of that I needed to use vi (and learn it which has been well worth it).

On one system I logged in to the EDITOR was set to console emacs. Now that is a programme where you have to ask - how do i exit! I have never understood why vi gets this question and emacs does not (that I have seen)

→ More replies (1)

2

u/whyqaz Aug 08 '22

Im trying Spacevim
So far so good

2

u/TaroEld Aug 08 '22

Vim sounds like playing Dwarf Fortress. At first, it's a complete chore, you have to look up every key in every new submenu. After a while though, you just bang out commands really quickly and it's quite satisfying.

4

u/kaolinsoftware Aug 06 '22

I don't see what the problem is. You just write a script that uninstall and reinstall a it whenever you want to close it. 🤣🤣🤣🤣

3

u/CAM1998 Aug 07 '22

Best text editor of all time.

3

u/CarlRJ Aug 06 '22

The real question is, why on earth would you ever want to exit the greatest text editor ever? All hail vi! And its descendent Vim!

2

u/vim_all_day Aug 06 '22

Don't know why anyone would ever exit Vim. Just leave it open in a tmux session all day.

3

u/[deleted] Aug 07 '22

Someday I'll learn tmux. I still use screen out of force of habit.

2

u/Mister_Pibbs Aug 06 '22

Lol the funny part is it’s not difficult to remember when you’re done. But honestly vim to me just has way too much to remember getting started.

This message was brought to you by Nano. The superior editor.

2

u/llynglas Aug 06 '22

Why is <esc> : wq so difficult? It's so much easier than meta-shift-ctl atl-alt-x which is probably the equivalent on emacs (I have no idea as my eyes glaze after the first meta-shift or two)

3

u/nullmove Aug 06 '22

In Emacs keybindings are a loose alias to a descriptively named elisp function. So you can just type exit, and fuzzy matcher UI will show you the filtered candidates of commands.

...Except of course, it's not actually called exit-emacs or quit-emacs rather kill-emacs, so yeah :/

2

u/billcraig7 Aug 06 '22

EMACS is the true way.

3

u/TheOriginalSamBell Aug 06 '22

You'd still need a text editor though ¯_(ツ)_/¯

4

u/[deleted] Aug 06 '22

EMACS = Esc-Meta-Alt-Ctrl-Shift, each of which has 36 characters to perform a command. And that’s not counting hit more than one at a time or sequences.

→ More replies (1)
→ More replies (1)

1

u/Zylonite134 Aug 06 '22

Pico was the one for me

1

u/ryosen Aug 06 '22

Steep learning curve?

1

u/zetaconvex Aug 06 '22

Legend has it that he still has his vim session open.

1

u/seanluke Aug 06 '22

Oh, so that's how you exit vim.

1

u/ITriedLightningTendr Aug 06 '22

:q \o/

I had to use EMACs when working for Configura and their C++ fork.

Was cool but they literally, in the office, have a like 2 page single sheet printout of all their shortcuts.

1

u/jbrains Aug 06 '22

Kakoune. It is so nice. Vim, but nicer.

1

u/tigershark37 Aug 06 '22

Never, EVER press CTRL+S out of habit. In case you are so foolish to do it the only way out from killing yourself is CTRL+Q.

1

u/dadofbimbim Aug 07 '22

The good ol’ Stackoverflow days where everyone is not hostile.

1

u/RICHUNCLEPENNYBAGS Aug 07 '22

This would never happen in emacs

1

u/[deleted] Aug 07 '22

easy, just reboot your computer

1

u/ojebojie Aug 07 '22

I mean... I worked for 2 years in a company that only had Red Hat console (no UI),perl and VIM for a system that managed billions of dollars. It was not intuitive, but not really troublesome. I am now in a company where windows+Notepad++ and many IDEs are the norm. It's good, more intuitive, but the amount of work it takes when you need to do something just a bit different from the normal flow is frustrating.

→ More replies (1)

1

u/AgentOrange96 Aug 07 '22

:q is the only vim command I know tbh. I'm a total nano pleb.

1

u/TheNiXXeD Aug 07 '22

I want a VIM designed with better UX and modern hotkeys. I think the closest I've found was micro but it's not quite what I mean.

→ More replies (1)

1

u/PinBot1138 Aug 07 '22

How do I exit Vim?

Buy a new computer.

1

u/sirmasterdeck Aug 07 '22

My colleague uses vim exclusively. He says it’s because he doesn’t have the fine motor control required to use a mouse.

1

u/[deleted] Aug 07 '22

I know people make fun of vim, but how many non-emacs users know how to exit emacs?

1

u/artanis00 Aug 07 '22

leaves new users confused where to start

Nah man, I know how to start Vim. It's stopping it that's the problem.

1

u/[deleted] Aug 07 '22

Why would they ask that question?

Just unplug the computer !!!

2

u/Pflastersteinmetz Aug 07 '22

I did that the first time to leave VIM :o

1

u/Sensitive_Bug7299 Aug 07 '22

Vim is like an IDE but for grandpas, thats all I know, I will leave myself out now…

1

u/[deleted] Aug 07 '22

1

u/dgriffith Aug 07 '22

One does not simply, "exit Vim".

1

u/[deleted] Aug 07 '22

Ha! I didn't need this!

I just used Vim to develop new interfaces for all my apps, so I never have to exit Vim.

On a side note - I can't remember if my screen supports any colours other than black and white

1

u/zrvwls Aug 07 '22

Does anyone know any interactive exercises that scale up in difficulty and variability that you can do to get better at it over a week? Looking to eventually cutover to using it in vscode but want a regimented learning tool besides the tutorial. I found these but don't know if any are good

https://www.openvim.com/

https://vim-adventures.com/

http://www.vimgenius.com/

1

u/jabbalaci Aug 07 '22

new users confused where to start

$ vimtutor

That's it.

1

u/blipman17 Aug 07 '22

Yesterday the q key on my keyboard died and I didn't know how to exit vim on my laptop.

→ More replies (1)

1

u/motownmods Aug 07 '22

My first experience with vim was on an old arduino console back in 2014ish and I couldn't wrap my head around why it was so difficult

1

u/agnas Aug 07 '22

vim was the first editor I learn to use so for me was easy because I had no terms of comparison.

1

u/z-lf Aug 07 '22

TIL you can exit with ZQ. What a day.

→ More replies (1)

1

u/[deleted] Aug 07 '22

It is like the song Hotel California, with vim:

"you can never leave!".

That part of the song fits vim too!

1

u/pornAndMusicAccount Aug 07 '22

How do you make a perfectly secure password? Have a new vim user try to figure out how to exit the program.

1

u/bartturner Aug 08 '22 edited Aug 08 '22

Investments with tech skills is something that normally is not a long term thing. You look for a shorter time horizon.

But for me there has been three HUGE investments I have made that have really, really paid off and we are talking that they have paid off for over 20 years now.

First was learning Vim over 25 years ago. Huge learning curve but so worth it. I push my kids to learn it in 2022 as it will pay off.

The second one was writing three TCP/IP stacks starting in the late 80s. The first without Comer. I wrote the first one in 1987 which is now 35 years ago!!! We had a Vax and no TCP/IP. So I wrote a user space stack.

At the time I was doing a lot of LAT, DecNet and X25 development. I just knew they would all go away. So glad I made the investment.

The second was to get around the cost of a SliP connection versus a foreign terminal. This was a long time ago. But ISPs use to charge a different rate for a foreign terminal versus an actual IP connection. SO I made it so you got IP for the cost of a foreign terminal account.

I only did SLiP and no PPP as that was a lot more difficult.

The third was the best one and also involved writing a little kernel on a box that we also built based on the 8086 chip. It was a device that talked SNMP and was used to interface with UPSs. We sold the device to all the major UPS providers at the time.

The third one was learning GNU/Linux internals and this was before the V1 kernel. I started in late 1991. This one has also really paid off.

1

u/Databehandling Aug 22 '22

:set number

That's my favorite.