mirror of
https://github.com/jarun/nnn.git
synced 2025-03-01 20:39:20 +00:00
Update documentation (man, README)
This commit is contained in:
parent
86c3f75512
commit
c037f0c55b
2 changed files with 56 additions and 43 deletions
36
README.md
36
README.md
|
@ -11,6 +11,7 @@ Noice is Not Noice, a noicer fork...
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
- [Usage](#usage)
|
- [Usage](#usage)
|
||||||
- [Keyboard shortcuts](#keyboard-shortcuts)
|
- [Keyboard shortcuts](#keyboard-shortcuts)
|
||||||
|
- [Filters](#filters)
|
||||||
- [File type abbreviations](#file-type-abbreviations)
|
- [File type abbreviations](#file-type-abbreviations)
|
||||||
- [Help](#help)
|
- [Help](#help)
|
||||||
- [Copy current file path to clipboard](#copy-current-file-path-to-clipboard)
|
- [Copy current file path to clipboard](#copy-current-file-path-to-clipboard)
|
||||||
|
@ -54,10 +55,11 @@ I chose to fork because:
|
||||||
- full name of currently selected file
|
- full name of currently selected file
|
||||||
- Case-insensitive alphabetic content listing instead of upper case first
|
- Case-insensitive alphabetic content listing instead of upper case first
|
||||||
- Roll over at the first and last entries of a directory (with Up/Down keys)
|
- Roll over at the first and last entries of a directory (with Up/Down keys)
|
||||||
|
- Removed navigation restriction with relative paths (and let permissions handle it)
|
||||||
- Sort entries by file size (largest to smallest)
|
- Sort entries by file size (largest to smallest)
|
||||||
- Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`)
|
- Shortcut to invoke file name copier (set using environment variable `NNN_COPIER`)
|
||||||
- File associations
|
- File associations
|
||||||
- Environment variable `NNN_OPENER` to override all associations and open all files with your desktop environment's default file opener. Examples:
|
- Environment variable `NNN_OPENER` to let desktop opener handle it all. E.g.:
|
||||||
|
|
||||||
export NNN_OPENER=xdg-open
|
export NNN_OPENER=xdg-open
|
||||||
export NNN_OPENER=gnome-open
|
export NNN_OPENER=gnome-open
|
||||||
|
@ -67,8 +69,8 @@ I chose to fork because:
|
||||||
- Remove video file associations (to each his own favourite video player)
|
- Remove video file associations (to each his own favourite video player)
|
||||||
- Associate common audio mimes with lightweight [fmedia](http://fmedia.firmdev.com/)
|
- Associate common audio mimes with lightweight [fmedia](http://fmedia.firmdev.com/)
|
||||||
- Associate PDF files with [zathura](https://pwmt.org/projects/zathura/)
|
- Associate PDF files with [zathura](https://pwmt.org/projects/zathura/)
|
||||||
- Removed `less` as default file opener
|
|
||||||
- Use environment variable `NNN_FALLBACK_OPENER` to open other non-associated files
|
- Use environment variable `NNN_FALLBACK_OPENER` to open other non-associated files
|
||||||
|
- Removed `less` as default file opener (there is no universal standalone opener utility)
|
||||||
- Compilation
|
- Compilation
|
||||||
- Use `-O3` for compilation, fixed warnings
|
- Use `-O3` for compilation, fixed warnings
|
||||||
- Added compilation flag `-march=native`
|
- Added compilation flag `-march=native`
|
||||||
|
@ -96,14 +98,14 @@ Start nnn (default: current directory):
|
||||||
|
|
||||||
| Key | Function |
|
| Key | Function |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `Down`, `j`, `Ctrl-n` | next entry |
|
| `Up`, `k`, `^P` | previous entry |
|
||||||
| `Up`, `k`, `Ctrl-p` | previous entry |
|
| `Down`, `j`, `^N` | next entry |
|
||||||
| `>`, `Enter`, `l` | open file or enter dir |
|
| `PgUp`, `^U` | scroll half page up |
|
||||||
| `<`, `Backspace`, `h` | parent dir |
|
| `PgDn`, `^D` | scroll half page down |
|
||||||
| `Page Down`, `Ctrl-d` | one page down |
|
| `Home`, `^`, `^A` | jump to first dir entry |
|
||||||
| `Page Up`, `Ctrl-u` | one page up |
|
| `End`, `$`, `^E` | jump to last dir entry |
|
||||||
| `Home`, `Ctrl-a`, `^` | jump to first dir entry |
|
| `Right`, `Enter`, `l`, `^M` | open file or enter dir |
|
||||||
| `End`, `Ctrl-e`, `$` | jump to last dir entry |
|
| `Left`, `Backspace`, `h`, `^H` | parent dir |
|
||||||
| `~` | jump to home dir |
|
| `~` | jump to home dir |
|
||||||
| `/`, `&` | filter dir contents |
|
| `/`, `&` | filter dir contents |
|
||||||
| `c` | show change dir prompt |
|
| `c` | show change dir prompt |
|
||||||
|
@ -112,13 +114,21 @@ Start nnn (default: current directory):
|
||||||
| `s` | toggle sort by file size |
|
| `s` | toggle sort by file size |
|
||||||
| `t` | toggle sort by modified time |
|
| `t` | toggle sort by modified time |
|
||||||
| `!` | spawn a shell in current dir |
|
| `!` | spawn a shell in current dir |
|
||||||
|
| `z` | run `top` |
|
||||||
| `e` | edit entry in `vim` |
|
| `e` | edit entry in `vim` |
|
||||||
| `p` | open entry with `less` pager |
|
| `p` | open entry with `less` pager |
|
||||||
| `z` | run `top` |
|
| `^K` | invoke file name copier |
|
||||||
| `Ctrl-k` | invoke file name copier |
|
| `^L` | redraw window |
|
||||||
| `Ctrl-l` | redraw window |
|
|
||||||
| `q` | quit |
|
| `q` | quit |
|
||||||
|
|
||||||
|
### Filters
|
||||||
|
|
||||||
|
Filters support regexes to display only the matched entries in the current directory view. This effectively allows searching through the directory tree for a particular entry.
|
||||||
|
|
||||||
|
Filters do not stack on top of each other. They are applied anew every time. An empty filter expression resets the filter.
|
||||||
|
|
||||||
|
If nnn is invoked as root the default filter will also match hidden files.
|
||||||
|
|
||||||
### File type abbreviations
|
### File type abbreviations
|
||||||
|
|
||||||
The following abbreviations are used in the detail view:
|
The following abbreviations are used in the detail view:
|
||||||
|
|
63
nnn.1
63
nnn.1
|
@ -3,30 +3,22 @@
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
.Nm nnn
|
.Nm nnn
|
||||||
.Nd small file browser
|
.Nd free, fast, friendly file browser
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm nnn
|
.Nm nnn
|
||||||
.Op Ar dir
|
.Op Ar dir
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
is a simple and efficient file browser that gets out of your way
|
(Noice is Not Noice) is a fork of the noice terminal file browser with improved desktop integration, file associations and navigation. It remains a simple and efficient file browser that stays out of your way.
|
||||||
as much as possible. It was initially implemented to be controlled
|
|
||||||
with a TV remote control.
|
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
defaults to the current directory if
|
defaults to the current directory if
|
||||||
.Ar dir
|
.Ar dir
|
||||||
is not specified. As an extra feature, if
|
is not specified.
|
||||||
.Ar dir
|
|
||||||
is a relative path,
|
|
||||||
.Nm
|
|
||||||
will not go back beyond the first component of the path using standard
|
|
||||||
navigation key presses.
|
|
||||||
.Pp
|
.Pp
|
||||||
.Nm
|
.Nm
|
||||||
supports both vi-like and emacs-like key bindings in the default
|
supports both vi-like and emacs-like key bindings in the default
|
||||||
configuration. The default key bindings are described below;
|
configuration. The default key bindings are listed below.
|
||||||
their functionality is described in more detail later.
|
|
||||||
.Pp
|
.Pp
|
||||||
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
.Bl -tag -width "l, [Right], [Return] or C-mXXXX" -offset indent -compact
|
||||||
.It Ic k, [Up] or C-p
|
.It Ic k, [Up] or C-p
|
||||||
|
@ -45,18 +37,20 @@ Move to the last entry.
|
||||||
Open file or enter directory.
|
Open file or enter directory.
|
||||||
.It Ic h, C-h, [Left] or [Backspace]
|
.It Ic h, C-h, [Left] or [Backspace]
|
||||||
Back up one directory level.
|
Back up one directory level.
|
||||||
|
.It Ic ~
|
||||||
|
Change to the HOME directory.
|
||||||
.It Ic / or &
|
.It Ic / or &
|
||||||
Change filter (see below for more information).
|
Change filter (see below for more information).
|
||||||
.It Ic c
|
.It Ic c
|
||||||
Change into the given directory.
|
Change into the given directory.
|
||||||
.It Ic ~
|
.It Ic d
|
||||||
Change to the HOME directory.
|
Toggle detail view.
|
||||||
.It Ic \&.
|
.It Ic \&.
|
||||||
Toggle hide .dot files.
|
Toggle hide .dot files.
|
||||||
|
.It Ic s
|
||||||
|
Toggle sort by file size.
|
||||||
.It Ic t
|
.It Ic t
|
||||||
Toggle sort by time modified.
|
Toggle sort by time modified.
|
||||||
.It Ic C-l
|
|
||||||
Force a redraw.
|
|
||||||
.It Ic \&!
|
.It Ic \&!
|
||||||
Spawn a shell in current directory.
|
Spawn a shell in current directory.
|
||||||
.It Ic z
|
.It Ic z
|
||||||
|
@ -65,6 +59,10 @@ Run the system top utility.
|
||||||
Open selected entry with the vi editor.
|
Open selected entry with the vi editor.
|
||||||
.It Ic p
|
.It Ic p
|
||||||
Open selected entry with the less pager.
|
Open selected entry with the less pager.
|
||||||
|
.It Ic C-k
|
||||||
|
Invoke file name copier.
|
||||||
|
.It Ic C-l
|
||||||
|
Force a redraw.
|
||||||
.It Ic q
|
.It Ic q
|
||||||
Quit.
|
Quit.
|
||||||
.El
|
.El
|
||||||
|
@ -77,18 +75,19 @@ is configured by modifying
|
||||||
.Pa config.h
|
.Pa config.h
|
||||||
and recompiling the code.
|
and recompiling the code.
|
||||||
.Pp
|
.Pp
|
||||||
The file associations are specified by regexes
|
Environment variable
|
||||||
matching on the currently selected filename. If a match is found the associated
|
.Ar NNN_OPENER
|
||||||
program is executed with the filename passed in as the argument. If no match
|
overrides all hard-coded file associations.
|
||||||
is found the program
|
.Pp
|
||||||
.Xr less 1
|
Hard-coded associations are specified by regexes matching on the currently selected filename. If a match is found the associated program is executed with the filename passed in as the argument. If no match is found the environment variable
|
||||||
is invoked. This is useful for editing text files
|
.Ar NNN_FALLBACK_OPENER
|
||||||
as one can use the 'v' command in
|
is invoked, if set.
|
||||||
.Xr less 1 to edit the file using the EDITOR environment variable.
|
.Pp
|
||||||
|
No particular utility is set as the default opener as no standalone universal opener for all mime types exists.
|
||||||
.Pp
|
.Pp
|
||||||
See the examples section below for more information.
|
See the examples section below for more information.
|
||||||
.Sh FILTERS
|
.Sh FILTERS
|
||||||
Filters allow you to use regexes to display only the matched
|
Filters support regexes to display only the matched
|
||||||
entries in the current directory view. This effectively allows
|
entries in the current directory view. This effectively allows
|
||||||
searching through the directory tree for a particular entry.
|
searching through the directory tree for a particular entry.
|
||||||
.Pp
|
.Pp
|
||||||
|
@ -116,19 +115,24 @@ type. Custom associations are listed in the EXAMPLES section below.
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_COPIER:\fR set to a clipboard copier script. For example, on Linux:
|
\fBNNN_COPIER:\fR set to a clipboard copier script. For example, on Linux:
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
|
-------------------------------------
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
echo -n $1 | xsel --clipboard --input
|
echo -n $1 | xsel --clipboard --input
|
||||||
|
-------------------------------------
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
The following example shows one possible configuration for
|
The following example shows one possible configuration for
|
||||||
file associations which is also the default if environment
|
file associations which is also the default if environment
|
||||||
variable NNN_OPENER is not set:
|
variable NNN_OPENER is not set:
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
|
-----------------------------------------------
|
||||||
struct assoc assocs[] = {
|
struct assoc assocs[] = {
|
||||||
{ "\\.(c|cpp|h|txt|log)$", "vim" },
|
{ "\\.(c|cpp|h|txt|log)$", "vim" },
|
||||||
|
{ "\\.(wma|mp3|ogg|flac)$", "fmedia" },
|
||||||
{ "\\.pdf$", "zathura" },
|
{ "\\.pdf$", "zathura" },
|
||||||
{ "\\.sh$", "sh" },
|
{ "\\.sh$", "sh" },
|
||||||
};
|
};
|
||||||
|
-----------------------------------------------
|
||||||
Plain text files are opened with vim.
|
Plain text files are opened with vim.
|
||||||
.br
|
.br
|
||||||
Any other file types are opened with the 'xdg-open' command.
|
Any other file types are opened with the 'xdg-open' command.
|
||||||
|
@ -137,8 +141,7 @@ Any other file types are opened with the 'xdg-open' command.
|
||||||
If you are using urxvt you might have to set backspacekey to DEC.
|
If you are using urxvt you might have to set backspacekey to DEC.
|
||||||
.Sh AUTHORS
|
.Sh AUTHORS
|
||||||
.An Lazaros Koromilas Aq Mt lostd@2f30.org ,
|
.An Lazaros Koromilas Aq Mt lostd@2f30.org ,
|
||||||
.An Dimitris Papastamos Aq Mt sin@2f30.org .
|
.An Dimitris Papastamos Aq Mt sin@2f30.org ,
|
||||||
.Pp
|
.An Arun Prakash Jana Aq Mt engineerarun@gmail.com .
|
||||||
** The current non-mainstream version is a modified one patched by Arun Prakash Jana <engineerarun@gmail.com>.
|
.Sh HOME
|
||||||
.br
|
https://github.com/jarun/nnn
|
||||||
More details: https://github.com/jarun/nnn
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue