Live data from Hacker News

How to Exit Vim

github.com

121–130 of 409 posts

Re: How to Exit Vim

#121
post #17

I like :x which effectively does an :wq if there have been changes but is one character less.

It also prevents the modification time from being changed after closing the file, if no changes were made.

Re: How to Exit Vim

#122
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 appreciated Vim, and most of us still use it or its key bindings.

Edit: this was in 2018, when VS Code, etc. were already popular.

Re: How to Exit Vim

#124
post #104

Earlier quoted context omitted.

I believe the solution to this lies in using Rust and SIMD. It will achieve both performance and safety.

I would prefer a functional approach and formal verification so we can know for sure it will exit.

Since the real world is not necessarily deterministic as demonstrated by the methods using random(), I hope to see more development in stochastical methods describing parameters of probability distributions of successful exits.

Re: How to Exit Vim

#126
post #23

This one is the shortest way in the list : The test driven development way :echom test_null_list() And it works. Just checked.

Doesn't work for me, just gives an error message "E730: Using List as a String" and returns me to command mode.

Re: How to Exit Vim

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

How do you exit, then, if you never learned :q?

Re: How to Exit Vim

#128

The question is not "How" but "Why" you would want to ever do that in the first place;-) Many years ago I knew a university professor and students said about him he might leave uni occasionally but he sure never leaves Emacs. Some live in Emacs, some live in Vim.

Emacs users live in emacs, but vim users usually live in the terminal, not directly in vim. Good thing there's a terminal version with vim bindings of pretty much every program out there :)

(As I finished writing this, and was about to type ^[fG to submit this reply, I couldn't help but smile a bit)

Re: How to Exit Vim

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

'screen' uses C-a as a prefix shortcut so developers of 'tmux' decided to use the next available key to avoid clash.
Post reply on HN