jarun / nnn

nĀ³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
18.89k stars 751 forks source link

How to always show the file extension even the filename is longer than the width of terminal? #1444

Closed amalgame21 closed 2 years ago

amalgame21 commented 2 years ago

I am new to nnn, I need some help. I would like to use nnn to replace ranger since ranger is quite slow on raspberry pi.

In ranger, if the filename is longer than the width of the terminal it will always display the extension and omit some portion of the file name for example, "anImageWithALongName.jpg" will become "anImageWithALo~.jpg"

but I cannot find a way to do this in nnn.

Also I cannot managed to use quitcd when I launch nnn with tmux function provided in the wiki.

jarun commented 2 years ago

it will always display the extension and omit some portion of the file name

And mostly that "some portion of the file name" would be shorter than the actual filename shown in the row for the file. So we just show the extension. If you want to see the full name, press f.

Sorry, can't help with local environment issues. Numerous users use those. Please figure it out yourself.

N-R-K commented 2 years ago

if the filename is longer than the width of the terminal it will always display the extension and omit some portion of the file name.

The file extension is displayed on the bottom in nnn.

for example, "anImageWithALongName.jpg" will become "anImageWithALo~.jpg"

Just curious, is ranger able to correctly cutoff a filename like this: šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦šŸ‘Øā€šŸ‘©ā€šŸ‘¦.txt (repeat the emoji as many times needed to make it not fit on the screen anymore)

Or does it cut off the filename in such a way that the text glitches out?

amalgame21 commented 2 years ago

it will always display the extension and omit some portion of the file name

And mostly that "some portion of the file name" would be shorter than the actual filename shown in the row for the file. So we just show the extension. If you want to see the full name, press f.

Sorry, can't help with local environment issues. Numerous users use those. Please figure it out yourself.

oh just find out that the extension is displayed on the bottom in nnn, which is nice. But it just show the information of the highlighted file. In some folder I have some video files and subtitles with the same long filename which are just different in the extension e.g. (mkv/mp4/ass/srt) Sometime I may select the wrong file (subtitle) when I want to play the video on mpv. Maybe I have to look down the bottom to check for the correct extension file everytime before I play the video.

Just find out that the color of nerd font icon is different between mkv mp4 ass and srt maybe it is also a good indicator for identifying differnet extension.

jarun commented 2 years ago

Yes, please use the icons to differentiate.

amalgame21 commented 2 years ago

Just tested it out They seems correctly cutoff filename.

N-R-K commented 2 years ago

Just tested it out They seems correctly cutoff filename.

Hmmm, perhaps python standard library have functions to deal with grapheme clusters. C doesn't, and I don't think we will add a new library dependency just for this especially when the extension is shown at the bottom (+ icons if you use them).