Vim Tips Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Vim Tips Wiki
1,649
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Community portal
To do
Editing
Automatically quit Vim if quickfix window is the last
(section)
Back to page
Edit
Edit source
View history
Talk (0)
We recommend that you
log in
before editing. This will allow other users to leave you a message about your edit, and will let you track edits via your
Watchlist
.
Creating an account
is quick and free.
Anti-spam check. Do
not
fill this in!
==Comments== The quit! should be changed to tabclose to be safe. :I don't think your concern is correct. The <code>quit!</code> would close the current buffer and discard any changes for that buffer. However, the command does not attempt to close any other buffer, so unsaved work in other tabs will be retained (Vim will not terminate). :Is the <code>!</code> needed? I think you have to go to a fair bit of trouble to make a change to a quickfix window, so a plain <code>quit</code> would suffice and be a tiny bit safer. :Rather than use <code>winbufnr(2)</code>, I think the test could be <code>if winnr('$') < 2</code>. [[User:JohnBeckett|JohnBeckett]] 07:00, May 10, 2011 (UTC)
Summary:
Please note that all contributions to the Vim Tips Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab