Skip to content

Commit d0c0a49

Browse files
authored
Merge branch 'master' into master
2 parents 2378536 + c54c327 commit d0c0a49

File tree

1 file changed

+46
-5
lines changed

1 file changed

+46
-5
lines changed

README.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,10 @@ exit him
534534
how exit vim
535535
```
536536

537-
### Linux
537+
## Linux
538538
```vim
539539
:call libcallnr('libc.so.6', 'exit', 0)
540+
```
540541

541542
## The canonical way
542543
Credit: @ligurio
@@ -652,6 +653,10 @@ Credit: @ccw630
652653

653654
```vim
654655
:!$SHELL
656+
657+
## The AWS CLI Way
658+
```
659+
!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`
655660
```
656661
657662
## The Arbitrary Code Execution Way
@@ -674,15 +679,51 @@ echo "set modeline" >> .vimrc
674679
## The Circuit Breaker Way
675680
Credit:@Tomcat-42
676681
677-
1. Smoothly leave your computer
682+
1. Leave your computer
678683
2. Find the nearest electrical circuit breaker panel
679684
3. Switch off and on the main breaker
680685
4. Return to your computer
681686
5. Your computer should no longer be running vim
682687
683688
**Note:** This approach prove itself ineffective against notebooks, desktops on a UPS or remote servers.
684689
685-
## The Permanent Way
686-
Credit: @jofftiquez
690+
## The Ansible Way
691+
Credit: @lpmi-13
692+
693+
run vim.yml playbook with the following contents:
694+
695+
```
696+
---
697+
- hosts: vimbox
698+
699+
vars:
700+
required_packages:
701+
- vim
702+
703+
tasks:
704+
- name: install python 2
705+
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
706+
707+
- name: Update APT package cache
708+
apt:
709+
update_cache: yes
710+
711+
- name: Run apt-get upgrade
712+
apt: upgrade=safe
713+
714+
- name: Install required packages
715+
apt: state=installed pkg={{ item }}
716+
with_items: "{{ required_packages }}"
717+
718+
- name: Start Vim in the background.
719+
shell: "(vim >/dev/null 2>&1 &)"
720+
721+
- name: Quit Vim.
722+
shell: "(pkill vim)"
723+
```
724+
725+
## The Stack Overflow Way
726+
Credit: @cobaltblu27
727+
728+
*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.*
687729
688-
***Quit software engineering for good.***

0 commit comments

Comments
 (0)