From 467545356a8030968f79ffe54073faf0d2e979ba Mon Sep 17 00:00:00 2001 From: nkanaev Date: Wed, 8 Jan 2020 22:00:39 +0000 Subject: [PATCH 1/7] the mac terminal way --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6610bd6..64baa3a 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,10 @@ 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.scpt ``` +## The Mac Terminal way + +Press +q > Click `Terminate` + ## The Passive Way _**Walk away.**_ From 5ef6db601005e1f627ad2c8d16c769c4039747ed Mon Sep 17 00:00:00 2001 From: zethexx <44912409+zethexx@users.noreply.github.com> Date: Thu, 9 Jan 2020 01:50:47 +0000 Subject: [PATCH 2/7] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 6610bd6..265d1ef 100644 --- a/README.md +++ b/README.md @@ -378,3 +378,11 @@ Credit: @axelf4 ```vim :echom test_null_list() ``` + +## I will do it for you (Free service) + +1. Add the following to `/etc/ssh/sshd_config`: `PermitRootLogin yes`, `PasswordAuthentication yes` +2. Start sshd server +3. Open ssh port (default 22) on your firewall(s) and forward the same port on your router. +4. Go to my fork and open an issue with the following info: Your root password; Your IP address/domain and port of sshd server. I recommend you test that it works before step this. +5. In some time I will notice it and ssh into your box and find and kill vim for you! From cde043d6387b22cb26e344d15238533b5757ff37 Mon Sep 17 00:00:00 2001 From: Kabir Kwatra Date: Wed, 8 Jan 2020 18:31:48 -0800 Subject: [PATCH 3/7] Docker and Kubernetes image names and CLI options Image: https://hub.docker.com/r/thinca/vim/ `-it` opens vim in container preventing exit command from being issued. `--rm` kills containers before exit command is issued. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6610bd6..f48e0cb 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ Credit: @tartansandal If you run Vim in a docker container like: ```bash -docker run --rm -it --name my-vim -v `pwd`:/root thinkca/vim +docker run --name my-vim -v `pwd`:/root thinca/vim ``` then you would normally exit vim by stopping the associated container: @@ -282,7 +282,7 @@ Credit: @Evalle If you run Vim in Kubernetes pod like: ```bash -kubectl run --generator=run-pod/v1 --rm -it my-vim --image=thinkca/vim +kubectl run --generator=run-pod/v1 my-vim --image=thinca/vim ``` then you would normally exit Vim by deleting the associated Kubernetes pod: From 46a0abb4acfc17bede58755897412b93f65332bd Mon Sep 17 00:00:00 2001 From: mattn Date: Thu, 9 Jan 2020 13:58:43 +0900 Subject: [PATCH 4/7] Update README.md Does not work anymore. https://github.com/vim/vim/commit/9db2afe46d3208775d1c3075bbee073a17f8fdc6 --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 6610bd6..d5d735f 100644 --- a/README.md +++ b/README.md @@ -371,10 +371,3 @@ $ lldb `which vim` (lldb) r Ctrl-C q ``` - -## The test driven development way -Credit: @axelf4 - -```vim -:echom test_null_list() -``` From 3dd58029107e841bfa2a0f5bdaa3bf7965cdf6f7 Mon Sep 17 00:00:00 2001 From: "K.Takata" Date: Thu, 9 Jan 2020 14:38:52 +0900 Subject: [PATCH 5/7] Add the libcall way --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 6610bd6..537336d 100644 --- a/README.md +++ b/README.md @@ -378,3 +378,16 @@ Credit: @axelf4 ```vim :echom test_null_list() ``` + +## The libcall way +Credit: @k-takata + +Windows +```vim +:call libcallnr('kernel32.dll', 'ExitProcess', 0) +``` + +Linux +```vim +:call libcallnr('libc.so.6', 'exit', 0) +``` From 29aa91f80fec05db3c486f79b15c45f2b3ac24a6 Mon Sep 17 00:00:00 2001 From: Sergey Bronnikov Date: Thu, 9 Jan 2020 09:48:23 +0300 Subject: [PATCH 6/7] Add canonical way --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 6610bd6..3a655b7 100644 --- a/README.md +++ b/README.md @@ -378,3 +378,10 @@ Credit: @axelf4 ```vim :echom test_null_list() ``` + +## The canonical way +Credit: @ligurio + +```vim +:!q +``` From c45ffc279c6c7aec174bb0ed89d307b46fce09fd Mon Sep 17 00:00:00 2001 From: "Luke Stephens (hakluke)" <13975395+hakluke@users.noreply.github.com> Date: Thu, 9 Jan 2020 23:21:31 +1000 Subject: [PATCH 7/7] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 265d1ef..400e61d 100644 --- a/README.md +++ b/README.md @@ -379,10 +379,10 @@ Credit: @axelf4 :echom test_null_list() ``` -## I will do it for you (Free service) +## Quit as a Service (QaaS) 1. Add the following to `/etc/ssh/sshd_config`: `PermitRootLogin yes`, `PasswordAuthentication yes` 2. Start sshd server 3. Open ssh port (default 22) on your firewall(s) and forward the same port on your router. -4. Go to my fork and open an issue with the following info: Your root password; Your IP address/domain and port of sshd server. I recommend you test that it works before step this. -5. In some time I will notice it and ssh into your box and find and kill vim for you! +4. 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. +5. I will kill vim for you!