jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
19.37k stars 761 forks source link

ToDo list #719

Closed jarun closed 4 years ago

jarun commented 4 years ago

Rolled from #629.

Cooking

Up for grabs

For anything else please discuss in this thread.

Contribution guideline.

timsofteng commented 4 years ago

Hey. How about adding option to enable icons without recompiling?

jarun commented 4 years ago

Which distro is not allowing you to compile?

0xACE commented 4 years ago

Which distro is not allowing you to compile?

Out of curious how do you automize this for package managers? I guess on archlinux we could just setup som simple alpm-hook to build it on update, but that's just a guess. I think @maximbaz is a package maintainer and may have some good input.

I think the problem @timsofteng is experiencing is that he cba to maintain nnn manually on his pc so he chooses the distro's own release...

jarun commented 4 years ago

We have all the instructions here.

maximbaz commented 4 years ago

ArchLinux distributes binary packages, compiled once by package maintainers, same as you distribute binaries via Github release, so the only option left for users who dislike the default behavior is to compile their own binaries, and @timsofteng's request is to control icons via environment variables in runtime instead of make config.

jarun commented 4 years ago

I'll leave it as a compile-in feature. Given the few library deps, it's quite easy to compile nnn.

Primary reason: icons add significantly to the memory usage and binary size of nnn. And we have several users who don't want these bells and whistles at the cost of increased resource usage.

timsofteng commented 4 years ago

Which distro is not allowing you to compile?

I'm using nixos with declarative config and I don't wanna care about any compiling. I have one config which include options for everything in my system. This is a reason.

jarun commented 4 years ago

There are several other nice FMs which enable icons by default. Pick one of those.

timsofteng commented 4 years ago

There are several other nice FMs which enable icons by default. Pick one of those.

I don't ask to enable it by default. I ask to have ability to enable it without recompiling.

0xACE commented 4 years ago

I don't ask to enable it by default. I ask to have ability to enable it without recompiling.

I guess the reasoning against baking in the support for icons, is that it increases the size of the binary. Tbh, most of the additional changes would barely have any measurable effect on nnns performance.

Fyi maintaining nnn locally is trivial. git clone it somewhere, run make and ln -s nnn ~/bin/ or w/e you have setup your $PATH, then everynow and then update the git pull or w/e ppl use these days and run make again.

Finally, what you are advocating is that the official release pre-compiles with support for icons. Icons which themselves requires an intrusive setup. I guess "vanilla" icon support would help adoption of nnn amongst users, but if you already maintain an intrusive setup, isn't it expected of you to take responsibility for your mods?

I'm not familiar with nixos but maybe those maintainers could be persuaded to compile with icons? If not, I think I have seen a linux distrobution that prioritizes "ricing", they could easily be persuaded to bake in the icons support.

jarun commented 4 years ago

I guess the reasoning against baking in the support for icons, is that it increases the size of the binary.

That's correct. I meant having the capability to show icons in the binary. Because of the reasons I mentioned earlier.

danrobi11 commented 4 years ago

Hi I was trying to find a keybind in 'help' in order to copy the full path of the files. I havent found any. Is there a keybind to do that?

jarun commented 4 years ago

When you say copy, I understand it's copy to clipboard. Please try the option -x.

if you want to get the path in the terminal, read https://github.com/jarun/nnn/wiki#selection

As I understand from your question, you haven't read the documentation. We can't keep re-iterating documented stuff that we have already spent time on. Thank you for your understanding.

timsofteng commented 4 years ago

Hey. is there any way to use nnn to select files to upload to browsers Firefox and Chrome?

jarun commented 4 years ago

How do you upload to browsers from the terminal? I don't understand the use case.

You can upload and share files from nnn. There's a plugin to do that.

You can also open a file using your browser using "open with..."

ghost commented 4 years ago

Can nnn display line numbers and relative line numbers like vim does? It's easier to type 6j and move to the 6th file/folder from wherever I am rather than filtering for the file/folder.

jarun commented 4 years ago

No, because of several reasons:

jarun commented 4 years ago

BTW, another way to navigate fast is to use ' to just to the first file or next matching char.

0xACE commented 4 years ago

Can nnn display line numbers and relative line numbers like vim does? It's easier to type 6j and move to the 6th file/folder from wherever I am rather than filtering for the file/folder.

It can but I dropped it because the context numbers block this operation: img

Right now I'm considering either some static symbols rather than dynamically updating relative numbers... But I'm up to my neck with tasks so I won't be doing it this month it seems...

For now just use ' or filter it by search... Though if you have other idieas on how it would work hit me up... peace

ghost commented 4 years ago

without that we don't think it's convenient to count 15 lines

one doesn't need to mentally count 15 lines if we have relative line numbers

BTW, another way to navigate fast is to use ' to just to the first file or next matching char.

won't always work as expected, especially in the ~/ folder where there are many hidden directories

nnn is not an editor

sure, but if it helps moving around faster in a folder with lots of directories, it might be worth considering adding this feature I think

jarun commented 4 years ago

one doesn't need to mentally count 15 lines if we have relative line numbers

I mentioned we do not show line numbers... not sure what you mean by relative

it might be worth considering adding this feature I think

It conflicts with the current mechanism to switch contexts by numbers (we use 1 to 4/8).

if it helps moving around faster in a folder with lots of directories

No it doesn't just because you are familiar with it. I don't use that feature in vim, for example... and I do not have any issue navigating in vim. I show and use line numbers directly there (:line_num). As we don't show line numbers in nnn that is not possible. Faster is a personal perspective. I don't see any problem navigating in nnn with the current navigation mechanisms available.

jarun commented 4 years ago

Also, the screenshot from @0xACE is from his personal branch. It's not mainline.

jarun commented 4 years ago

@objectivephoenix another great option if you want to get as vim-ish behaviour as possible from a terminal file manager is vifm. Check it out. I know for sure it has this feature you are requesting,

Awebb commented 4 years ago

ArchLinux distributes binary packages, compiled once by package maintainers, same as you distribute binaries via Github release, so the only option left for users who dislike the default behavior is to compile their own binaries, and @timsofteng's request is to control icons via environment variables in runtime instead of make config.

The maintainer could easily provide an "nnn" and "nnn-icons-on" package. It wouldn't probably not be a biggie and I think finding a good name would be the hardest job.

jarun commented 4 years ago

@maximbaz can you check the possibility of adding a package that supports icons out of the box?

maximbaz commented 4 years ago

Sure!

As was mentioned in this thread, there are no technical challenges in building various flavors of nnn, not for a maintainer nor for a regular person compiling the tool locally. It's uncommon to provide distro packages for all possible combinations of compilation flags, so instead we provide only one binary, usually the one that is based on default options (as decided by the Makefile).

As I understand, in this particular case there are even two different ways to get icons, using O_ICONS=1 and O_NERD=1, which means there are three potentially different flavors of nnn today. If at some point in the future there will be another O_SOMETHING=1 flag, the number of possible flavors of nnn will grow exponentially (no flags, O_ICONS=1, O_NERD=1, O_SOMETHING=1, O_ICONS=1 + O_SOMETHING=1, O_NERD=1 + O_SOMETHING=1) and we can't possibly be providing all of them as official distro packages.

Having said that, if you think providing multiple pre-compiled flavors of nnn is something that makes sense, consider providing them on Github release, so that people can download the binary flavor they like.

Finally, on Arch Linux people can easily make use of AUR, a place to share recipes for custom builds, for example someone has already provided nnn-icons package, a flavor that adds O_ICONS=1.

jarun commented 4 years ago

if you think providing multiple pre-compiled flavors of nnn is something that makes sense, consider providing them on Github release, so that people can download the binary flavor they like.

We can't add 2 different flavours for every distro. In commit 56757860d438c3ab346447f20e996011407360a2 I have added support for generating 2 additional static binaries with icons-in-terminal and patched nerd font support.

I don't have a AUR login anymore. Can you please request the maintainer of the nnn-icons package to generate a package for nnn-nerd as well? Probably after the next release.

maximbaz commented 4 years ago

Cool!

The packages on AUR need active maintainers, it doesn't help just generating other packages and leaving them lying on AUR - but don't worry, we don't need to pre-create all possible AUR packages, once there is an Arch user who actually wants to use nnn with Nerd fonts, they will easily upload the AUR package 😉

jarun commented 4 years ago

Please notify the nnn-icons maintainer anyway in case he is interested. The nerd support is still unreleased so he may not know.

raghavmallampalli commented 4 years ago

The nerd font icons seem to have some misalignments on the master branch. There seems to have been some discussion regarding this on the nerd font PR. Is there some modification to be made to get the icons to align? Also, is there any way to set the colors of the icons according to user preferences? For example, use the same coloring as the text (blue for directories, green for executables etc.)

image

jarun commented 4 years ago

@raghavmallampalli

some misalignments

Can you please provide some more details on what you mean? I don't think all icons take the same space.

Also, is there any way to set the colors of the icons according to user preferences?

Yes, trivial change in icons.h to change the icon color.

jarun commented 4 years ago

blue for directories, green for executables etc.

Currently no color is specified for these 2. Which means the color from NNN_FCOLORS is used.

raghavmallampalli commented 4 years ago

Can you please provide some more details on what you mean? I don't think all icons take the same space.

Right, sorry for being vague. What I meant is that the larger icons push the text aside while being displayed. It should be visible in the screenshot (see .pythonrc.py). Would it be possible to get the text to line up to the same column? Another example in case it's not too visible in the above one:

image

Yes, trivial change in icons.h to change the icon color.

Thanks! This worked for me.

Currently no color is specified for these 2. Which means the color from NNN_FCOLORS is used.

What I meant is, have the color of the icon always match the text next to it. It was just an arbitrary example and I prefer the granular control of icons.h, which I now know about.

As in aside, I think that the wiki should advise adding the directory where the executable is placed with sudo make strip install to $PATH. On master, for Ubuntu 18.04 I believe that is /usr/local/bin/. I've found this to be far more convenient than moving the executable manually to /bin each time.

jarun commented 4 years ago

What I meant is, have the color of the icon always match the text next to it.

I think if you specify 0, that would do.

As in aside, I think that the wiki should advise adding the directory where the executable is placed

I think it's pretty standard. Tons of packagers have nnn. Can't spend time on things done years back and working in standard repos.

jarun commented 4 years ago

In fact the installation section says: "PREFIX is supported, in case you want to install to a different location."

Please spend some time on the docs. nnn is simple to start with, but has tons of interesting things in it.

jarun commented 4 years ago

Regarding the icons issue, @snide and @KlzXS is there anything we can do about this?

snide commented 4 years ago

I can look into the spacing issue with Nerd Fonts. Unfortunately it's more a problem with NF themselves, not NNN. The few I've fixed were mostly fixed by changing to an alternate icon that didn't have the spacing issue.

Not a great way to test this stuff without a full list of faked extensions. I can harden what's in there and put up an eyeball PR tomorrow with some manual checking if that's satisfactory?

snide commented 4 years ago

Also, and just as a reminder, NF provides patched fonts. What one person might see for their font of choice might be different for another font of choice. They should carry the same irregularities, but there's quite a few patched fonts they support. Something to keep in mind.

jarun commented 4 years ago

I can harden what's in there and put up an eyeball PR tomorrow with some manual checking if that's satisfactory?

Sure thing!

gyvess commented 4 years ago

Another minor cosmetic gripe, but can you add an option to remove/customize the arrows that appear if there are more files above of below the currently highlighted file? I personally don't like the look and find the file count in the status bar enough to know my relative current position. While I would disable it, at the same time I can also see someone else wanting to customize the arrows with a different glyph/ligature instead.

jarun commented 4 years ago

Sorry, can't add a program option for something this trivial. Initially I too thought it's not of much use, now I see it's a very quick way to know if there's more below or above.

find the file count in the status bar enough

It's not simple enough due to scrolloff and needs you to do the math we are doing in code, mentally. To be more generic - why would you read numbers while scrolling if a single character tells you what you want to know.

Finally you can remove the blocks enclosing the following lines from the code (only 1 instance each) to get rid of it:

addch('^');
// and
addch('v');
jarun commented 4 years ago

@snide any update on the fonts? I am planning for a release. It would be good to wrap this up as this will be the first release with Nerd support.

jarun commented 4 years ago

Looks like @snide is not available. @KlzXS can you help with the nerd icon alignment issue?

KlzXS commented 4 years ago

I can take a look at it later today. But don't get your hopes up, I have a feeling that this is more of an issue with the fonts themselves.

jarun commented 4 years ago

Very much possible, just take a look. We are overdue for a release.

KlzXS commented 4 years ago

The two things @raghavmallampalli described seem to not have much in common.

The first shows misaligned icons, but they are otherwise correctly printed. I don't have thins behavior with any icons with my nerdfonts. This may be an error with the specific font, but I think they have an automated system for patching so I'm not sure about this.

The second is an issue I also experience, but I only have an extra space on the right side. @raghavmallampalli has an extra space on the left for the .sh script which I don't. For some reason only certain icons are printed with double width.

The common thread for the second problem seems to be that all those icons come from codepoints in the "CJK Compatibility Ideographs" section. That seems to be a section for some Chinese characters in the unicode standard. I assume that replacing those characters with some others would solve that issue. I have nothing for the misalignment that I can't reproduce.

jarun commented 4 years ago

Cool! The icons are meant for editing to choice and I have linked the relevant header file from the docs half an hr. back. I think we are good here.

0xACE commented 4 years ago

I have nothing for the misalignment that I can't reproduce.

I get the feeling that how the terminals render the text affect how this problem presents itself

E.g. my terminal doesn't really care much for ligatures and what not...