Skip to content

Commit 45379ac

Browse files
authored
Merge pull request #272 from Kairixir/patch-2
2 parents c42d9de + 95d971b commit 45379ac

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $ ruby -e 'pid = `pidof vim`; Process.kill(9, pid.to_i)'
8484
Credit: @w181496
8585

8686
In insert mode:
87-
```
87+
```vim
8888
<C-R>=system("ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9")
8989
```
9090

@@ -143,15 +143,15 @@ $ timeout $RANDOM vim
143143
## The Shoot First, Ask Questions Later way
144144
Credit: @aliva
145145

146-
```
146+
```bash
147147
$ ps axuw | awk '{print $2}' | grep -v PID | shuf -n 1 | sudo kill -9
148-
148+
```
149149

150150
## The "all against the odds" Russian Roulette way
151151
Credit: @cfrost
152152

153153
When you want to spice things up a bit more:
154-
```
154+
```vim
155155
:!ps axuw | sort -R | head -1 | awk '{print $2}' | xargs kill -9
156156
```
157157

@@ -261,14 +261,14 @@ Don't run this, it could break your computer.
261261
262262
## The layered Method
263263
Credit: @mashuptwice
264-
```
264+
```vim
265265
:!python -c "import os ; os.system(\"ssh localhost kill -9 $(pgrep vim >tmpfile && grep -P '\d+' tmpfile | sed 's/\(.*\)/\1/g' | cat && rm tmpfile) \")"
266266
```
267267
Bonus: still stuck if multiple vim instances are running
268268
269269
## The epileptic Method
270270
Credit: @mashuptwice
271-
```
271+
```vim
272272
:!timeout 10 yes "Preparing to exit vim. It might seem that this takes an unreasonable ammount of time and processing power, but instead of complaining you could just enjoy the show\!" | lolcat ; pgrep vim | xargs kill -9
273273
```
274274
May the magnificent colors help you to forget the emotional damage caused by exiting vim!
@@ -351,7 +351,7 @@ Credit: @penelopezone
351351
352352
**Warning, this may break your entire computer**
353353
354-
```
354+
```vim
355355
:!sudo dd if=/dev/urandom of=/dev/kmem
356356
```
357357
@@ -513,15 +513,15 @@ Credit: @k-takata
513513
Credit: @85danf
514514
515515
To run vim:
516-
```
516+
```bash
517517
mkdir -p /tmp/vim
518518
cd /tmp/vim
519519
vagrant init --minimal hashicorp/bionic64
520520
vagrant ssh
521521
vim
522522
```
523523
To exit vim, open another shell, then:
524-
```
524+
```bash
525525
cd /tmp/vim
526526
vagrant halt
527527
```
@@ -596,7 +596,7 @@ Credit @u2mejc
596596
```
597597
598598
## The Newbie Way
599-
```
599+
```bash
600600
git commit
601601
```
602602
@@ -691,15 +691,15 @@ Credit: @ccw630
691691
Based on https://www.exploit-db.com/exploits/46973. Works with Vim < 8.1.1365.
692692
693693
1. Create a file (say `quit.txt`) with the following data:
694-
```
694+
```bash
695695
echo ':!killall vim||" vi:fen:fdm=expr:fde=assert_fails("source\!\ \%"):fdl=0:fdt="' > quit.txt
696696
```
697697
2. Ensure that the modeline option has not been disabled.
698-
```
698+
```bash
699699
echo "set modeline" >> .vimrc
700700
```
701701
3. Open `quit.txt`.
702-
```
702+
```vim
703703
:e! quit.txt
704704
```
705705

0 commit comments

Comments
 (0)