Readit News logoReadit News
metrokoi · 6 years ago
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.

badsectoracula · 6 years ago
A few years ago i wrote xkeyller[0] which kills any foreground window (well, the process that owns it) when you press Ctrl+Alt+K. I wrote it partly for games that take over X and then hang themselves and partly as an argument on Reddit towards someone that was saying X cannot do that and you need Wayland for it :-P

[0] http://runtimeterror.com/tools/xkeyller

JNRowe · 6 years ago
Just a heads up: Your "download source" link is for a .tar.bz2, but the file is compressed with xz and not bzip2.
th0114nd · 6 years ago
You should check out xkill, which transforms the mouse into the window killing button
tinus_hn · 6 years ago
That just tells the server to remove the window and break the process. If it’s really stuck it’ll keep spinning in the background.
gerdesj · 6 years ago
It turns the cursor into a little skull and crossbones. I remember using it quite often 20+ years ago, not so much these days.
_bxg1 · 6 years ago
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

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

zem · 6 years ago
I tried switching to nano but my Arduino button no longer worked to exit
politelemon · 6 years ago
For that you'll need an Arduinano
jack_pp · 6 years ago
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 · 6 years ago
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...

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

dageshi · 6 years ago
I base my personal hatred of vim on the first time I encountered it and couldn't escape from it. CTRL C, CTRL Z... nothing worked, I was utterly trapped, I think I may have even had to reboot the system to get out of it.

I decided anything so utterly unintuitive wasn't worth my time and stuck with nano ever since, quite happily I have to say.

craz8 · 6 years ago
Esc, Esc, Esc, colon, q, nano

Works every time, takes less than an hour to learn

Shorel · 6 years ago
Hate me, but I use mcedit for all my SSH editing needs.

All the others are unfriendly in comparison, including nano.

tiborsaas · 6 years ago
I love mcedit too, I mean come on, it has advanced features like undo, what's there to hate?
chaoticmass · 6 years ago
mcedit is my favorite. Fortunately it's really common in most distros now.
Aloha · 6 years ago
I'm also a huge fan of nano, no it's not as powerful as emacs, but I don't need that much power in my text editor frankly.
morganvachon · 6 years ago
As a non-coder I also find nano to be more than enough for 99.9% of my needs at the terminal. It's the first thing I install on a fresh OpenBSD (though sysupgrade(8) has likely made reinstalling that OS moot), and it's my goto for any non-Windows system I maintain.

Back in the early 2000s before I found nano, I used JOE on Slackware and loved it. I discovered nano and learned it, and now if I try to use JOE I find myself turning on its "pico mode" to get back to now-familiar commands.

fomine3 · 6 years ago
I'm very surprised when I realized that nano hadn't support undo/redo until recently (undo Enabled by default around 2016).

Deleted Comment

simion314 · 6 years ago
The issue for me is that sometimes I need to SSH into soem server and maybe check crontab and surprise vim opens, then I need to google again how to exit from vim.
ivanfon · 6 years ago
You can press Ctrl+C and it should give you a message reminding you how to quit.
saagarjha · 6 years ago
Nano supports some line editing Emacs shortcuts!
SomeoneFromCA · 6 years ago
mcedit is way better than nano, IMHO.

Deleted Comment

YeGoblynQueenne · 6 years ago
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 · 6 years ago
"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

lqet · 6 years ago
> 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!!!!!!
rhinoceraptor · 6 years ago
Just in case you're on a system without ed, I've written this one liner to simulate its functionality:

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

kps · 6 years ago
ed is in POSIX, so a system without it is seriously broken.
u801e · 6 years ago
Though ^D does work if you haven't made any changes to the file ;)

But, for those who don't know it already, the way to exit ed is either

  wq
to save the file and exit, or

  Q
to exit without saving.

dirtnugget · 6 years ago
so basically vim, except a capital instead of exclamation mark

Deleted Comment

acheron · 6 years ago
This suddenly reminded me that as a kid I somehow learned how to use EDLIN in MSDOS. Once I got 5.0 with the full-screen EDIT, all knowledge of how to use EDLIN immediately left.

I think quitting EDLIN was Q.

brianpursley · 6 years ago
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

_bxg1 · 6 years ago
The idea is that you accidentally opened vim and have no idea how to use it, including how to close it
BruceEel · 6 years ago
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...
clarry · 6 years ago
Have you used the clutch?

I have a kinesis advantage pro, which came with a footswitch.

I quickly found out that my feet are very clumsy and can't come close to keeping up with my fingers. Also I couldn't find a way place the switch that feels ergonomic and comfortable.

I tried to use the switch again last summer while reading a long kinetic novel but came to the same conclusion: it's very clumsy and just doesn't feel comfortable at all.

makapuf · 6 years ago
This is ridiculous. There are more sensible ways to exit vim: https://github.com/hakluke/how-to-exit-vim/blob/master/READM...
andreareina · 6 years ago
Which now includes vimkiller as "The hardware expert way"
__MatrixMan__ · 6 years ago
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.

maxfan8 · 6 years ago
Awesome idea! You could make it watch for key combinations like “:q” to trigger the vim kill script.

Makes life much easier.

berbec · 6 years ago
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 · 6 years ago
Luckily that won't work because it may be in insert mode...
PascLeRasc · 6 years ago
I'm pretty sure you could. Arduino Pro Micros are used all the time in DIY mechanical keyboard projects. It could just send out :q! on a single button press. No need for a background script or any other prior setup.
steerablesafe · 6 years ago
> I wonder if you could man-in-the-middle the HID protocol.

A USB hub?

3001 · 6 years ago
godelski · 6 years ago
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 · 6 years ago
Softbank would like a word with you.