jarun / nnn

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

ToDo list #1

Closed jarun closed 6 years ago

jarun commented 7 years ago

Feel free to suggest new features to add to the list below. Some of the features may still be master-only.

ghost commented 7 years ago

The 3 first additions would be enough to replace ncdu.

run command on selected path would be useful since ^K cannot be used remotely

jarun commented 7 years ago

press r to refresh the list

^L does that already

press del/R to delete (recursive) with confirmation

I would like to keep nnn a non-destructive file browser. It would be unnecessary liability (wrt. the cases like over the network, large file, nnn exited before operation completed, circular links and so on...). You can always use ! to drop into a shell or o to open a desktop file browser of your choice. Have it your way!

add option to start in disk usage analyzer mode

sure!

press ?? to run command on selected path (replace % with selected path)

once again, you have !.

jarun commented 7 years ago

Option -S to start in disk usage analyzer mode added at https://github.com/jarun/nnn/commit/971895e8736553e6f86a788776079459018201f8.

FastThenLeft commented 7 years ago

I know you don't want to add color, but would you consider just a simple toggle between no color and the "auto" colors used by the normal "ls" command (ls --color=auto)? Nothing more than that - no custom colors.

jarun commented 7 years ago

If you don't mind raising a PR, please do (with the new option, current behaviour as default).

kaushalmodi commented 7 years ago

Here are some sane bindings for an emacs user:

I have commited these in my fork.

Thanks for this project.

jarun commented 7 years ago

thanks @kaushalmodi for sharing. I retained the vim bindings because they come from noice. At this point the development focus is more on new features than new navigational shortcuts. Personally I want to make it friendly towards users who are from the GUI world and are much more comfortable with the up, down arrows etc. I believe adding more shortcut keys are just going to confuse them.

kaushalmodi commented 7 years ago

@jarun No worries. I can retain the bindings in my fork.

AndreaHasani commented 7 years ago

A good feature would be the ability to configure shortcuts to change directory. For example map gd to Documents and gD to downloads It will incrase the navigation speed alot if we are able to configure some custom shortcuts for going to specific direcotries.

Thanks

jarun commented 7 years ago

But that would also need a bookmarks file.

jarun commented 7 years ago

I am thinking of having something like this in the rc file:

export NNN_BMS='d:/abs/path/to/Documents;D:/abs/path/to/Downloads'

up to 10 bookmarks. nnn will parse the string (if defined) at startup.

jarun commented 7 years ago

Bookmarks implemented at https://github.com/jarun/nnn/commit/af0c37898aedaad4f47dcce471f9faee170d75ea. The shortcut is b.

AndreaHasani commented 7 years ago

Hmm we can have 10 bookmarks file with mutiple paths on it or 10 bookmark paths which we can access with b ?

jarun commented 7 years ago

Please check the documentation and try it out. It's already in on master.

vaygr commented 7 years ago

Hi @jarun

it'd be great to have exiftool as an alternative to mediainfo. It can also pull a lot of info from metadata, as in the example below on an image:

mediainfo:

General
Complete name                            : shot-2017-06-19_220424.png
Format                                   : PNG
Format/Info                              : Portable Network Graphic
File size                                : 226 KiB

Image
Format                                   : PNG
Format/Info                              : Portable Network Graphic
Format_Compression                       : LZ77
Width                                    : 1 920 pixels
Height                                   : 1 058 pixels
Bit depth                                : 32 bits
Compression mode                         : Lossless
Stream size                              : 226 KiB (100%)

exiftool:

File Name                       : shot-2017-06-19_220424.png
Directory                       : .
File Size                       : 226 kB
File Modification Date/Time     : 2017:06:19 22:04:27-04:00
File Access Date/Time           : 2017:07:02 07:25:42-04:00
File Inode Change Date/Time     : 2017:06:19 22:04:27-04:00
File Permissions                : rw-r--r--
File Type                       : PNG
File Type Extension             : png
MIME Type                       : image/png
Image Width                     : 1920
Image Height                    : 1058
Bit Depth                       : 8
Color Type                      : RGB with Alpha
Compression                     : Deflate/Inflate
Filter                          : Adaptive
Interlace                       : Noninterlaced
Significant Bits                : 8 8 8 8
Image Size                      : 1920x1058
Megapixels                      : 2.0

The point is it's quite minimal and has no dependencies other than Perl and you can actually customize output by with command line flags, e.g. you could output only the fields you want:

exiftool -T -FileSize -ImageSize -FileType -FileName -FileModifyDate -d 'modified on %F'
jarun commented 7 years ago

@vaygr I'll check. Thanks!

vaygr commented 7 years ago

Yeah, for example sxiv allows you to specify the media info program which you can customize as per your needs.

Also please take a look at the physlock as alternative terminal locker.

jarun commented 7 years ago

You can change the locker in nlay if you wish.

vaygr commented 7 years ago

About nlay: it's great, but unfortunately it gets installed system-wide, and it's not a good idea to modify the script after it gets installed, since it'd invalidate package integrity in the system.

It'd be nice to specify nlay path though to, e.g. ~/bin/nlay or any other script which would do respective actions for nnn.

jarun commented 7 years ago

RTFM please! There is an option to specify a custom nlay. I am surprised people suggest features without even reading the details which are available.

vaygr commented 7 years ago

@jarun ah, I must've missed it, sorry about that. Yeah, it's fine to have it then :)

vaygr commented 7 years ago

And I think the reason I missed it because when I opened nlay source code, it suggested to modify the script and change default options. Just a bit confusing I think.

jarun commented 7 years ago

It's in nlay too. The 3rd note:

# 3. nlay is OVERWRITTEN during nnn upgrade. You can store your custom nlay in a 
#    location other than the default and have an alias with nnn option '-p' to   
#    invoke it. Remember it might break or lack new capabilities added to nlay   
#    in future releases. Check the file diff once in a while.
jarun commented 7 years ago

regarding exiftool: it does provide additional info for image files from metadata. However, it has certain limitations where mediainfo works better:

  1. No recursive directory scanning in exiftool
  2. Data for video files is not so informative as with mediainfo

I am going to retain mediainfo as default, exiftool as override.

vaygr commented 7 years ago

Ah, got it. Thanks a lot!

vaygr commented 7 years ago

I've just figured out, master branch now includes bold blue color by default for directories. On terminal with black background it doesn't look so well. Would be great to have ability to change the color as per ANSI spec (8 colors) instead of just only disabling it.

jarun commented 7 years ago

exiftool support added at 2b963634bc89ce5ed4e3c086b42f93b2e2f3f733.

jarun commented 7 years ago

Custom color support added in be8e4d85524a454096c960af32f9571dbad60a08.

vaygr commented 7 years ago

Beautiful, highly appreciated!

superDuperCyberTechno commented 7 years ago

The man page states that Q quits and changes directory. That makes me think that I can exit nnn and end up in the directory I was in when quitting nnn. That does not happen. Have I misunderstood the functionality?

And if not: Can we get the ability to exit nnn and end up in its current directory? Like ! but reusing the same terminal instance, not spawning a new one.

jarun commented 7 years ago

@superDuperCyberTechno please follow https://github.com/jarun/nnn#cd-on-quit.

ghost commented 7 years ago

I would like to keep nnn a non-destructive file browser. It would be unnecessary liability (wrt. the corner cases). You can always use ! to drop into a shell or o to open a desktop file browser of your choice. Have it your way!

I realize that this is advertised as a file browser and not a file manager, but having to switch visual paradigms in order to move/copy/delete files does not make for a good workflow. That would mean using a separate file browser/manager/shell for actual file manipulation.

If a straight rm is the concern, consider the XDG trash directory instead.

Rahi374 commented 7 years ago

I wish I could open a file and still be able to use nnn or close nnn without closing a file. I found that this works. Should I add a PR?

diff --git a/nnn.c b/nnn.c
index 3b0ac02..f5ecb39 100644
--- a/nnn.c
+++ b/nnn.c
@@ -2211,7 +2211,7 @@ nochange:
                                }

                                /* Invoke desktop opener as last resort */
-                               spawn(utils[2], newpath, NULL, NULL, F_NOTRACE);
+                               spawn(utils[2], newpath, NULL, NULL, F_NOTRACE|F_NOWAIT);
                                continue;
                        }
                        default:
jarun commented 7 years ago

Which version on nnn and which OS are you using? I think a more direct question would be - is your opener xdg-open (on Linux) or open (on OS X)?

jarun commented 7 years ago

It works without any issues on Linux for me on Ubuntu 16.04. xdg-open handles it that way.

@zmwangx do you see the above issue (nnn is unusable till the spawned GUI application quits) on OS X?

Rahi374 commented 7 years ago

Hm. I'm on Debian Buster x86_64 with nnn version 1.4 ps aux confirms that xdg-open is running, and nnn is not responding. (At least without my above patch)

zmwangx commented 7 years ago

@jarun No, open does not spawn subprocesses under the calling process. Things are spawned directly under launchd (the pid 1 process on macOS).

jarun commented 7 years ago

So I guess the patch has to be Debian specific. @Rahi374 can you raise the PR so it affects only Debian?

jarun commented 6 years ago

Rolled at #58.