mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-02 11:46:16 +02:00
Merge pull request #15 from dbalatero/dbalatero-osascript
Add AppleScript way of exiting terminal Vim
This commit is contained in:
commit
d884b2ebcf
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