In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about the skills of 8 kinds of fancy exit from Vim, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
What is the most commonly used code editor for programmers, Vim, Emacs, VS Code, Sublime; have different opinions.
But when it comes to the biggest code editor for programmers, there is no doubt that it is Vim. It can be said that "the world has suffered vim for a long time".
How big is Vim? If you are a beginner, you don't even know how to quit it.
Recently, a programmer, Luke Stephens, launched a GitHub project called how to quit Vim, which has received 3500 stars in just one week.
Luke is from the Twitter of various programmers to find these methods, put them together, both hard-core and humorous, evoking many programmers to learn Vim that terrible memory. Let's have a look together.
Hardcore exits Vim
The easiest way is to find the vim process and kill it:
:! ps axuw | grep vim | grep-v grep | awk'{print $2}'| xargs kill-9
This is bullying. I don't understand Vim. The easiest way is obviously not: Q? )
You can actually exit Vim without displaying the ps command for the process:
:! kill-9 $(find / proc-name "cmdline" 2 > / dev/null | while read procfile; do if grep-Pa'^ vim\ x00' "$procfile" & > / dev/null; then echo $procfile; fi; done | awk-procfile; fi; done'{print $3}'| sort-u)
Luke himself has come up with a way not to use the ps command, which requires a state file:
:! find / proc-name status | while read file; do echo "$file:"; cat $file | grep vim; done | grep-B1 vim | grep-v Name | while read line; do sed's / ^\ / proc\ / g'| sed's /\ /. * / / g; done | xargs kill-9
If you think the above two ways of not using the ps command are too long, there is another short way:
:! grep-P "PPid:\ t (\ d +)" / proc/$$/status | cut-f2 | xargs kill-9
For Python users, you have a "Python way" to exit Vim:
: py3 import os,signal;from subprocess import check_output;os.kill (int (check_output (["pidof", "vim"]) .decode ('utf-8')), signal.SIGTERM)
Luke also lists one of the "shortest" ways (original text: The shortest way). I think you're being sarcastic:
:! Xerox $(echo "c"); Xerox $(echo "G"); Xerox $(echo "t"); Xerox $(echo "p"); X-ray $(echo "b"); x-bag x $(echo "G"); x-bag x $(echo "w"); x-bag x $(echo "g"); x-bag x $(echo "L"); x-bag x $(echo "V"); x-bag x $(echo "N"); X-ray X $(echo "U"); x-bag x $(echo "T"); x-bag x $(echo "1"); x-bag x $(echo "A"); x-mail x $(echo "g") Xerox (echo "d"); Xerox (echo "m"); X-ray (echo "l"); X-ray (echo "t"); X-ray (echo "C"); X-ray (echo "g"); X-ray (echo "="); x-ray (echo "="); $(echo $x | base64-- decode)
A crackdown on Vim dimensionality reduction
The above methods are inseparable from the operation of Vim itself, we have a more advanced "dimensionality reduction attack" way. Since quitting Vim is so troublesome, you might as well kill it at a higher level.
If you are running Vim in a Docker container, such as this:
Docker run-- rm-it-- name my-vim-v `pwd`: / root thinkca/vim
Then you can stop and exit the Docker container and turn it off. I'm so witty!
Docker stop my-vim
At the system level, we can also kill Vim by setting a timeout:
$timeout 600 vim
With the above code set, Vim will shut down after running for more than 10 minutes, once and for all, and there is no need to enter the exit command again. But you have to change the code as soon as possible and save it, otherwise you will be miserable.
Oh, finally, don't forget to change Vim to turn off for 10 minutes by default:
$alias vim='timeout 600 vim'
Violence and Buddhist methods
The most direct and violent way is to unplug the power supply. The most Buddhist way is to just walk away.
If you have to ask me if there is any way to combine violence with Buddhism, please put away the following code and run it and leave your seat directly.
! bash-c "? () {? |?
Don't try it easily on your own computer, at your own risk.
Workplace method
If you are a newcomer to the company, or an intern, do not dare to operate casually on the computer, the following measures are recommended:
Find a senior engineer: "I can't turn off Vim! Boing."
For the product manager, Luke gives a detailed process:
Hongmeng official Strategic Cooperation to build HarmonyOS Technology Community
Raise demand (much easier than colorful black)
Set it as the highest priority (put the task at hand for a while)
Randomly assigned to team members (who can do it and who can)
For senior product managers, this process is obviously not detailed enough.
After reading the above, do you have any further understanding of the skills of 8 kinds of fancy exit Vim? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.