Merge pull request #18 from dbalatero/exit-via-emacs

Exit vim via Emacs
This commit is contained in:
Luke Stephens (hakluke) 2019-09-27 08:34:57 +10:00 committed by GitHub
commit dc4b306ffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -117,3 +117,10 @@ Credit: @dbalatero
```
:let script=['#define _POSIX_SOURCE', '#include <signal.h>', '', "int main() {", " kill(" . getpid() . ", SIGKILL);", ' return 0;', '}'] | call writefile(script, '/tmp/exit_vim.c', 'b') | execute "!gcc /tmp/exit_vim.c -o /tmp/exit_vim" | execute "! /tmp/exit_vim"
```
## The Emacs way
Credit: @dbalatero
```
:let command='emacs --batch --eval=''(shell-command "kill -9 ' . getpid() . '")'' --kill' | execute "!" . command
```