From a747a1e267340aa0c44e1543143e2456e50ea65c Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Tue, 12 Mar 2019 19:35:24 +0530 Subject: [PATCH] Update docs --- README.md | 29 +++++++++++++---------------- nnn.1 | 4 ++-- user-scripts/README.md | 12 ++++++++++++ 3 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 user-scripts/README.md diff --git a/README.md b/README.md index 6b1c3b25..2df30e25 100644 --- a/README.md +++ b/README.md @@ -81,7 +81,7 @@ It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows - Contexts (_aka_ tabs _aka_ workspaces) - *Navigate-as-you-type* with auto-select directory - Bookmarks - - Familiar, easy shortcuts (arrows, `~`, `-`, `@`) + - Familiar, easy shortcuts (arrows, ~, -, @) - Pin and visit a directory - Sorting - Directories always listed on top @@ -140,6 +140,7 @@ It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows | trash-cli | trash files (instead of delete) | | mediainfo or exiftool | multimedia file details | | atool, patool ([integration](https://github.com/jarun/nnn/wiki/How-to#integrate-patool)) | create, list and extract archives | +| fzy | app launcher with drop-down menu | | vidir (from moreutils) | batch rename dir entries | | vlock (Linux), bashlock (macOS), lock(1) (BSD) | terminal locker | | advcpmv (Linux) ([integration](https://github.com/jarun/nnn/wiki/How-to#show-cp-mv-progress)) | copy, move progress | @@ -335,11 +336,13 @@ There is a program option to filter entries by substring match instead of regex. In this mode directories are opened in filter mode, allowing continuous navigation. Works best with the **arrow keys**. -In case of only one match and it's a directory, `nnn` auto selects the directory and enters it in this mode. To disable this behaviour, +When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode. To disable this behaviour, export NNN_NO_AUTOSELECT=1 -The _wild mode_ program option can be handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sort the entries (with directories on top). Directory color is disabled in this mode. +This mode takes navigation to the next level when short, unique keypress sequences are possible. For example, to reach `nnn` development directory (located at `~/GitHub/nnn`) from my `$HOME` (which is the default directory the terminal starts in), I use the sequence gn. + +The **_wild mode_** program option can be extremely handy for users who use this mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. #### File indicators @@ -372,7 +375,7 @@ The following indicators are used in the detail view: | `NNN_NOTE=/home/user/Dropbox/Public/notes` | path to note file [default: none] | | `NNN_TMPFILE=/tmp/nnn` | file to write current open dir path to for cd on quit | | `NNN_USE_EDITOR=1` | Open text files in `$EDITOR` (`$VISUAL`, if defined; fallback vi) | -| `NNN_NO_AUTOSELECT=1` | do not auto-select matching dir in _nav-as-you-type` mode | +| `NNN_NO_AUTOSELECT=1` | do not auto-select matching dir in _nav-as-you-type_ mode | | `NNN_RESTRICT_NAV_OPEN=1` | open files on , not or l | | `NNN_RESTRICT_0B=1` | do not open 0-byte files | | `NNN_TRASH=1` | trash files to the desktop Trash [default: delete] | @@ -392,25 +395,19 @@ To lookup keyboard shortcuts at runtime, press ?. export NNN_USE_EDITOR=1 4. Run `n`. -5. Don't memorize keys. Arrows, / and q suffice. Press ? for help on keyboard shortcuts anytime. +5. To use `nnn` as a GUI app launcher with fuzzy selection menu, drop [`nlaunch`](https://github.com/jarun/nnn/blob/master/user-scripts/nlaunch) somewhere in your `$PATH`. +6. Don't memorize keys. Arrows, / and q suffice. Press ? for help on keyboard shortcuts anytime. - For additional functionality [setup custom scripts](https://github.com/jarun/nnn/wiki/How-to#run-custom-scripts). - Visit the [How to](https://github.com/jarun/nnn/wiki/How-to) for many more specific usecases. #### USER SCRIPTS -The following [user-scripts](https://github.com/jarun/nnn/tree/master/user-scripts) are available. +Copy the scripts in the [user-scripts](https://github.com/jarun/nnn/tree/master/user-scripts) directory and let `nnn` know the location: -| Script | Description | -| --- | --- | -| copier.sh | Copy selection to clipboard | -| edit.sh | Fuzzy find a file in directory subtree with fzy and edit in vim | -| fzy.sh | Fuzzy find a file in directory subtree with fzy and open using xdg-open | -| imgur.sh | Upload an image file to imgur | -| nlaunch | drop-down app launcher (needs fzy), drop in `$PATH`; fallback regular prompt | -| picker.sh | Pick files and pipe the newline-separated list to another utility | -| sxiv.sh | Open images in current directory in sxiv | -| upgrade.sh | Check and update to latest version of nnn manually on Debian 9 Stretch | + export NNN_SCRIPT=/absolute/path/to/scripts_dir + +If you have an interesting script feel free to raise a PR. #### TROUBLESHOOTING diff --git a/nnn.1 b/nnn.1 index 34bfefba..83fd18dc 100644 --- a/nnn.1 +++ b/nnn.1 @@ -253,9 +253,9 @@ There is a program option to filter entries by substring match instead of regex. In the \fInavigate-as-you-type\fR mode directories are opened in filter mode, allowing continuous navigation. Works best with the \fBarrow keys\fR. .br -In case of only one match and it's a directory, `nnn` auto selects the directory and enters it in this mode. +When there's a unique match and it's a directory, `nnn` auto selects the directory and enters it in this mode. .br -The \fIwild mode\fR can be handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sort the entries (with directories on top). Directory color is disabled in this mode. +The \fIwild mode\fR can be extremely handy for users who use the \fInavigate-as-you-type\fR mode constantly. The entries are unsorted when the directory loads. Applying filters sorts the entries (with directories on top). Directory color is disabled in this mode. .Sh SELECTION MODE The absolute path of a single file can be copied to clipboard by pressing \fI^K\fR if NNN_COPIER is set (see ENVIRONMENT section below). diff --git a/user-scripts/README.md b/user-scripts/README.md new file mode 100644 index 00000000..2c1b985f --- /dev/null +++ b/user-scripts/README.md @@ -0,0 +1,12 @@ +#### List of scripts + +| Script | Description | +| --- | --- | +| copier.sh | Copy selection to clipboard | +| edit.sh | Fuzzy find a file in directory subtree with fzy and edit in vim | +| fzy.sh | Fuzzy find a file in directory subtree with fzy and open using xdg-open | +| imgur.sh | Upload an image file to imgur | +| nlaunch | drop-down app launcher (needs fzy), drop in `$PATH`; fallback regular prompt | +| picker.sh | Pick files and pipe the newline-separated list to another utility | +| sxiv.sh | Open images in current directory in sxiv | +| upgrade.sh | Check and update to latest version of nnn manually on Debian 9 Stretch |