2

Is there a way to shorten the displayed name of the buffer, for example, on the image, path(...)/application_controller.rb to simply "application_controller.rb"? If I have many buffers with such long names, things get messy.

My buffer menu :

set wildmenu  

set wildmode=longest:full,full  

set wildcharm='<'C-Y>  

nnoremap '<'F3> :b '<'C-Y><right>  

screenshot

2

If all you want to do is shorten the filename shown on the status line, search statusline or stl in your vimrc, and replace %f with %t. See :help statusline for details.

1

As the path that is shown in the statusline by default is relative to the current working directory, you could shorten it by :cd'ing to a "closer" subdirectory, or the file's directory itself (:cd %:p:h). With :set autochdir, this will be done automatically whenever you switch buffers.

Of course, this is a more invasive change than simply changing the 'statusline' display itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.