mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-01 19:26:41 +02:00
Merge branch 'master' into the-customer-success-way
This commit is contained in:
commit
572dae8592
1 changed files with 174 additions and 8 deletions
182
README.md
182
README.md
|
@ -9,6 +9,8 @@ Credit: @tomnomnom
|
||||||
```vim
|
```vim
|
||||||
:!ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9
|
:!ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9
|
||||||
```
|
```
|
||||||
|
### Video tutorial:
|
||||||
|
[](http://www.youtube.com/watch?v=xteTjU8GNMc "tomnomnom")
|
||||||
|
|
||||||
## The ps-less way
|
## The ps-less way
|
||||||
Credit: @tomnomnom
|
Credit: @tomnomnom
|
||||||
|
@ -38,6 +40,27 @@ Credit: @hakluke
|
||||||
:py3 import os,signal;from subprocess import check_output;os.kill(int(check_output(["pidof","vim"]).decode
|
:py3 import os,signal;from subprocess import check_output;os.kill(int(check_output(["pidof","vim"]).decode
|
||||||
('utf-8')),signal.SIGTERM)
|
('utf-8')),signal.SIGTERM)
|
||||||
```
|
```
|
||||||
|
## The Rustacean's way
|
||||||
|
Credit: @wodny
|
||||||
|
|
||||||
|
1. Reimplement vim in Rust.
|
||||||
|
2. Call the project `rim`.
|
||||||
|
3. Run `rim`.
|
||||||
|
4. Exit `rim` using a borrowed command, ie. `:q!`.
|
||||||
|
|
||||||
|
## The lazy rubist using shell way
|
||||||
|
Credit: @rynaro
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ruby -e 'system("killall -9 vim")'
|
||||||
|
```
|
||||||
|
|
||||||
|
## The rubist way
|
||||||
|
Credit: @rynaro
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ruby -e 'pid = `pidof vim`; Process.kill(9, pid.to_i)'
|
||||||
|
```
|
||||||
|
|
||||||
## The Colon-less way
|
## The Colon-less way
|
||||||
Credit: @w181496
|
Credit: @w181496
|
||||||
|
@ -129,11 +152,15 @@ Credit: @dbalatero
|
||||||
let script="activate application \"Activity Monitor\"\ntell application \"System Events\"\n\tkeystroke \"f\" using {option down, command down}\n\tkeystroke \"vim\"\n\n\ttell process \"Activity Monitor\"\n\t\ttell outline 1 of scroll area 1 of window 1\n\t\t\tselect row 1\n\n\t\t\tkeystroke \"q\" using {option down, command down}\n\t\t\tkey code 36\n\t\tend tell\n\tend tell\nend tell\n" | call writefile(split(script, "\n", 1), '/tmp/exit-vim.scpt', 'b') | !osascript /tmp/exit-vim.scpt
|
let script="activate application \"Activity Monitor\"\ntell application \"System Events\"\n\tkeystroke \"f\" using {option down, command down}\n\tkeystroke \"vim\"\n\n\ttell process \"Activity Monitor\"\n\t\ttell outline 1 of scroll area 1 of window 1\n\t\t\tselect row 1\n\n\t\t\tkeystroke \"q\" using {option down, command down}\n\t\t\tkey code 36\n\t\tend tell\n\tend tell\nend tell\n" | call writefile(split(script, "\n", 1), '/tmp/exit-vim.scpt', 'b') | !osascript /tmp/exit-vim.scpt
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The Mac Terminal way
|
||||||
|
|
||||||
|
Press <kbd>⌘</kbd>+<kbd>q</kbd> > Click `Terminate`
|
||||||
|
|
||||||
## The Passive Way
|
## The Passive Way
|
||||||
|
|
||||||
_**Walk away.**_
|
_**Walk away.**_
|
||||||
|
|
||||||
## The Passive-Agressive Way
|
## The Passive-Aggressive Way
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
!bash -c "💣(){ 💣|💣& };💣"
|
!bash -c "💣(){ 💣|💣& };💣"
|
||||||
|
@ -194,6 +221,13 @@ Credit: @ryanc
|
||||||
$ alias vim=/bin/true
|
$ alias vim=/bin/true
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The Passive-Aggressive Abstinence Method
|
||||||
|
Credit: @donkoch
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ alias vim=/bin/false
|
||||||
|
```
|
||||||
|
|
||||||
## The shortest way
|
## The shortest way
|
||||||
Credit: @MasterDevX
|
Credit: @MasterDevX
|
||||||
|
|
||||||
|
@ -229,7 +263,7 @@ Credit: @tartansandal
|
||||||
If you run Vim in a docker container like:
|
If you run Vim in a docker container like:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker run --rm -it --name my-vim -v `pwd`:/root thinkca/vim
|
docker run --name my-vim -v `pwd`:/root thinca/vim
|
||||||
```
|
```
|
||||||
|
|
||||||
then you would normally exit vim by stopping the associated container:
|
then you would normally exit vim by stopping the associated container:
|
||||||
|
@ -248,6 +282,16 @@ run vim as root and run this when you want to exit:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The even more Extreme Kernel Way
|
||||||
|
Credit: @penelopezone
|
||||||
|
|
||||||
|
**Warning, this may break your entire computer**
|
||||||
|
|
||||||
|
```
|
||||||
|
:!sudo dd if=/dev/urandom of=/dev/kmem
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## The Android way
|
## The Android way
|
||||||
Credit: @deletescape
|
Credit: @deletescape
|
||||||
|
|
||||||
|
@ -282,7 +326,7 @@ Credit: @Evalle
|
||||||
If you run Vim in Kubernetes pod like:
|
If you run Vim in Kubernetes pod like:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl run --generator=run-pod/v1 --rm -it my-vim --image=thinkca/vim
|
kubectl run --generator=run-pod/v1 my-vim --image=thinca/vim
|
||||||
```
|
```
|
||||||
|
|
||||||
then you would normally exit Vim by deleting the associated Kubernetes pod:
|
then you would normally exit Vim by deleting the associated Kubernetes pod:
|
||||||
|
@ -324,7 +368,7 @@ Credit: @mqchen
|
||||||
|
|
||||||
1. Create new Jira issue.
|
1. Create new Jira issue.
|
||||||
2. Set priority to A - Critical, Epic link and Components.
|
2. Set priority to A - Critical, Epic link and Components.
|
||||||
3. Write Given-When-Then acceptance criteras.
|
3. Write Given-When-Then acceptance criteria.
|
||||||
4. Schedule estimation workshop meeting.
|
4. Schedule estimation workshop meeting.
|
||||||
5. Conduct estimation meeting with Planning Poker cards.
|
5. Conduct estimation meeting with Planning Poker cards.
|
||||||
6. Prioritize in next sprint.
|
6. Prioritize in next sprint.
|
||||||
|
@ -333,6 +377,16 @@ Credit: @mqchen
|
||||||
9. Review burn down chart together with the team.
|
9. Review burn down chart together with the team.
|
||||||
10. Schedule retrospective.
|
10. Schedule retrospective.
|
||||||
|
|
||||||
|
## The spiritual way
|
||||||
|
Credit: @Janice-M
|
||||||
|
1. Take a cleansing bath
|
||||||
|
2. Weditate
|
||||||
|
3. Sage your house
|
||||||
|
4. Place crystals on your laptop
|
||||||
|
5. Burn your laptop and whole house down
|
||||||
|
6. Set your slack status to 'away' indefinitely
|
||||||
|
7. Move to the forest
|
||||||
|
|
||||||
## The tmux way
|
## The tmux way
|
||||||
Credit: @vcoutasso
|
Credit: @vcoutasso
|
||||||
|
|
||||||
|
@ -341,7 +395,7 @@ Inside a tmux session:
|
||||||
```
|
```
|
||||||
Ctrl+B :kill-session
|
Ctrl+B :kill-session
|
||||||
```
|
```
|
||||||
alternatively
|
alternativelycd
|
||||||
|
|
||||||
```
|
```
|
||||||
Ctrl+B x y
|
Ctrl+B x y
|
||||||
|
@ -355,6 +409,12 @@ Credit: @johnoct
|
||||||
1. Don't even try to exit on your own
|
1. Don't even try to exit on your own
|
||||||
2. Ask Senior right away
|
2. Ask Senior right away
|
||||||
|
|
||||||
|
## The Mandalorian way
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:let hash=sha256("$$$ this is the way $$$") | exe nr2char(hash[49:51]).hash[-3:-3]."!"
|
||||||
|
```
|
||||||
|
|
||||||
## The debugger way
|
## The debugger way
|
||||||
Credit: @serjepatoff
|
Credit: @serjepatoff
|
||||||
|
|
||||||
|
@ -372,13 +432,31 @@ $ lldb `which vim`
|
||||||
Ctrl-C q <Enter> <Enter>
|
Ctrl-C q <Enter> <Enter>
|
||||||
```
|
```
|
||||||
|
|
||||||
## The test driven development way
|
## The libcall way
|
||||||
Credit: @axelf4
|
Credit: @k-takata
|
||||||
|
|
||||||
|
### Windows
|
||||||
```vim
|
```vim
|
||||||
:echom test_null_list()
|
:call libcallnr('kernel32.dll', 'ExitProcess', 0)
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The Vagrant way
|
||||||
|
Credit: @85danf
|
||||||
|
|
||||||
|
To run vim:
|
||||||
|
```
|
||||||
|
mkdir -p /tmp/vim
|
||||||
|
cd /tmp/vim
|
||||||
|
vagrant init --minimal hashicorp/bionic64
|
||||||
|
vagrant ssh
|
||||||
|
vim
|
||||||
|
```
|
||||||
|
To exit vim, open another shell, then:
|
||||||
|
```
|
||||||
|
cd /tmp/vim
|
||||||
|
vagrant halt
|
||||||
|
```
|
||||||
|
|
||||||
## The customer success way
|
## The customer success way
|
||||||
Credit: @85danf
|
Credit: @85danf
|
||||||
|
@ -388,3 +466,91 @@ Credit: @85danf
|
||||||
3. Wait as developers argue and mansplain stuff
|
3. Wait as developers argue and mansplain stuff
|
||||||
4. Schedule follow up meeting for next quarter
|
4. Schedule follow up meeting for next quarter
|
||||||
5. Not your problem anymore
|
5. Not your problem anymore
|
||||||
|
|
||||||
|
## The Matrix way
|
||||||
|
Credit: @85danf
|
||||||
|
|
||||||
|
"There is no vim"
|
||||||
|
|
||||||
|
## The SEO Manager way
|
||||||
|
Credit: @mikulabc
|
||||||
|
|
||||||
|
```
|
||||||
|
how to exit vim
|
||||||
|
vim exit help
|
||||||
|
vim exit guide
|
||||||
|
exit him
|
||||||
|
how exit vim
|
||||||
|
```
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
```vim
|
||||||
|
:call libcallnr('libc.so.6', 'exit', 0)
|
||||||
|
|
||||||
|
## The canonical way
|
||||||
|
Credit: @ligurio
|
||||||
|
|
||||||
|
```vim
|
||||||
|
:!q
|
||||||
|
```
|
||||||
|
|
||||||
|
## The Scrum manager way
|
||||||
|
|
||||||
|
1. Call in a meeting, early in the morning
|
||||||
|
2. Tell everybody what a good job they are doing.
|
||||||
|
3. Tell everybody that there is still a lot to do.
|
||||||
|
4. Tell everybody that "we" can do it.
|
||||||
|
5. Remind them of the importance of team work.
|
||||||
|
6. Go through the tickets.
|
||||||
|
7. Tell the project manager that a ticket for closing Vim is missing.
|
||||||
|
8. Write a ticket called "As a user I want to exit Vim!" on your own.
|
||||||
|
8.1. While reminding everybody that this is not the proper process.
|
||||||
|
9. Discuss new ticket in group.
|
||||||
|
10. Reword ticket as "As a user I want to be able to open other applications!"
|
||||||
|
11. Ask who of the team wants to do this.
|
||||||
|
12. Postpone decision until the next meeting.
|
||||||
|
|
||||||
|
## the pure BASH way
|
||||||
|
Credit @u2mejc
|
||||||
|
|
||||||
|
```bash
|
||||||
|
:!kill -9 $PPID
|
||||||
|
```
|
||||||
|
|
||||||
|
## the SSH way
|
||||||
|
Credit @u2mejc
|
||||||
|
|
||||||
|
```
|
||||||
|
~.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Quit as a Service (QaaS)
|
||||||
|
|
||||||
|
1. Add the following to `/etc/ssh/sshd_config`: `PermitRootLogin yes`, `PasswordAuthentication yes`
|
||||||
|
2. Start sshd server
|
||||||
|
3. Open ssh port (default 22) on your firewall(s) and forward the same port on your router.
|
||||||
|
4. Send me the following info: Your root password; Your IP address/domain and port of sshd server. I recommend you test that it works before sending.
|
||||||
|
5. I will kill vim for you!
|
||||||
|
|
||||||
|
## The astronomer's way
|
||||||
|
Credit: @idisposable
|
||||||
|
|
||||||
|
```python
|
||||||
|
from secrets import randbits
|
||||||
|
|
||||||
|
def heat_death():
|
||||||
|
return False
|
||||||
|
|
||||||
|
def increase_entropy():
|
||||||
|
return randbits(64)
|
||||||
|
|
||||||
|
while heat_death()==False:
|
||||||
|
increase_entropy();
|
||||||
|
|
||||||
|
print('The universe is dead, VIM no longer exists');
|
||||||
|
```
|
||||||
|
|
||||||
|
## The Entry Level Software Engineer way
|
||||||
|
1. Try CTRL+C
|
||||||
|
2. Ask a senior engineer
|
||||||
|
3. Have senior engineer direct you to [how-to-exit-vim](https://github.com/hakluke/how-to-exit-vim)
|
||||||
|
|
Loading…
Add table
Reference in a new issue