266 points · by 3001 · 6y ago · 159 comments
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.
You can even set it as your default editor via an environment variable and it'll get automatically invoked as needed by git, etc.
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
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".
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
I originally never wanted to use Vim but had to use it often at work (especially in the server room), so I got used to mechanically entering and exiting insert mode as many people do. That was the extent of my knowledge, but then during a slow period at work I took the time to learn Vim thoroughly by reading "Learning the vi and Vim Editors" from O'Reilly. It changed my view of VI and Vim to the point that (as I had said) I now think of them as command-based editors rather than modal editors. Once you realize that each key press is a command in a very terse language, you can see the power and expressiveness of the language, but it takes some practice and time to build up your intuition.
For example, I often find myself typing something like "79a-ESC" or "79i-ESC" to put in a horizontal rule in text or Markdown documents. To somebody thinking modally this command makes little sense, since I leave insert mode immediately after typing a single character! But from a command language perspective it makes total sense, since I merely instruct Vim to append 79 dashes to the current line. Once you see that it's a language, you stay in command "mode" much more, since that is where the power is.
Disclaimer: vi/vim user for 30+ years.
Then recently I've come to appreciate how well Vim composes with "it's just text" Unix tools and how being able to filter things to tabularise or sort your code is almost magic. All while keeping your edit history and not requiring any plugins.
It goes deep, but in a good way.
I guess what's also good is you can get a lot of value without having to go that deep
Totally maintainable /s
I decided anything so utterly unintuitive wasn't worth my time and stuck with nano ever since, quite happily I have to say.
All the others are unfriendly in comparison, including nano.
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.
... that you can't even reboot.
?
exit
?
quit
?
bye
?
^[
?
HELP!
? trap 'echo -e "\n?"' INT; while true; do read; echo "?"; doneBut, 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.I think quitting EDLIN was Q.
Now vim clutch, on the other hand, is the kind of innovation that saves vim enthusiasts valuable milliseconds... https://github.com/alevchuk/vim-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.
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.
Makes life much easier.
:q!^Msudo find / -name "vim" -O -name "vi" -exec rm -f {} \;
A USB hub?
```
: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"
```
> ...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.
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.
"How do you generate a random string? Put a first-year computer science student in Vim and ask them to save and exit."
A huge percentage of git repositories have a :q! (or similar) file in their root directory.
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...
type :q<Enter> to exitIronically you might have learned about it sooner by using Emacs more, because then you'd be more likely to use the ctrl-v Emacs hotkey for scrolling down fast (which also works in less) and mispress it.
*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 :).Some say vim was created to give us an excuse to hit <Esc> over and over again.
Or they might have been working on a file for hours before they want to quit it, so might not remember.
Or, they might not know how to enter :q. Entering it requires them to be in the right mode.
(I say this as someone who's used Vim for a number of years).
I doubt Vim killer save the file for you either.
Its 'ZZ', kid. Or ":q!" if you don't wanna save your mods ..
to Exit:
type <ESC>
type :q!<Enter>I guess there's a reason why it's not around on modern systems anymore^^
apt-get install cream
takes care of most initial pain.
"Right tool for the job."
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)
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