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

ToDo list #719

Closed
28 of 30 tasks
jarun opened this issue Sep 5, 2020 · 48 comments
Closed
28 of 30 tasks

ToDo list #719

jarun opened this issue Sep 5, 2020 · 48 comments
Labels

Comments

@jarun
Copy link
Owner

jarun commented Sep 5, 2020

Rolled from #629.

Cooking

Up for grabs

For anything else please discuss in this thread.

Contribution guideline.

@timsofteng
Copy link

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

@jarun
Copy link
Owner Author

jarun commented Oct 4, 2020

Which distro is not allowing you to compile?

@0xACE
Copy link
Collaborator

0xACE commented Oct 4, 2020

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

jarun commented Oct 4, 2020

We have all the instructions here.

@maximbaz
Copy link
Contributor

maximbaz commented Oct 4, 2020

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

jarun commented Oct 4, 2020

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

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

jarun commented Oct 5, 2020

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

@timsofteng
Copy link

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

0xACE commented Oct 5, 2020

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

jarun commented Oct 5, 2020

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

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

jarun commented Oct 6, 2020

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

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

@jarun
Copy link
Owner Author

jarun commented Oct 14, 2020

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

ghost commented Oct 14, 2020

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

jarun commented Oct 14, 2020

No, because of several reasons:

  • we don't show line numbers like vim
  • without that we don't think it's convenient to count 15 lines (6 was conveniently easy) and then issue 15j
  • nnn is not an editor
  • nnn does fast line redraws and also supports half and full page jumps

@jarun
Copy link
Owner Author

jarun commented Oct 14, 2020

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

@0xACE
Copy link
Collaborator

0xACE commented Oct 14, 2020

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

ghost commented Oct 14, 2020

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

jarun commented Oct 14, 2020

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

jarun commented Oct 14, 2020

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

@jarun
Copy link
Owner Author

jarun commented Oct 14, 2020

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

Awebb commented Oct 19, 2020

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

jarun commented Oct 20, 2020

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

@maximbaz
Copy link
Contributor

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

jarun commented Oct 20, 2020

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 5675786 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
Copy link
Contributor

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

jarun commented Oct 20, 2020

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

@raghavmallampalli
Copy link

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

jarun commented Nov 6, 2020

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

jarun commented Nov 6, 2020

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

raghavmallampalli commented Nov 7, 2020

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

jarun commented Nov 7, 2020

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

jarun commented Nov 7, 2020

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

jarun commented Nov 7, 2020

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

@snide
Copy link
Collaborator

snide commented Nov 7, 2020

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

snide commented Nov 7, 2020

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

jarun commented Nov 7, 2020

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

gyvess commented Nov 10, 2020

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

jarun commented Nov 10, 2020

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

jarun commented Nov 10, 2020

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

jarun commented Nov 13, 2020

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

@KlzXS
Copy link
Collaborator

KlzXS commented Nov 13, 2020

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

jarun commented Nov 13, 2020

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

@KlzXS
Copy link
Collaborator

KlzXS commented Nov 13, 2020

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

jarun commented Nov 13, 2020

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.

@jarun jarun mentioned this issue Nov 15, 2020
21 tasks
Repository owner locked as resolved and limited conversation to collaborators Nov 15, 2020
@jarun jarun closed this as completed Nov 15, 2020
@0xACE
Copy link
Collaborator

0xACE commented Nov 16, 2020

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...

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

No branches or pull requests

10 participants