From 78048d6ef0ad4c68714effc0ebce5eb678c5e4cf Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 19 Jan 2019 18:17:36 +0530 Subject: [PATCH] Document macros --- README.md | 22 ++++++++++++++++++++++ nnn.1 | 6 +++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 01678913..5d4e7f20 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ It runs on Linux, macOS, Raspberry Pi, BSD, Cygwin, Linux subsystem for Windows - [Navigate-as-you-type](#navigate-as-you-type) - [File indicators](#file-indicators) - [Utility dependencies](#utility-dependencies) + - [Configuration](#configuration) - [Help](#help) - [Quickstart](#quickstart) - [How to](#how-to) @@ -367,6 +368,27 @@ Arguments to the `$PAGER` and `$SHELL` should be combined together. The option `open with` takes 1 combined argument. +#### Configuration + +`nnn` supports the following environment variables for configuration. + +| Example `export` | Description | +| --- | --- | +| `NNN_OPENER=mimeopen` | custom file opener | +| `NNN_BMS='d:~/Documents;D:~/Docs archive/'` | specify bookmarks (max 10) | +| `NNN_USE_EDITOR=1` | Open text files in `$EDITOR` (`$VISUAL` takes preference), fallback vi | +| `NNN_CONTEXT_COLORS='1234'` | specify per context color [default: '4444' (all blue)] | +| `NNN_IDLE_TIMEOUT=300` | idle time to lock terminal [default: disabled] | +| `NNN_COPIER='copier.sh'` | system clipboard copier script [default: none] | +| `NNN_SCRIPT=/home/user/scripts[/script.sh]` | path to script dir or a single script | +| `NNN_NOTE=/home/user/Dropbox/Public/notes` | path to note file [default: none] | +| `NNN_SHOW_HIDDEN=1` | show hidden (dot) files [default: do not show hidden if not root ] | +| `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_PLAIN_FILTER` | use substring match in filer mode [default: regex] | +| `NNN_TMPFILE=/tmp/nnn` | file to write current open dir path to for cd on quit | + #### Help $ nnn -h diff --git a/nnn.1 b/nnn.1 index b126568f..c5a16471 100644 --- a/nnn.1 +++ b/nnn.1 @@ -272,7 +272,7 @@ when dealing with the !, e and p commands respectively. A single combination to NOTE: Bookmark keys should be single-character to use them in combination with the Leader key. .Ed .Pp -\fBNNN_USE_EDITOR:\fR use EDITOR (preferably CLI, fallback vi) to handle text +\fBNNN_USE_EDITOR:\fR use EDITOR (VISUAL takes preference, preferably CLI, fallback vi) to handle text files. .Bd -literal export NNN_USE_EDITOR=1 @@ -287,9 +287,9 @@ files. .Pp \fBNNN_IDLE_TIMEOUT:\fR set idle timeout (in seconds) to invoke terminal locker (default: disabled). .Pp -\fBNNN_COPIER:\fR set to a clipboard copier script. +\fBNNN_COPIER:\fR system clipboard copier script. .Bd -literal - NOTE: By default file paths are copied to the tmp file \fBDIR/.nnncp\fR, where 'DIR' (by priority) is: + NOTE: File paths are copied to the tmp file \fBDIR/.nnncp\fR, where 'DIR' (by priority) is: \fI$HOME\fR or, \fI$TMPDIR\fR or, \fI/tmp\fR. The path is shown in the help and configuration screen. .Ed