mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-04-30 18:57:18 +02:00
Merge 66db6aad54
into 110da1c9df
This commit is contained in:
commit
bd393b763c
1 changed files with 14 additions and 0 deletions
14
README.md
14
README.md
|
@ -857,3 +857,17 @@ 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"
|
||||
```
|
||||
|
||||
## The GDB way
|
||||
|
||||
Credit: @jz543fm
|
||||
|
||||
```bash
|
||||
sudo gdb -p $(pgrep vim)
|
||||
```
|
||||
|
||||
And in gdb use:
|
||||
|
||||
```bash
|
||||
call (int)kill((int)getpid(), 9)
|
||||
```
|
Loading…
Add table
Reference in a new issue