Skip to content

Commit 4827581

Browse files
committed
Add Close All Other Windows as a vim til
1 parent edb59ab commit 4827581

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really
77
warrant a full blog post. These are mostly things I learn by pairing with
88
smart people at [Hashrocket](http://hashrocket.com/).
99

10-
_347 TILs and counting..._
10+
_348 TILs and counting..._
1111

1212
---
1313

@@ -345,6 +345,7 @@ _347 TILs and counting..._
345345
- [Case-Insensitive Substitution](vim/case-insensitive-substitution.md)
346346
- [Center The Cursor](vim/center-the-cursor.md)
347347
- [Check Your Current Color Scheme](vim/check-your-current-color-scheme.md)
348+
- [Close All Other Windows](vim/close-all-other-windows.md)
348349
- [Close the Current Buffer](vim/close-the-current-buffer.md)
349350
- [Coerce The Current Filetype](vim/coerce-the-current-filetype.md)
350351
- [Coercing Casing With vim-abolish](vim/coercing-casing-with-vim-abolish.md)

vim/close-all-other-windows.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Close All Other Windows
2+
3+
Opening split windows can be useful in a number of circumstances. Eventually
4+
though, you are going to want to go back to just one window. Generally when
5+
this happens to me, I navigate to each of the other split windows that I
6+
don't want and execute `:q`. What I want to do is essentially close all the
7+
other split windows except for my current one. Vim provides a single command
8+
for doing this. By hitting
9+
10+
```
11+
<CTRL>w <CTRL>o
12+
```
13+
14+
all other windows are closed leaving the current window as the only one on
15+
the screen.
16+
17+
If you want this command to be able to work with windows containing modified
18+
buffers, you are going to want to have the `hidden` option turned on.
19+
20+
See `:h CTRL-W_CTRL-O` for more details.

0 commit comments

Comments
 (0)