Live data from Hacker News

How to Exit Vim

github.com

351–360 of 409 posts

Re: How to Exit Vim

#351
If you use `kill -9` to exit vim, you might find your terminal in a weird state, because they are most likely using the `atexit` function to reset your termios settings to normal, but that doesn't happen if you `kill -9` it.

Re: How to Exit Vim

#352
Favorite vim commands:

yy - yank dd - delete and yank O - insert line above o - insert line below GG - go to bottom of file gg - go to top of file Navigation keys == - auto indent code block v - visual mode :%s/find/replace/g :set paste :set number :set nonumber :q - quit :-p

I <3 vim + tmux + iTerm2 + tmuxinator

Re: How to Exit Vim

#355

- 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.)

I have tried to start using vim so many times and failed. Even this year I thought to start using vim. Daily I open vim once try to do something new with it. Although I don't have much of hope that I will start using it an soon.

Spacevim is very user-friendly. Or at least as close as vim gets.

Re: How to Exit Vim

#356

Earlier quoted context omitted.

That's stupid and elitist. There's no reason to force students to go against IDEs that they're already used to, but also the general method of navigating around a computer which they're probably used to from MS Word etc.

It’s a college class in which students are supposed to learn something new, that seems like a perfect example of a situation where you should be forced to do something outside your comfort zone. I don’t interpret that as the college professor saying this is actually the best way to code, just that forcing students to struggle through it is a learning experience.

[deleted]

Re: How to Exit Vim

#357

One of my Computer Science lecturers had a rule: use Vim for all development for his class whilst on campus, and if caught using any other editor/IDE – or committing any artifacts showing evidence of such – we would lose several percentage points from our final mark for his class. Harsh? Perhaps. But I can’t thank that lecturer enough for that rule. He converted a mostly IDE-wielding class into one that actually appr…

Everything I'm about to say, I say as a Vim/Evil user who avoids IDEs like the plague. I like Vim. I like composing commands on the fly, I like modular editing, I like that I can magically format CSV files with quick macros, and I like jumping around my editor like I'm Spider-Man. Heck, I swapped out my window manager with EXWM and Evil just so I could use Vim-style modular commands everywhere.

But learning Vim isn't related to learning how to program. In that context, it's a pointless distraction.

Be honest -- when was the last time that you or anyone you know had a programming assignment at work and came back to scrum a week later saying, "I'd have finished this, but navigating around my editor just took up too much time?" >95% of programming is going to be bottle-necked by the speed you think, not the speed at which you can edit text.

So it's like forcing all of your students to learn Dvorak, or to submit all their written work in cursive. Undoubtedly a few students will thank you for it at the end of the class because some people do get real value out of learning those skills -- but just as many of them will say you wasted their time, and they'll be right. I write in cursive too; it's an objectively faster, more pleasant way to take handwritten notes. That doesn't mean that learning cursive has anything to do with learning to write books.

To any professors on HN reading this: if you're teaching a programming class, please teach programming. Because if students just wanted to learn something new, or to be forced to struggle with something outside of their comfort zones, there are a lot of cheaper ways than college they could do that.

Even with that goal -- a programming professor can't come up with any outside-the-box assignments more related to their subject than "learn Vim"? I can't fathom that kind of lack of creativity in a field this broad.

Re: How to Exit Vim

#358

Earlier quoted context omitted.

> It’s a college class in which students are supposed to learn something new Unless the central thrust of the course is supposed to be the mechanics of a particular dated editor, the restriction described seems to be a distraction from rather than an aid to what the students are supposed to be learning. It doesn't make any more sense than a social science course where the deliverables for most assignments are essays…

I suspect the rationale is that, depending on the language you're using, some IDEs "help" with coding to the point where they're correcting your mistakes and even writing parts of your code for you. This is pretty much a selling point for everything JetBrains makes, and arguably even Visual Studio Code rubs against the edge of that if you're using a language that's well-supported by IntelliSense. The central thrust o…

I still prefer what they made us do for the test: Write the program on paper.

Re: How to Exit Vim

#360

- 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.)

I have tried to start using vim so many times and failed. Even this year I thought to start using vim. Daily I open vim once try to do something new with it. Although I don't have much of hope that I will start using it an soon.

One day several years ago I found a ~15 year old laptop on the side of the road and wondered what I'd do with it. 300MHz processor, "what's Ethernet?", and I didn't have the little pile of flaky USB Wi-Fi dongles I have now.

And it was only through attempting to actually install from the Slackware CDs I'd burnt several years earlier that I discovered the scratches on them were unfortunately not just decorative scars.

So: gcc, corrupt. g++, corrupt. Python, corrupt. Perl, corrupt. sed, ...not corrupt. grep, also not corrupt.

I love working on little projects. At one point I noticed that installing specific packages quickly and easily wasn't straightforward because I couldn't see what was already installed.

dialog was among the uncorrupted, and I wondered if I might use this to show installed and uninstalled packages side by side.

That was when I discovered the info pages were also intact, and that sed and grep both had excellent info documentation.

Unfortunately I deliberately gave up working on the project after a few days, as I developed headaches from staring at multiple ~5-6 line (ie, ~480 char) monster regexes over the course of a week or so. (Imagine multiple blocks of modem line noise each 2-4 times longer than http://bash.org/?464385 and you're in the ballpark.)

I do plan to finish that script at some point though (when I regain access to that laptop's HDD). It was only 5 sed commands and 4 grep commands...

Post reply on HN