diff --git a/README.md b/README.md index 362dcbf..98be223 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_1061 TILs and counting..._ +_1062 TILs and counting..._ --- @@ -1181,6 +1181,7 @@ _1061 TILs and counting..._ - [Reset Target tslime Pane](vim/reset-target-tslime-pane.md) - [Reverse A Group Of Lines](vim/reverse-a-group-of-lines.md) - [Rotate Everything By 13 Letters](vim/rotate-everything-by-13-letters.md) +- [Rotate The Orientation Of Split Windows](vim/rotate-the-orientation-of-split-windows.md) - [Running Bundle With vim-bundler](vim/running-bundle-with-vim-bundler.md) - [Scrolling Relative to the Cursor](vim/scrolling-relative-to-the-cursor.md) - [Search Backward Through A File](vim/search-backward-through-a-file.md) diff --git a/vim/rotate-the-orientation-of-split-windows.md b/vim/rotate-the-orientation-of-split-windows.md new file mode 100644 index 0000000..9ea04e9 --- /dev/null +++ b/vim/rotate-the-orientation-of-split-windows.md @@ -0,0 +1,18 @@ +# Rotate The Orientation Of Split Windows + +Let's say you have a vim session going with a single window/buffer open. If you +were to then open another file with the split command (e.g. `:sp README.md`), +then you'd have a horizontal split. With one file above and one file below. + +You can rotate the orientation of the split to be a vertical split with one +file on the left and another on the right. You can do this with a _Window +Command_—`Ctrl-W H` (that's `ctrl-w` and then capital `H`). + +If you want to go the other direction—from a vertical split to a horizontal +split—you can use `Ctrl-W J` (that's `ctrl-w` and then capital `J`). + +This trick only works when there is a split between two windows. When +additional splits are involved, it will rotate the focused window to that +orientation and leave the others stacked in their current orientation. + +See `:h CTRL-W` for more details on these and other Window Commands.