mirror of
https://github.com/jbranchaud/til
synced 2026-01-05 08:08:02 +00:00
Add Close All Other Windows as a vim til
This commit is contained in:
20
vim/close-all-other-windows.md
Normal file
20
vim/close-all-other-windows.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Close All Other Windows
|
||||
|
||||
Opening split windows can be useful in a number of circumstances. Eventually
|
||||
though, you are going to want to go back to just one window. Generally when
|
||||
this happens to me, I navigate to each of the other split windows that I
|
||||
don't want and execute `:q`. What I want to do is essentially close all the
|
||||
other split windows except for my current one. Vim provides a single command
|
||||
for doing this. By hitting
|
||||
|
||||
```
|
||||
<CTRL>w <CTRL>o
|
||||
```
|
||||
|
||||
all other windows are closed leaving the current window as the only one on
|
||||
the screen.
|
||||
|
||||
If you want this command to be able to work with windows containing modified
|
||||
buffers, you are going to want to have the `hidden` option turned on.
|
||||
|
||||
See `:h CTRL-W_CTRL-O` for more details.
|
||||
Reference in New Issue
Block a user