mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-02 03:36:42 +02:00
The Android ways
This commit is contained in:
parent
e9e429988d
commit
f74522011b
1 changed files with 14 additions and 0 deletions
14
README.md
14
README.md
|
@ -244,3 +244,17 @@ 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 Makefile
|
||||
|
||||
```
|
||||
|
||||
## The Android way
|
||||
Credit: @deletescape
|
||||
|
||||
Close the Termux app.
|
||||
|
||||
## The extreme Android way
|
||||
Credit: @deletescape
|
||||
|
||||
Run vim inside Termux and run this when you want to exit:
|
||||
|
||||
```
|
||||
:!su -c killall zygote
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue