Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I open previously opened buffer in Vim?

Tags:

vim

buffer

How to open a previously opened buffer in Vim?

I've 4 buffers, say buf1 to buf4.

Currently I've opened buf1 and then I open buf3 executing :b3.

Now, how do I go back to buf1 (the previously opened buffer) without executing :b1?

Ctrl+P will go to buf2, the previous buffer in the list.

like image 938
Sagar Jain Avatar asked Mar 15 '23 01:03

Sagar Jain


1 Answers

:b#

Opens the previously opened buffer.

Repetitive use of the command toggles between the buffers.

Thanks to Related questions on this site!

like image 52
Sagar Jain Avatar answered Mar 21 '23 02:03

Sagar Jain