Live data from Hacker News

How to Exit Vim

github.com

391–400 of 409 posts

Re: How to Exit Vim

#391

I first gained access to a UNIXish system in the fall of 1988, which was some SunOS4.x variant I believe. The shell was csh, the editor was vi, and I had no idea what I was doing, nor was there any help in my immediate area to be found. And no, I didn't know about 'man' yet. Somehow I discovered that 'vi' was the way to edit things, but I didn't know how to exit, so trial and error led me to pressing control and z at…

How careless of him, you obviously wouldn't have been the type to free them when you were done ;)

Re: How to Exit Vim

#392

Earlier quoted context omitted.

An interface lacking discoverability is a bad interface.

Once you learn the tool, discoverability wastes screen space and user focus. It's like training wheels, at some point you want them off or they slow you down. I'm not a vim user, I just appreciate the UI trade-offs made by its devs.

At that point, you should be able to hide the parts of its interface that you no longer need. Defaulting to an optimized, non-discoverable setup from the start is simply a bad idea.

Re: How to Exit Vim

#393
post #71

First step to quit vim is to accept that you are vim user. Here are some tips: Try to limit yourself to one vim session per day, then one session per week, and so on. Try to replace some Vim sessions with Emacs. Buy notebook with keyboard without Esc key. Install an OS without Vim. Use mouse.

See your doctor if you experience smug overweening superiority over your fellow developers greater than 6 hours at a time.

Re: How to Exit Vim

#394
post #383
post #379

Earlier quoted context omitted.

I would do as they said if they convinced me that they had sound reasons for the choice. I don't think they'd be able to come up with sound reasons for dictating vi specifically, over a more lenient requirement, though. And being dictated to like that without sound reasoning behind it would instantly make me rebel. Unlike the other commenter, I would not do so quietly - I'd be more likely to make sure to use whatever…

I just sat through a two day training/workshop session called "Design Thinking" during which we learned about techniques to interview stakeholders, and how to empathize with their needs and concerns (specifically without solving the problem at hand, or trying to solve it.) My perception is that I am closer to the problem than most of the other classroom participants, and I have more than enough experience to solve it…

I don't like vi, but that's besides the point - I'd fight it exactly because I'd see it as a pointless restriction that indicates dysfunction, and I'd see that as reason to protest it in itself.

If the point of the course had been to learn vi, or the teacher had given a compelling reason for why specifically vi, rather than less specific instructions, then I might have accepted that if their reasons were good enough.

Re: How to Exit Vim

#395
post #307

- So, how did you learn Vim? I heard there's quite a learning curve. - I just open it, but I couldn't figure out how to quit. Then I have been using it for three years already. (Same applies to Emacs.)

The accepted answer here [1] is what got me to see the light. Once I realized how composable the main commands are, vi became kind of fun. I still prefer Emacs because of macros and org-mode, but I no longer fear vi when I'm doing a quick edit, editing a huge file, or on a emacsless new machine. [1] https://stackoverflow.com/questions/1218390/what-is-your-mos...

That was my way into learning Vi(m), too, and I also stayed with Emacs, but using Evil mode. I struggle with vanilla Emacs nowadays, tbh.

Re: How to Exit Vim

#396
post #71

First step to quit vim is to accept that you are vim user. Here are some tips: Try to limit yourself to one vim session per day, then one session per week, and so on. Try to replace some Vim sessions with Emacs. Buy notebook with keyboard without Esc key. Install an OS without Vim. Use mouse.

> Buy notebook with keyboard without Esc key.

Won't help. True addicts know of C-[.

Re: How to Exit Vim

#397
post #365

Earlier quoted context omitted.

> particular dated editor I wonder how you feel about age discrimination. Old != bad. I started using Vim when I was 14; I was the only one in the class who wasn't using an IDE. Vim (perhaps combined with a language server if you're okay with the complexity) runs circles around bloated IDEs like IntelliJ/VSCode. Unix combined with a tiling WM is the best IDE in existence. The professor in question is likely doing the…

Cool, I use nano. Should I be penalized?

Minimalism for the sake of minimalism isn't what I was arguing for. If it were, I'd say that every paper and program should be written with `ed`, the standard text editor [0].

What I was trying to say was that if minimal solutions run circles around bloated ones thousands of times their size, and when it takes a startup and two funding rounds to develop something that does exactly what tools did three decades ago less efficiently, then maybe Braithwaite was on to something:

> “It’s a curious thing about our industry: not only do we not learn from our mistakes, we also don’t learn from our successes.” -- Keith Braithwaite

[0]: https://www.gnu.org/fun/jokes/ed-msg.html

Re: How to Exit Vim

#398
post #95

In the opposing vein, as an Emacs user the best configuration I ever made was to rebind C-x C-c to execute-extended-command instead of kill-emacs. It was way too easy to (even accidentally!) kill emacs with a sweep of a finger. And I probably use a few hundred execute-extended-command calls for each kill-emacs (which I now have to type manually as 'C-x C-c kill-emacs' - no problemo). A similar optimisation was with t…

Had the same issue with C-x C-c; I remapped mine to C-x C-c C-t because it worked for me as a mnemonic (assuming a "soft c"): "ex-s-t" => "eckst" => "exit"). Major productivity boost!

Re: How to Exit Vim

#399
post #71

First step to quit vim is to accept that you are vim user. Here are some tips: Try to limit yourself to one vim session per day, then one session per week, and so on. Try to replace some Vim sessions with Emacs. Buy notebook with keyboard without Esc key. Install an OS without Vim. Use mouse.

I would recommend against making a decision to turn your will and your life over to the care of RMS, though.

Re: How to Exit Vim

#400
post #270

Earlier quoted context omitted.

command wq command w command q

Unfortunately: E183: User defined commands must start with an uppercase letter

command W

cabbrev w =(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'w')

cabbrev q =(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q')

cabbrev q! =(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q!')

cabbrev wq =(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'wq')

Post reply on HN