```
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22515 vaio 20 0 60348 48712 2240 S 0.0 0.6 0:01.11 ncdu /
-22574 vaio 20 0 17588 4320 2584 S 0.0 0.1 0:00.44 nnn -d /
+22574 vaio 20 0 17588 4320 2584 S 0.0 0.1 0:00.44 nnn /
```
`nnn` vs. mc vs. ranger memory usage while viewing a directory with 11244 files, sorted by size:
#### Cmdline options
- usage: nnn [-d] [-S] [-v] [h] [PATH]
+ usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]
The missing terminal file browser for X.
PATH directory to open [default: current dir]
optional arguments:
- -d start in detail view mode
+ -l start in light mode (fewer details)
-i start in navigate-as-you-type mode
-p path to custom nlay
-S start in disk usage analyzer mode
Add the following to your shell's rc file for the best experience:
-1. Always open `nnn` in detail mode:
+1. Use a shorter and sweeter alias:
- alias n='nnn -d'
-2. Set a desktop file manager to open directories with (if you need one). E.g.:
+ alias n=nnn
+2. Optionally open all text files in EDITOR (fallback vi):
+
+ export NNN_USE_EDITOR=1
+3. Set a desktop file manager to open directories with (if you ever need to). E.g.:
export NNN_DE_FILE_MANAGER=thunar
-3. Start `nnn`.
+4. Start `nnn`.
n
static int bsizeorder = 0; /* Set to 1 to sort by blocks used including content */
static int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
static int showhidden = 0; /* Set to 1 to show hidden files by default */
-static int showdetail = 0; /* Set to show additional file info */
+static int showdetail = 1; /* Set to 0 to show fewer file info */
static struct assoc assocs[] = {
{ "\\.(c|cpp|h|log|md|py|sh|txt)$", "text" },
n()
{
if [ -n "$1" ]; then
- nnn -d "$1"
+ nnn "$1"
else
- nnn -d
+ nnn
fi
if [ -f $NNN_TMPFILE ]; then
export NNN_TMPFILE="/tmp/nnn"
function n --description 'support nnn quit and change directory'
- nnn -d $argv[1]
+ nnn $argv[1]
if test -e $NNN_TMPFILE
. $NNN_TMPFILE
n()
{
if [ -n "$1" ]; then
- nnn -d "$1"
+ nnn "$1"
else
- nnn -d
+ nnn
fi
if [ -f $NNN_TMPFILE ]; then
.Nd the missing terminal file browser for X
.Sh SYNOPSIS
.Nm
-.Op Ar -d
+.Op Ar -l
.Op Ar -i
.Op Ar -p custom_nlay
.Op Ar -S
.Nm
supports the following options:
.Pp
-.Fl d
- start in detail view mode
+.Fl l
+ start in light mode (fewer details)
.Pp
.Fl i
start in navigate-as-you-type mode
printw("%s\n", g_buf);
}
-static void (*printptr)(struct entry *ent, int active) = &printent;
-
static char*
coolsize(off_t size)
{
attroff(A_REVERSE);
}
+static void (*printptr)(struct entry *ent, int active) = &printent_long;
+
static char
get_fileind(mode_t mode, char *desc)
{
static void
usage(void)
{
- fprintf(stdout, "usage: nnn [-d] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\
+ fprintf(stdout, "usage: nnn [-l] [-i] [-p custom_nlay] [-S] [-v] [-h] [PATH]\n\n\
The missing terminal file browser for X.\n\n\
positional arguments:\n\
PATH directory to open [default: current dir]\n\n\
optional arguments:\n\
- -d start in detail view mode\n\
+ -l start in light mode (fewer details)\n\
-i start in navigate-as-you-type mode\n\
-p path to custom nlay\n\
-S start in disk usage analyzer mode\n\
exit(1);
}
- while ((opt = getopt(argc, argv, "dSip:vh")) != -1) {
+ while ((opt = getopt(argc, argv, "dlSip:vh")) != -1) {
switch (opt) {
case 'S':
- bsizeorder = 1; // fallthrough
- case 'd':
- /* Open in detail mode, if set */
- showdetail = 1;
- printptr = &printent_long;
+ bsizeorder = 1;
+ break;
+ case 'l':
+ showdetail = 0;
+ printptr = &printent;
break;
case 'i':
filtermode = 1;
case 'v':
fprintf(stdout, "%s\n", VERSION);
return 0;
+ case 'd':
+ fprintf(stderr, "option -d is deprecated, detail view mode is default now.\n");
+ break;
case 'h': // fallthrough
default:
usage();