user2764439
user2764439

Reputation: 21

How to show buffers without full path?

When I execute :ls in vim, I see all buffers with full path, except for the file in the active buffer. With long paths and a not so large editor window, the buffer list get wrapped. In this way, searching for a buffer takes a while, especially when you have a lot of buffers open. Is there a possibility to show all buffers without full path?

Upvotes: 2

Views: 663

Answers (1)

mhinz
mhinz

Reputation: 3351

You can't change the format of :ls. It shows paths relative to your current working directory (:pwd).

You can change the current working directory either via :cd or :lcd.

Also you might find the option :help 'autochdir' interesting, too.

EDIT:

I should clarify on relative here:

Files within the current working directory are shown relative and files outside of it are shown absolute. Absolute paths can be shortened, e.g. by using ~ instead of /home/user on Unix systems.

Upvotes: 2

Related Questions