mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-10 07:27:00 +02:00
Add an x86-64 assembly way
This commit is contained in:
parent
bc9395e0e2
commit
a03a68c0d6
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