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

Show additional info like ownership, size, etc., on each line #264

Open
srcrip opened this issue Oct 27, 2020 · 6 comments
Open

Show additional info like ownership, size, etc., on each line #264

srcrip opened this issue Oct 27, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@srcrip
Copy link

srcrip commented Oct 27, 2020

How doable would it be to add an option to toggle other information on a per line basis, like ranger or dired:

image

@lambdalisue
Copy link
Owner

Unfortunately, fern doesn't support such a feature (at least for now).
I'd dreamed to provide a way to see such information but it's a bit difficult and I don't have enough motivation (yet) to implement that.

@srcrip
Copy link
Author

srcrip commented Oct 31, 2020

Getting the info itself shouldn't be hard, just requires some system calls (though it might be difficult to make it work on linux/mac/windows at the same time). How hard do you estimate it to be to actually add stuff to functions drawing each line? Where should I look?

@lambdalisue
Copy link
Owner

How hard do you estimate it to be to actually add stuff to functions drawing each line? Where should I look?

Depends on the design but I'm sure that I'll reject it if the feature would affect the performance. Thus, I'm wondering about providing the feature as a plugin but the current fern itself does not provide enough mech to implement such a plugin (I guess while I haven't designed that feature yet.) Mean that I think I need to design an entire mech to allow such a plugin first.

@srcrip
Copy link
Author

srcrip commented Nov 6, 2020

Yeah if we could somehow get a function call that would occur per line that would pass in the filename it could be implemented as a plugin outside of fern proper. I would be in favor of that if its doable...

@lambdalisue lambdalisue added enhancement New feature or request wontfix This will not be worked on and removed wontfix This will not be worked on labels Dec 21, 2020
@alexandersokolow
Copy link

alexandersokolow commented Apr 23, 2024

I have implemented this in my fork, but it relies on an external bash script + C program.

The bash script calls "find" with some arguments to get the file sizes and prints them with the names (separated by some kind of rare unicode character).
The CI'm not using those anyways program is called to display the number of files in directories (doing this without C was too slow).
The script also prints file type information, to show executable files in green, show symlinks with arrows, etc. (the way I syntax highlight the executables is by displaying some kind of specific invisible character before the names)

The way it works in my fern fork is that this bash script gets called in scheme/file/util instead of "find" (or e.g. "ls") & the node objects get populated with the extra information. The renderer has been adjusted to incorporate that information. It's also handling edge cases like when the file names are too long.

If you are interested, I can send you the script & c program & point you to the locations in my fork that has had changes related to this, though I'm not sure how you'd integrate it into the fern plugin for general use & whether the use of an external C program would align with fern's design philosophy (of just using vimscript).
In my case, I just have a symlink to the bash script in my path, but I guess the C program would somehow have to be integrated into the fern folder, which is probably not something that makes sense for fern, though maybe as a plugin!
The change does not (significantly) affect the performance (it did before I had the C script).

Here are two screenshots of how it looks:
image
image

Btw, I have a lot of other cool features that might be worth integrating (e.g. nicer copy / move / delete with popups in the center, extract / compress functionality, expanding / collapsing all nodes at once, regex marking, etc.), but that should probably go into another post / issue.

@lambdalisue
Copy link
Owner

Thanks for your suggestion but "but it relies on an external bash script + C program" is not acceptable in fern.vim. I'm sorry for that.

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

No branches or pull requests

3 participants