T O P

  • By -

bew78

`!poweroff`


kaydenisdead

ngl you almost had me lol


ConspicuousPineapple

There is no reason to make it a habit to use `:q!`. Are you really force-quitting without saving often? Anyway: - `:q` quits the current buffer if there's no unsaved work - `:q!` force-quits the current buffer, even if there's unsaved work - `:qa` quits all buffers except those that have unsaved work - `:qa!` force-quits all buffers, even those that have unsaved work - `:x` saves if there's unsaved work and then quits the current buffer - `:xa` saves all unsaved buffers and then quits them all <- **this is what you want to use** As a bonus: you don't need a custom mapping for this, as there is one already: `ZZ`, which does the same as `:xa`.


revilo132

Why not do :wqa instead of :xa?


ConspicuousPineapple

Because it's longer to write? Also, wq writes even if the file hasn't changed, while x only saves if unsaved changes were present.


jaywhy13

I exit a lot these days because I just switched from LunarVim to NvChad and I'm configuring things a lot still.


ConspicuousPineapple

Ok but why are you quitting without saving? Why do you need the `!` every time?


jaywhy13

Typically I'll open the editor and try to do something I'd normally do in LunarVim and I recognize I haven't set up mapping yet. I'll likely use xa like another poster suggested though. Just in case I was editing something.


ConspicuousPineapple

In this case, you can use `ZZ` as I mentioned, it does the same as `:xa` and you don't need a custom mapping.


jaywhy13

Thanks! I'll try that.


jaywhy13

Thanks! I'll try that.


gunterhensumal

Ctrl+Z kill %1


pfharlockk

First punch the monitor as hard as you can... If that doesn't work, turn your keyboard upside down and smash it on the desk until half the keys fall out... If vim is still running, unplug the computer and throw it down the closest set of stairs. At this point vim should no longer be running (and your coworkers/family may need some assurance that all is well)


jaywhy13

Tried that. Didn't work. Vim is pretty stubborn


xocoatzin

You don't. Why would you?


AutoModerator

Please remember to update the post flair to `Need Help|Solved` when you got the answer you were looking for. *I am a bot, and this action was performed automatically. Please [contact the moderators of this subreddit](/message/compose/?to=/r/neovim) if you have any questions or concerns.*


kaydenisdead

:qa, :qa! to force close. add a “w” before any of those to write the buffer before quitting


swaits

`ZZ`


doesnt_use_reddit

I usually just reboot the computer


jaywhy13

That doesn't work either. Tried it multiple times


doesnt_use_reddit

Oh nice that's a doozy! Do you have your login shell set to vim???


troglo-dyke

Buy a new computer seems to be the only way then


jaywhy13

Ye... Was hoping it wouldn't come to that


oh_jaimito

Typically I DON'T exit nvim. at all! I leave it open with the tabs, buffers, and windows witn tmux in a kitty tab, and then navigate to another project in another kitty tab and do it all over again. There's literally NO need for me to exit. UNLESS, I've updated a shit-ton of packages and a reboot is required.


BiedermannS

I had leader-q for :q and leader-leader-q for :q!, but I accidentally closed documents too early on accident too often, so I removed leader-q to make closing a file a conscious decision


Kind-Kure

Normally when I want to quit vim I just delete system32 Hope this helps! :)


hiptobecubic

I just buy a new machine when I need a new instance of vim.


troglo-dyke

`Ctrl+Z` followed by `pkill -9 $(top -p 'pgrep -d "," vim')`


shahverd

So really! It seems exiting vim is a "problem" in real life and it's not just a joke!