1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 23:58:01 +00:00

Add Quickly Switch To A Buffer By Number as a vim til

This commit is contained in:
jbranchaud
2017-08-17 11:39:14 -05:00
parent e90997463c
commit c64647f884
2 changed files with 23 additions and 1 deletions

View File

@@ -0,0 +1,21 @@
# Quickly Switch To A Buffer By Number
There are a number of different commands you can use for switching to a
buffer by its number. For example, if you want to switch to the buffer
assigned `7`, you can do `:7b` or `:e #7`. However, there is a quicker way
than typing out either of those commands.
You may already be familiar with `CTRL-^` for switching to the _alternate
file_ which is generally the previous buffer. If you precede that command
with a number, you will switch to the buffer with that number instead of the
alternate file.
From normal mode
```vimscript
7 Ctrl-^
```
will switch to buffer `7`.
See `:h Ctrl-^` for more details.