diff --git a/README.md b/README.md index 87538e5..47d3b42 100644 --- a/README.md +++ b/README.md @@ -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 +```