mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-06-15 00:51:58 +02:00
Merge pull request #279 from NguyenLe1605/master
Add an x86-64 assembly way
This commit is contained in:
commit
110da1c9df
1 changed files with 11 additions and 1 deletions
12
README.md
12
README.md
|
@ -846,4 +846,14 @@ DELAY 500
|
|||
STRING :q!
|
||||
DELAY 500
|
||||
ENTER
|
||||
```
|
||||
```
|
||||
|
||||
## The linux x86-64 assembly way
|
||||
|
||||
Credit: @NguyenLe1605
|
||||
|
||||
Based on the C way of @dbalatero
|
||||
|
||||
```vim
|
||||
:let script = ['.intel_syntax noprefix', '.global _start', '_start:', 'mov rdi, ' . getpid() . '', 'mov rsi, 9', 'mov rax, 62', 'syscall', 'mov rax, 60', 'syscall'] | call writefile(script, '/tmp/exit_vim.S', 'b') | execute "!gcc -nostdlib /tmp/exit_vim.S -o /tmp/exit_vim" | execute "! /tmp/exit_vim"
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue