jlanzarotta / bufexplorer

BufExplorer Plugin for Vim
BSD 3-Clause "New" or "Revised" License
510 stars 97 forks source link

In path for each buffer, use tilde for home directory #112

Open NotNormallyAGitUser opened 10 months ago

NotNormallyAGitUser commented 10 months ago

Decades ago, I made simple changes to the BufExplorer plugin so that a user's home directory is replaced by ~ in the folder path for each buffer. It saves a lot of screen area, and I can see more of the path in the buffer list, especially when the buffer list window was one of many and hence smaller than full-screen. I posted the VimScript edits on UseNet (though it was probably naively coded, as I am not a developer). Every time BufExplorer gets updated, I figure out how to achieve that change again.

I've never experienced any downsides to the change. I would like to suggest that the simple change be incorporated into BufExplorer. It's probably trivial for the author to implement, but here is my naive change in BufExplorer 7.4.23 from Cygwin (I am not a developer and VimScript is not my forte):

In function! s:BuildBufferList(), replace both occurrences of

let path = buf[type]

with

let path = substitute( buf[type], $HOME."\\>", "~", "" )

There are probably more robust ways to do this, e.g., to ensure that the string being replaced is actually the home directory rather than a subfolder that just happens to match the string that represents the home directory. Also, on Windows, $USERPROFILE is used instead of $HOME.

jlanzarotta commented 10 months ago

Hello. Thanks for the update. Let me check this out... hopefully in the next day or so...

jlanzarotta commented 9 months ago

Okay, I finally got around to making the change. I am testing it and "should" publish a new version this week unless I find an issue.

NotNormallyAGitUser commented 9 months ago

Thanks for the update!

jlanzarotta commented 5 months ago

Finally hoping to lease this new version today. Life has been busy...

jlanzarotta commented 5 months ago

Okay, I have not released stuff in so long, I do not recall the processing in making a manual release...