mirror of
https://github.com/hakluke/how-to-exit-vim.git
synced 2025-05-01 11:17:12 +02:00
Add "The chaotic neutral python wizard's way"
Because everything you've ever written in python can be one line :)
This commit is contained in:
parent
58e647a30c
commit
54d167e9dd
1 changed files with 8 additions and 0 deletions
|
@ -41,6 +41,14 @@ Credit: @hakluke
|
||||||
('utf-8')),signal.SIGTERM)
|
('utf-8')),signal.SIGTERM)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## The chaotic neutral python wizard's way
|
||||||
|
Credit: @Red-M
|
||||||
|
|
||||||
|
```python
|
||||||
|
:py3 __import__('os').kill(int(__import__('subprocess').check_output(["pidof","vim"]).decode
|
||||||
|
('utf-8')),__import__('signal').SIGTERM)
|
||||||
|
```
|
||||||
|
|
||||||
## The pure perl way
|
## The pure perl way
|
||||||
```perl
|
```perl
|
||||||
:!perl -e 'while(</proc/*>){open($f, "$_/cmdline"); kill 9, substr($_,6) if <$f> =~ m|^vim\x00| }'
|
:!perl -e 'while(</proc/*>){open($f, "$_/cmdline"); kill 9, substr($_,6) if <$f> =~ m|^vim\x00| }'
|
||||||
|
|
Loading…
Add table
Reference in a new issue