Live data from Hacker News

How to Exit Vim

github.com

241–250 of 409 posts

Re: How to Exit Vim

#241
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…

> A similar optimisation was with tmux to bind the prefix to C-z. It's in a handy location next to ctrl and I very rarely use suspend anyway.

I think gnu screen has the right idea here: ctrl-a.

And you say z is close to control - does that mean you use emacs without shift lock as control?! (I mean sure, still closer than b...).

Re: How to Exit Vim

#242
post #161

Earlier quoted context omitted.

Nope. The best thing that can happen to a beginner is they continue being frustrated with vim, quit it before they get in too deep, and just use shitty idees like the rest of us trash.

My first go at vim was an accident. I was using git and ended up there. I later tried to change the editor invoked by git to something else, but have concluded that was dumb and the only real option is to learn vim. It's still on my todo list. As is the actual OSS work I want to contribute after climbing this hill. It should not be this way.

VScode's text editing/ diff/ git tool is really good.

It helps that VScode is also my editor of choice in general.

Re: How to Exit Vim

#244

As the old joke says[1]. ED(1) Unix Programmer's Manual NAME ed - text editor SYNOPSIS ed [ - ] [ -x ] [ name ] DESCRIPTION Ed is the standard text editor. [1] https://www.gnu.org/fun/jokes/ed-msg.html

I've written the following one-liner if ed(1) is unavailable on your system, to emulate its functionality:

    trap 'echo -e "\n?"' INT; while true; do read; echo "?"; done

Re: How to Exit Vim

#245

Earlier quoted context omitted.

Emacs is so dynamic and easily configurable, that people can actually rebind a lot of things when their colleague go to the bathroom as a prank. Just open a scratch file, enter some s-expressions, evaluate them, then kill the buffer.

That's why my scratch buffer is by default NOT in elisp mode

You can evaluate an elisp expression anywhere in any mode.

Re: How to Exit Vim

#246
post #223

Earlier quoted context omitted.

You're only targetting old 1970s terminal users, there, though. If you wanted to also help slightly more modern users who are used to CUA conventions from GUIs, you would have the [F1] key bring up some form of help screen, which said something like "Get out of Vim: Use :qa!" at the top.

You're only targeting old 1990s GUI users there, though. If you wanted to also help silghtly more modern users who are used to discoverable-UI conventions from mobile apps, you would have it so shaking your device brings up some form of chat bot, which would suggest asking it how to quit Vim.

1980s. [F1] is CUA 1987.

And one of these ideas is not like the others.

Clippy, please tell everyone how Lio's and my if-only-VIM-did-this ideas are different to Kerrick's idea.

Re: How to Exit Vim

#247

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…

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.

I’ve seen Java developers completely lost with no idea where to start debugging an installation in a lab environment because they had no IDE, JDK only. Sure, you might argue that it’s an unlikely scenario, but never say never. CS is one of many fields where having a basic understanding of how things work at least a couple of layers of abstraction down is a good thing, and at least could save potential embarrassment.

Re: How to Exit Vim

#248
What about querying how much ram you have and then pasting the letter 'q' that many times plus one into the buffer?

Edit: perhaps to speed it up: start with a single 'q', selecting all, yank, and paste. Just script it to repeat until exit happens. No ram query needed.

Re: How to Exit Vim

#249

Earlier quoted context omitted.

> And of course I'd have to dive deep into the ecosystem in order to get the same benefits that my main editor provides out of the box, To me, vim shines as a modal editor , not an IDE. I use it for two purpose: 1. quick editing configuration files, or single file scripts 2. an editing mode in an IDE (mostly VSCode) The main benefit of vim is to save you from using the mouse or the touch pad. I touch type, my indexes…

My hypothesis is that vim style work (without moving a wrist even a bit) is the reason people get carpel tunnel. I anecdotally see far fewer (none?) People who don't do vim/emacs getting these injuries. Makes sense as well right? Just like "take a walk and don't sit in the same place" but for your fingers

Using Vim has helped my finger/wrist/arm/shoulder/neck pain and soreness, but you're on to something in that the real problem is probably more repetitive motions than any specific motions.

But Vim (and emacs) solves the repetitive motion problem by providing several means of readily repeating commands.

Most people seem to both type and use their mouse much more slowly than I do. And they also don't often have to (or want to), e.g. cleanup thousands of rows in an Excel worksheet, or have to repeat some kind of action in an app or web app dozens of times.

But I hate using my mouse generally. There are very few times where I want to use a mouse and having to use one, instead of being able to use the keyboard, is endlessly frustrating.

Thankfully, there are several great 'vi-style' browser extensions and there's even [Vimac](https://vimacapp.com/) for MacOS, tho I haven't tried the latter yet.

Re: How to Exit Vim

#250
post #241
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…

> A similar optimisation was with tmux to bind the prefix to C-z. It's in a handy location next to ctrl and I very rarely use suspend anyway. I think gnu screen has the right idea here: ctrl-a. And you say z is close to control - does that mean you use emacs without shift lock as control?! (I mean sure, still closer than b...).

Caps lock isn't shift lock though.

I know, because I have triple-shift-press mapped to shift lock on my Ergodox. It's... usually better, but sometimes I type a @#$%@#$% swear word when I mean to enter a number.

Post reply on HN