@@ -534,9 +534,10 @@ exit him
534
534
how exit vim
535
535
```
536
536
537
- ### Linux
537
+ ## Linux
538
538
``` vim
539
539
:call libcallnr('libc.so.6', 'exit', 0)
540
+ ```
540
541
541
542
## The canonical way
542
543
Credit: @ligurio
@@ -652,6 +653,10 @@ Credit: @ccw630
652
653
653
654
``` vim
654
655
:!$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 `
655
660
```
656
661
657
662
## The Arbitrary Code Execution Way
@@ -674,15 +679,51 @@ echo "set modeline" >> .vimrc
674
679
## The Circuit Breaker Way
675
680
Credit:@Tomcat-42
676
681
677
- 1 . Smoothly leave your computer
682
+ 1. Leave your computer
678
683
2. Find the nearest electrical circuit breaker panel
679
684
3. Switch off and on the main breaker
680
685
4. Return to your computer
681
686
5. Your computer should no longer be running vim
682
687
683
688
**Note:** This approach prove itself ineffective against notebooks, desktops on a UPS or remote servers.
684
689
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.*
687
729
688
- *** Quit software engineering for good.***
0 commit comments