From 7dac64984b8300b3e6e5bd877675e6eaecac0818 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 27 Feb 2016 10:43:13 -0600 Subject: [PATCH] Add Interact With The Alternate File as a vim til --- README.md | 1 + vim/interact-with-the-alternate-file.md | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 vim/interact-with-the-alternate-file.md diff --git a/README.md b/README.md index 99f50c0..47c80cb 100644 --- a/README.md +++ b/README.md @@ -372,6 +372,7 @@ _348 TILs and counting..._ - [Horizontal to Vertical and Back Again](vim/horizontal-to-vertical-and-back-again.md) - [Incremental Searching](vim/incremental-searching.md) - [Increment All The Numbers](vim/increment-all-the-numbers.md) +- [Interact With The Alternate File](vim/interact-with-the-alternate-file.md) - [Interactive Buffer List](vim/interactive-buffer-list.md) - [Joining Lines Together](vim/joining-lines-together.md) - [Jump To Matching Pair](vim/jump-to-matching-pair.md) diff --git a/vim/interact-with-the-alternate-file.md b/vim/interact-with-the-alternate-file.md new file mode 100644 index 0000000..07f8af3 --- /dev/null +++ b/vim/interact-with-the-alternate-file.md @@ -0,0 +1,18 @@ +# Interact With The Alternate File + +If you have a couple buffers going in a Vim session and you check out the +buffer list with `:ls`, you'll notice that one of those buffers has a `#` +indicator next to it. That means the file for this buffer is considered the +alternate file of the current, visible buffer. In addition to hitting +`CTRL-^` to switch to that buffer, you can reference it in other commands +with `#`. This means you can quickly `:edit`, `:split`, `:vsplit`, and so +forth the alternate file by just giving `#` as the argument to those +commands. + +Quickly open the alternate file in a vertical split with: + +``` +:vsp # +``` + +See `:h alternate-file` for more details.