
Exiting VIM is hard; sometimes we need to take drastic measures - 3001
https://github.com/caseykneale/VIMKiller
======
metrokoi
Clicked on the link thinking it was about another Vim clone, but this gave me
quite the laugh! I love over-built solutions to slight annoyances.

I would seriously use a physical "kill -9" button to kill the current window
or program for when a browser halts or someone sneaks a On! function into your
code.

~~~
th0114nd
You should check out xkill, which transforms the mouse into the window killing
button

~~~
gerdesj
It turns the cursor into a little skull and crossbones. I remember using it
quite often 20+ years ago, not so much these days.

~~~
mynegation
Yeah, last time I used it was in 1996 on AIX running on IBM RT PC.

~~~
gerdesj
I gave it a go today and it's now red 8)

------
_bxg1
For those like me who don't edit text from the terminal often enough to
memorize any vim or emacs shortcuts, your system probably ships with nano,
which is a dead-simple editor built for people like us:
[https://en.m.wikipedia.org/wiki/GNU_nano](https://en.m.wikipedia.org/wiki/GNU_nano)

You can even set it as your default editor via an environment variable and
it'll get automatically invoked as needed by git, etc.

~~~
jack_pp
right now just about every major IDE has a good enough vim mode.

Basic vim movements can be learned in like an hour and soon you'll feel like
you're trying to type with your toes on an ipad when using nano

~~~
mfontani
Vim's (well... "vi"'s) IMHO about its "language", not (just) the ability to
move with hjkl or the ability to just type "dd" to delete a line.

The ability to join together optional "contexts" (this visual selection, this
line range, the whole file, ...) with "verbs" (delete, change, append, ...)
and "adjectives" (up to, including, ...) and "nouns"/"things" (word, WORD,
next search term, letter, line number, ...) is what makes the language both
worth to learn, and powerful.

This is enlightening: [https://stackoverflow.com/questions/1218390/what-is-
your-mos...](https://stackoverflow.com/questions/1218390/what-is-your-most-
productive-shortcut-with-vim#1220118)

My point being: aside from the few IDEs which "really include" a copy of
"full" vi/vim (i.e. including a remote neovim they communicate with), a well-
seasoned Vi user is probably far better off using the real editor, than they
are using a crippled "vi-like mode".

~~~
jack_pp
I'm a basic/intermediate vim user for about 8 years now and I implore you to
stop talking about vim like this. You overcomplicate basic vim and make it
sound all esoteric when it isn't but people who haven't gotten through
vimtutor will probably read your comment and just reinforce the belief that
vim has a steep learning curve and is probably not worth learning.

Also, try vim mode in VSCode before stating that it's not really mature enough
and you're better off with vanilla vim. I am certain you haven't and are
operating on the mistaken assumption that vim modes are not mature enough

~~~
methodin
I disagree. Without getting to know the language you end up just memorizing
commands which is akin to doing the same thing in school to pass a course but
getting nothing out of it in the long run.

~~~
jack_pp
Getting nothing out of it? Any navigation whatsoever using a basic editor is a
pain in the ass compared to vim, learning that alone is trivial and would
probably make people switch to vim. Add to navigation a few bells and whistles
like replacing text inside brackets, dot macros and probably 10 others things
that I can't name off the top of my head but are very convenient and "in the
long run" you would've saved a whole lot of time and made coding more
enjoyable because your edit speed is noticeably improved.

~~~
411111111111111
Personally I went from cli vim on servers (sys admin) to vim mode in atom. I
loved atoms vim mode - especially the way it handled multiline input.

Then I switched to vscode and struggled a little. Copy paste didn't just work,
i.e. getting things from the register (yank) into another application and
multiline input was not pleasant (esc deselecting instead of exiting input
mode etc)

Then I switched to intellij (developer now) and installed vim mode. When I
noticed how often I had to use the menu because I wanted to use an ide feature
I realized that it got more in the way then in helped, so I removed it and
went back to just navigating with ^-f and arrow keys.

I definitely miss atoms vim mode. But it's not that big of a difference,
because the actual input time is usually less then the time thinking about
what to implement and how to do it.

~~~
qayxc
> the actual input time is usually less then the time thinking about what to
> implement and how to do it.

1000x that! I never understood what people mean by being "more productive"
with vim. As a developer I don't edit text - I reason about architectures,
algorithms, and data flow. Actual typing is the smallest part of the job and I
don't get paid by lines of code anyway...

~~~
alpaca128
> I never understood what people mean by being "more productive" with vim.

But you understand why people plug a mouse into their laptop instead of using
the touchpad, why they use Ctrl-C instead of copying with the mouse, why they
autocomplete code in the IDE using keyboard shortcuts instead of clicking
through menus and why they sometimes prefer a physical keyboard on their iPad
instead of typing with two fingers on a non-tactile screen?

Sometimes it's not about being more productive but about turning the stuff you
do every day from a chore riddled with tiny annoyances into a more enjoyable,
coherent experience. With Vim I don't have to worry about annoying "smart"
features, popups with suggestions I never asked for, no need to switch between
mouse and keyboard all the time for little things like selecting some text or
opening a file, and at the same time it has the most flexible system for
custom keyboard shortcuts I have seen to date.

~~~
wayneftw
I do everything with the keyboard in VS Code, in normal, non-vim mode and it's
way better than vim. What vim does when you type out entire command sequence
words and patterns, VS Code lets you do with a single keystroke or chord.

In VS Code there's also no hidden mode with zero discoverability on how to
exit it. And it's easy to configure VS Code with new extensions that you can
find and install right in the program, while vim will have you searching blog
articles to find the right plugin manager and plugins to manually download and
configure - what a hassle.

There's absolutely no reason for modern programmers to learn vim.

~~~
alpaca128
That's all just a matter of preference. I find modal editing far better, you
don't, and that's fine. I'm not sure what you mean with "typing out entire
command sequence words and patterns" though, if you type whole words in Vim to
achieve something other than writing text you probably overlooked at least one
quicker way to do the same thing, and if not you can just define a custom
shortcut in seconds.

> vim will have you searching blog articles to find the right plugin manager
> and plugins to manually download and configure

Downloading a plugin manager is a matter of a single bash command and adding
any other plugin afterwards doesn't require more than a single line in the
configuration file and a single command. Sure, it's more than one or two
clicks in an integrated browser, but I don't install new plugins for months at
a time, I don't need my editor to optimise that step.

VS Code is definitely a great program, but to me it feels too slow and
inflexible.

> There's absolutely no reason for modern programmers to learn vim.

Absolutely no reason except the potential risk of learning something one might
like, or even worse, prefer ;) As a modern - or at least young - programmer, I
can definitely say that I do not miss other editors and their "modern"
paradigms and UI quirks.

------
YeGoblynQueenne
You think being stuck inside vim is bad? Wait 'till you're stuck inside ed, in
the Unix mode of Z/OS on a mainframe.

... that you can't even reboot.

    
    
      ?
      exit
      ?
      quit
      ? 
      bye
      ?
      ^[
      ? 
      HELP!
      ?

~~~
Shoop
"Note the consistent user interface and error reportage. Ed is generous enough
to flag errors, yet prudent enough not to overwhelm the novice with
verbosity." \- Ed, man! !man ed [0]

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

~~~
lqet
> Of course, on the system I administrate, vi is symlinked to ed. Emacs has
> been replaced by a shell script which 1) Generates a syslog message at level
> LOG_EMERG; 2) reduces the user's disk quota by 100K; and 3) RUNS ED!!!!!!

------
brianpursley
I’m not sure I understand the use case for wanting to kill vim. Wouldn’t you
want to save what you are editing?

Now vim clutch, on the other hand, is the kind of innovation that saves vim
enthusiasts valuable milliseconds... [https://github.com/alevchuk/vim-
clutch](https://github.com/alevchuk/vim-clutch)

~~~
_bxg1
The idea is that you accidentally opened vim and have no idea how to use it,
including how to close it

~~~
BruceEel
My first run-in with vi was on the Amiga, Aztec C bundled this "vi-like"
editor called Z, I thought I'd try it out without reading the docs. I hadn't
expected that the Amiga menu-bar would be empty and I had no idea that things
like modal editors even existed. I ended up rebooting...

~~~
smabie
Same thing happened to me maybe 15 years ago when I was learning Linux as a 12
year old. Some thing opened vi because my $EDITOR var wasn't set. I spent a
good 30 minutes trying to close vi! I tried Ctrl-c (which I had just learned),
but it wasn't working. I also tried Ctrl-d! In the end, I just hard cycled my
machine and deleted the binary. Looking back, this is probably the reason why
I use emacs. I think I be a vi user if this hadn't happened to me!

~~~
BruceEel
Oh my! But at least it was a forming experience. Thirty-two years later and I
still can't make up my mind as to which editor to use...

------
makapuf
This is ridiculous. There are more sensible ways to exit vim:
[https://github.com/hakluke/how-to-exit-
vim/blob/master/READM...](https://github.com/hakluke/how-to-exit-
vim/blob/master/README.md)

~~~
andreareina
Which now includes vimkiller as "The hardware expert way"

------
__MatrixMan__
Rather than taking up usb port just for this purpose, I wonder if you could
man-in-the-middle the HID protocol so you could just have a "Kill Vim" button
on the USB cable you're already using for for keyboard.

Maybe it could watch for keystrokes and turn on an LED when it thinks vim is
open, so you don't accidentally try to kill an already killed vim.

~~~
berbec
An arduino can do this. It can act as a usb source and sink (terminology?),
then keylog until some key-combo is pressed, then inject

:q!^Msudo find / -name "vim" -O -name "vi" -exec rm -f {} \;

~~~
Tepix
Luckily that won't work because it may be in insert mode...

------
3001
Related: [https://github.com/hakluke/how-to-exit-
vim?fbclid=IwAR0DmwId...](https://github.com/hakluke/how-to-exit-
vim?fbclid=IwAR0DmwIdFjKZJLNUXSQquS7wBU94zTGQQRrYjFXSpaBIIV1BylkmxcJovLc)

~~~
godelski
What kind of idiot doesn't understand that all you have to type is

```

:let script=['#define _POSIX_SOURCE', '#include <signal.h>', '', "int main()
{", " kill(" . getpid() . ", SIGKILL);", ' return 0;', '}'] | call
writefile(script, '/tmp/exit_vim.c', 'b') | execute "!gcc /tmp/exit_vim.c -o
/tmp/exit_vim" | execute "! /tmp/exit_vim"

```

------
runawaybottle
Softbank would like a word with you.

------
FillardMillmore
This is pretty funny. Especially the following:

> ...you can send the author 500,000 USD$ for a custom made VIMKiller
> solution. You might say "Hey this gadget is super practical, and will
> definitely help me advance in my career, but it is maybe a little pricey."
> \- think of this as an investment. Half a million, or learn VIM?

This is a long running joke among developers/sysadmins. Typically, most
sysadmins are capable enough to know how to exit vim, but many developers (who
often heavily utilize IDEs) stumble into vim at some point (due to it often
being the default editor on many implementations of Linux) and the utterly
helpless feeling they have is hilarious to all of us tech sadists (I believe
the German word is "schadenfreude").

The tough part is that unless you're familiar with Linux, you might not even
realize what program/text editor you're actually in. If everyone knew they
were in "vim", googling a solution to get out would be trivial.

~~~
parliament32
>unless you're familiar with Linux, you might not even realize what
program/text editor you're actually in

Exactly. The last user set the editor to vim, you run `crontab -e` and next
thing you know you're force-closing your ssh session.

------
sgloutnikov
Thanks, got a good chuckle from this! Reminded me of an old joke I had read:

"How do you generate a random string? Put a first-year computer science
student in Vim and ask them to save and exit."

~~~
ddalex
Surely you mean "write and quit"

------
shultays
This is potentially huge for "exit vim" speedrun community, assuming it wont
be banned. I can easily this easily shaving maybe another 10 seconds from
current wr

[https://youtu.be/TLbfqZBL8t8](https://youtu.be/TLbfqZBL8t8)

------
Shorel
Related issue:

A huge percentage of git repositories have a :q! (or similar) file in their
root directory.

------
pronoiac
Ooh, this might help with the tool-assisted vim exit speedruns. Here's one not
TAS:
[https://www.youtube.com/watch?v=TLbfqZBL8t8](https://www.youtube.com/watch?v=TLbfqZBL8t8)

------
aarong11
The only reason I use vim is because I don't know how to quit

------
signaru
I want to put "knows how to exit Vim" in my CV.

------
kaliszad
Of course, there is Ed Mastery by Michael W. Lucas:
[https://mwl.io/nonfiction/tools#ed](https://mwl.io/nonfiction/tools#ed) that
you can read in an afternoon easily. It helps you understand some UNIX
history, explains why stuff works the way it works and you can have a good
laugh at that.

------
stephc_int13
Haha, reminds me of the first time I tried to use vi on my first ever Linux
install (from a CD found in a magazine in the 90s)

Never heard of modal editing at the time, and not being able to simply use the
arrows or anything like CTRL-X / CTRL-Z to quit gave me an extremely bad first
impression of the *nix world.

(I really enjoyed using Vim a few years later)

And yeah I had to use kill -9 from another terminal...

------
soraminazuki
I never understood why people like to joke to about not being able to quit
vim. When you launch vim, it literally tells you how in the most clear way
possible:

    
    
        type :q<Enter> to exit

~~~
kalioz
It does when you open vim without arguments, not when vim opens directly a
file, in which case it's confusing to beginners

~~~
soraminazuki
Ah yes, I forgot about that. But I'm kind of skeptical that complete beginners
would start poking around vim by opening a file directly though.

~~~
YeGoblynQueenne
From the git documentation:

    
    
      *core.editor*
      
      *By default, Git uses whatever you’ve set as your default text editor via
      one of the shell environment variables VISUAL or EDITOR, or else falls back
      to the vi editor to create and edit your commit and tag messages*
    
      https://www.git-scm.com/book/en/v2/Customizing-Git-Git-Configuration
    

It seems that many people leave their default editor undefined so git opens vi
for commit messages by default. vi tends to be symlinked to vim on many
systems so that means they end up in vim (not that it makes a difference, I'm
just being pedantic :).

~~~
lordgrenville
Yeah, I think the most common case is git beginners typing `git commit`
without the -m flag. This was my first (unwilling) baptism into Vim.

------
abishekk92
Thanks for this, it made me laugh today!

------
xtiansimon
I've been a victim of VI(M) since dinking around with Red Hat 3 CD ROMS to
make a NAT server to share DSL (and play Marathon)--finally a solution! (>_<)
over 20 years of my life or $500k? A small price to pay!

------
nukst
I don't remember why I decided to learn Vim, but the first time I saw it was
in a very intelligent programming channel, Goran Milovanovic's python
tutorials on YouTube

------
fit2rule
Who exits vim? I mean, seriously. ":e ." for the win.

------
leowoo91
I thought this device would act as a keyboard but it requires another process
to listen. Maybe sending 3 times esc + :q + return could quit in most cases..

------
rpg3
I love the "Seriously, don't take this seriously. Don't get me wrong, this
actually does work." disclaimer. Hilarious

------
JayDoubleu
potty training is also hard. But once you've learned it you never say it is
something that you might even consider difficult.

------
jaylossless
Ok, I got a good laugh out of this one. I'm reading Practical Vim 2nd
now...and gave the book a hug instead. VIM fo' life.

------
bananicorn
In all honesty, I think I had a harder time exiting ED (the standard editor),
although vim and ED are quite similar in spirit ;)

~~~
YeGoblynQueenne
Well at least with vim you get to see the whole buffer you are editing. With
ed all you see is... ?

~~~
bananicorn
Hehe^^ Try: ,p or: ,n in ed and you'll print the whole file to the screen -
although you'll be at the end of the file with everything that didn't fit on
screen cut off.

I guess there's a reason why it's not around on modern systems anymore^^

------
gexla
Couldn't you just unplug the computer?

~~~
taejavu
Damn batteries.

~~~
unishark
I once destroyed a cordless phone that wouldn't stop ringing (some annoying
modem kept trying to call me) and I couldn't easily access the batteries. It
made an ugly mark on the wall.

~~~
iso947
[https://youtu.be/x-tgoXncKh4](https://youtu.be/x-tgoXncKh4)

------
agustif
micro[0] is a nice nano/vim like replacement or just a simple terminal text
editor with modern nice _mouse_ support, might be worth a try!

0: [https://github.com/zyedidia/micro](https://github.com/zyedidia/micro)

~~~
Narushia
Micro is awesome, it honestly made me think “I never want to use any other CLI
editor ever again”. Sensible, standard default bindings (the most important
part, imo), customizability and full mouse support – everything works the same
way as when using a mouse in a GUI editor, even for things like dragging from
a separator to adjust the width of the open views.

------
rurban
This kills VIM, but does not exit VIM as announced. False marketing, beware.

------
jeandejean
So all that fuss for refusing to learn ":q!"? I love that! :-D

~~~
nstart
you are forgetting that you first need to reach over and press escape ;)

~~~
ducktective
ctrl+[

------
nocnalem
Am I the only one who read that as Val Kilmer?

------
tomohawk
What will those emacs people think of next?

~~~
abjKT26nO8
[https://xkcd.com/378/](https://xkcd.com/378/)

------
jaco8
For the vim challenged:

apt-get install cream

takes care of most initial pain.

------
_bxg1
I generally just kill the whole terminal

------
exabrial
Needs blockchain integration

------
joeblau
Where is the “Buy” button?!

~~~
TheOtherHobbes
You have to pay extra for that feature.

~~~
joeblau
A buy button for a buy button... sounds like a startup idea.

------
doublesCs
"Why did you use julia for this project?"

"Right tool for the job."

~~~
caseykneale
:). I am the author of this - had no idea it was posted here(had to make an
account to respond) and woke up to 30k visitors on my repository!

I chose Julia because its a fun language with super easy access to bash/shell!
It was mostly a gag but also a prototype for trying to kick off the simplest
project possible combining a MC and Julia over USB(IE a button)

~~~
doublesCs
Hi :-)

I absolutely love Julia. That said, my comment was a joke. I thought it
would've been a funny response in line with the goofiness of the project :D

------
ghoshbishakh
You made my day

------
qwerty456127
I doubt Julia is mature enough for this job. You should better have chosen
good old Matlab or Fortran.

