diff --git a/README.md b/README.md index b8624e8..99f50c0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_347 TILs and counting..._ +_348 TILs and counting..._ --- @@ -345,6 +345,7 @@ _347 TILs and counting..._ - [Case-Insensitive Substitution](vim/case-insensitive-substitution.md) - [Center The Cursor](vim/center-the-cursor.md) - [Check Your Current Color Scheme](vim/check-your-current-color-scheme.md) +- [Close All Other Windows](vim/close-all-other-windows.md) - [Close the Current Buffer](vim/close-the-current-buffer.md) - [Coerce The Current Filetype](vim/coerce-the-current-filetype.md) - [Coercing Casing With vim-abolish](vim/coercing-casing-with-vim-abolish.md) diff --git a/vim/close-all-other-windows.md b/vim/close-all-other-windows.md new file mode 100644 index 0000000..399cf48 --- /dev/null +++ b/vim/close-all-other-windows.md @@ -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 + +``` +w 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.