:help :buffer
:help +cmd
:help CTRL-^
Edit given buffer.
If you read the reference, which I hope you do, you can see that the buffer number can be given as counter or as parameter. So the following seems to be equivalent if we want to edit buffer number 4 ...
:buffer 4
:b 4
:b4
:4b
You can also run the command directly after running :ls
or :ls!
to see the buffer list, which is very useful because
who the heck knows the buffer numbers by heart?!
You can also use the <TAB>
key to use filename completion.
:b filename
As an alternative to Ctrl-^
.
:b#
:b + 4
:b + filename
:b +42 4
:b +42 filename
:b +/pattern 4
:b +/pattern filename
:b +command 4
:b +command filename
Like in the following example, and notice that you have to protect the whitespace ...
:b +set\ ft=py myFile.py.bak