jeetsukumaran / vim-buffergator

Vim plugin to list, select and switch between buffers.
498 stars 49 forks source link

Feature suggestion: Option for relative path name #7

Closed ryanwood closed 12 years ago

ryanwood commented 12 years ago

It would be great to add an option to show the relative path of the file vs. the absolute path when displaying by basename. When loading into a vertical window, you can't ever see the path as it's pretty long. BufExplorer has a simliar setting (let g:bufExplorerShowRelativePath=1).

Also, it would be great to make the spacing between the basename and the path to be 1 space larger than the longest basename. This would reduce a lot of wasted whitespace.

jeetsukumaran commented 12 years ago

These are two separate issues.

For the first one, the relative path of the file is available, in the form of "bufname". The buffer name is (usually) the relative path of the filename of the buffer. You can make it the default by (let g:buffergator_display_regime = "bufname"). If am wrong about the equivalency of this setting and what you are requesting, please let me know what the differences are and I will write up a separate option for relative path.

The second issue (the smarter spacing) has just be added with the latest commit (but I used 2 spaces instead of just one, for better visual separation).

ryanwood commented 12 years ago

Thanks for the response. I saw the change with the spacing soon after my original post. On the buffer display, I would ideally like an option like this:

#3 index.html.slim     app/views/company
#4 index.html.slim     app/views/user
#5 user_controller.rb  app/controllers

With filename option, my full path is way too long so see the directory context to distinguish buffer #3 from #4. With the bufname option, it's harder to see file names at a glance. The basename option is the best fit for me. I just wish there was a flag to only show the relative path vs. the full file path. Of course that could just be another view option as well. Thanks for the consideration.

jeetsukumaran commented 12 years ago

Ok, this is now implemented with the following option:

    let g:buffergator_show_full_directory_path = 0 

It defaults to true, i.e., show full path. This option can be cycled in the buffer catalog using the key map "cp" (cycle path).

ryanwood commented 12 years ago

Perfect! Thanks so much. Love the plugin.