Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NotNormallyAGitUser opened this issue Dec 18, 2023 · 5 comments
Open

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

NotNormallyAGitUser opened this issue Dec 18, 2023 · 5 comments

Comments

@NotNormallyAGitUser
Copy link

NotNormallyAGitUser commented Dec 18, 2023

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
Copy link
Owner

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

@jlanzarotta
Copy link
Owner

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
Copy link
Author

Thanks for the update!

@jlanzarotta
Copy link
Owner

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

@jlanzarotta
Copy link
Owner

jlanzarotta commented May 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants