jarun/nnn

ToDo list

jarun opened this issue ยท 48 comments

jarun commented

Rolled from #629.

Cooking

  • audit and adapt all plugins for macOS
  • compile-in Alexey Tourbin's QSORT macro
  • support Nerd Font patched icons [make O_NERD=1]
  • auto-generate static binaries with icons support
  • enhance plugin dups to delete duplicates interactively
  • plugin autojump now supports jump and zoxide
  • support gio trash to Trash [export NNN_TRASH=2] (#740)
  • quit program on double Esc in normal mode (#775)
  • ^Space replaces ^K for range selection/clear selection
  • show selection symbol (+) next to filename in detail mode (#741)
  • error & quit on Q if no selection, else pick to stdout
  • repeat ^T to cycle sort by time, size and clear
  • option -U to show user & group info in status bar
  • option -J to disable auto-proceed on select (#713)
  • option -D to show dirs in context color with NNN_FCOLORS
  • honor option -C for context colors
  • show indicators if more entries above/below listing (#744)
  • show missing utility name in flash msg (#753)
  • exit preview-tabbed on ^C (#727)
  • invoke GNU sed (gsed) on macOS (#728)
  • fix HW cursor moves to wrong line (#735)
  • fix rollover bug with multiline scroll (#743)
  • fix input stream not listed with -s/-S (#777)
  • fix locker not being invoked
  • make target upx for additional binary compression
  • compress auto-generated static binaries with upx
  • make variable O_NOSSN to compile out sessions
  • make variable O_NOUG to compile out user & group info

Up for grabs

  • generate static binary for arm and aarch with new releases (see #623)
  • support predefined filters like bookmarks

For anything else please discuss in this thread.

Contribution guideline.

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

jarun commented

Which distro is not allowing you to compile?

0xACE commented

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

We have all the instructions here.

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

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.

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

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

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

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

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.

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

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.

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

jarun commented

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

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

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 commented

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

0xACE commented

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

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

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

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

jarun commented

@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

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

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

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

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.

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

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

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

@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

blue for directories, green for executables etc.

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

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

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

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

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

snide commented

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

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

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

Sure thing!

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

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

@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

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

KlzXS commented

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

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

KlzXS commented

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

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

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