Merge branch 'master' into master

This commit is contained in:
Luke Stephens (hakluke) 2019-09-27 07:06:41 +10:00 committed by GitHub
commit 808136a352
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,11 +68,19 @@ $ alias vim='timeout 600 vim'
```
Make sure to save regularly.
## The Russian Roulette timeout way
When you want to spice things up a bit:
```
$ timeout $RANDOM vim
```
## The physics way
Credit: @eyemyth
Accumulate a sufficient amount of entropy.
## The reboot way
Credit: @tctovsli
In `vi`:
@ -80,3 +88,19 @@ In `vi`:
:!sudo reboot
```
## The AppleScript way
Credit: @dbalatero
In Mac terminal `vi`:
Replace "iTerm" with your terminal application of choice:
```
:let script="activate application \"iTerm\"\ntell application \"System Events\"\n keystroke \":\"\n keystroke \"q\"\n keystroke \"a\"\n keystroke \"!\"\n key code 36\nend tell" | call writefile(split(script, "\n", 1), '/tmp/exit-vim.scpt', 'b') | !osascript /tmp/exit-vim.scpt
```
# The Mac Activity Monitor way
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
```