Closed jarun closed 6 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
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 !
.
Option -S
to start in disk usage analyzer mode added at https://github.com/jarun/nnn/commit/971895e8736553e6f86a788776079459018201f8.
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.
If you don't mind raising a PR, please do (with the new option, current behaviour as default).
Here are some sane bindings for an emacs user:
p
for previous item (bind the PAGER action to P
instead)n
for next itemw
to copy the file path<
to go the beginning of the list>
to go to the end of the list^
and u
to go to the parent dir or the back action (unbind ^
from SEL_HOME, ^
and u
are intuitive to UP or Go to parent action).I have commited these in my fork.
Thanks for this project.
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.
@jarun No worries. I can retain the bindings in my fork.
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
But that would also need a bookmarks file.
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.
Bookmarks implemented at https://github.com/jarun/nnn/commit/af0c37898aedaad4f47dcce471f9faee170d75ea. The shortcut is b
.
Hmm we can have 10 bookmarks file with mutiple paths on it or 10 bookmark paths which we can access with b
?
Please check the documentation and try it out. It's already in on master.
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'
@vaygr I'll check. Thanks!
You can change the locker in nlay
if you wish.
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.
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.
@jarun ah, I must've missed it, sorry about that. Yeah, it's fine to have it then :)
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.
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.
regarding exiftool: it does provide additional info for image files from metadata. However, it has certain limitations where mediainfo works better:
I am going to retain mediainfo as default, exiftool as override.
Ah, got it. Thanks a lot!
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.
exiftool support added at 2b963634bc89ce5ed4e3c086b42f93b2e2f3f733.
Custom color support added in be8e4d85524a454096c960af32f9571dbad60a08.
Beautiful, highly appreciated!
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.
@superDuperCyberTechno please follow https://github.com/jarun/nnn#cd-on-quit.
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.
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:
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)?
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?
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)
@jarun No, open
does not spawn subprocesses under the calling process. Things are spawned directly under launchd (the pid 1 process on macOS).
So I guess the patch has to be Debian specific. @Rahi374 can you raise the PR so it affects only Debian?
Rolled at #58.
Feel free to suggest new features to add to the list below. Some of the features may still be master-only.
NNN_NOWAIT
to unblock nnn (DE specific)xdg-open
on Linux andopen(1)
on OS X as desktop openernlay
vlock
as default terminal screensavernlay
- a shell script for actions like open desktop search utility, run screensaverless
Q
to quit to current dir (needs external shell integration)^Q
to quit (even from filter mode)-
to jump to last directory~
(HOME) at chdir promptlstat()
details)NNN_COPIER
)Up
andDown
at the first and last entries