mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-01 19:26:41 +02:00
Add AppleScript way of exiting terminal Vim
This commit is contained in:
parent
3ffe812d18
commit
92b5426fba
1 changed files with 10 additions and 0 deletions
10
README.md
10
README.md
|
@ -75,3 +75,13 @@ 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
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue