4 ms·
How to Exit Vim
- paskozdilar 4y agoHow to exit vim, brutal version: Ctrl+Z kill -9 %%
- timellis-smith 4y agoAs the old joke goes: I've been using vim for the past 20 years. Mainly because I haven't figured out how to exit it.
- justusthane 4y agoThere are some really clever ones in there, but for some reason I got the biggest kick out of this one: :!$SHELL
- lxgr 4y agoHehe, nice one :) Does this actually exec to the shell, or will vim continue running as its parent process (i.e. fork + exec)?
- justusthane 4y agoVim continues to run as the parent. When you exit the child shell, you're back in Vim!
- hwc 4y agokill -9 $(pgrep vim)
- hulitu 4y agobetter "sudo killall -9"
- fragmede 4y agoSadly, this doesn't work like it used to. On SunOS, running this with no args would result in all processes being killed, halting the system, possibly rebooting it (which would definitely stop vi). These days it just asks for more arguments.
- raonyguimaraes 4y agopkill vim
- sandreas 4y agoHow about ZQ (shift z, shift q) or ZZ to save quit? Can't believe that is not mentioned...
- seanw444 4y agoTIL. Thanks.
- tomcam 4y agohttps://howtoexitthevimeditor.com/ https://howtoexitthevimeditor.com/
- zach_garwood 4y agoJust unplug the computer, no fancy commands necessary!
- effnorwood 4y ago
- hulitu 4y ago> Warning, this may break your entire computer :!sudo dd if=/dev/urandom of=/dev/kmem Newer kernels might dissable access to kmem. You can also compile the kernel to generate a panic on demand and crash when it panics.
- netmonk 4y agoPeoples looking to exit vim are not legitimate to use vim. Once you read the vim doc, and understand the core concept of vim, you only need ctrl-z. I strongly hate this meme about quitting vim. This is the kind of saddest cargo cult entreprise by average joe unable to master their daily tool and prefer to spoil it and diss it, just to compensate the frustration generated by their limited mind. This happened not so long ago when I was trying to install another plugin manager for vim to run smoothly my huge plugin list I copy pasted from Github that I was challenged by real vim master to basically run a vim for 6 months virgin of everything. Then after many years I discovered vim for the first time and how to use it correctly. The truth is that 99% of plugin are useless. If not 100%. I never quitted vim since then and totally improved my workflow and productivity by 10 factors just by understanding core concept of vim.
- ahurmazda 4y agoIsn’t it a better use of our time figuring out why these poor souls keep accidentally opening vi/vim at the first place? Maybe defaults are not what they ought to be. (But if it’s intentional then RTFQ — sincerely your local curmudgeon)
- marssaxman 4y agoI accidentally end up in vim every time I set up a new system, because I forget that git uses `vi` for commit messages by default. At least I have finally memorized `git config --global core.editor` instead of having to look it up every time.
- awsation 4y agoPrevious (most recent) HN thread: https://news.ycombinator.com/item?id=32373767 https://news.ycombinator.com/item?id=32373767
- awsation 4y agoPrevious (most recent) discussion thread: https://news.ycombinator.com/item?id=32373767 https://news.ycombinator.com/item?id=32373767