schmudu
schmudu

Reputation: 2233

Vim: Losing file in buffer

I'm using vi as my editor on a Mac OS X and I'm able to switch back and for between files in the buffer using the commands :bp and :bn. What I notice is that if files are not committed to Subversion then if I switch away from a file that is not committed to Subversion then it it doesn't save in the buffer.

However there's one file in particular that vi does not save in the buffer (even after I commit it to Subversion). Whenever I switch away from it using the commands mentioned above the only way I can go back to it is to open it manually.

For example if I'm working on foo.txt and then switch to bar.txt using the command :bn. If I then list the buffers using :ls only bar.txt is listed. Must be something that I'm missing about vi buffers.

Any ideas?

Upvotes: 1

Views: 213

Answers (1)

Kjir
Kjir

Reputation: 4547

:bd is short for :bdelete and it unloads the buffer and removes it from the buffer list.

If you want to go back and forth between buffers, use :bn and :bN. :bN is the equivalent of :bp.

Upvotes: 1

Related Questions