aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-06-04 17:52:51 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-06-04 22:05:23 +0530
commitac717a7531fec92173c6f82bb86101d6d0403686 (patch)
tree0056f36af6e493d9fcfb22b9e38e60323987494a
parent9457558d1b2aab16302776fdc0708eda917fbb2e (diff)
downloadnnn-ac717a7531fec92173c6f82bb86101d6d0403686.tar.gz
Bind ^L to clear prompt
-rw-r--r--README.md9
-rw-r--r--nnn.17
-rw-r--r--nnn.c8
3 files changed, 11 insertions, 13 deletions
diff --git a/README.md b/README.md
index dff4df9..be0f190 100644
--- a/README.md
+++ b/README.md
@@ -34,7 +34,8 @@ Noice is Not Noice, a noicer fork...
- [use cd .....](#use-cd-)
- [cd on quit](#cd-on-quit)
- [customize nlay](#customize-nlay)
- - [copy current file path to clipboard](#copy-current-file-path-to-clipboard)
+ - [copy file path to clipboard](#copy-file-path-to-clipboard)
+ - [file copy. move. delete](#file-copy-move-delete)
- [boost chdir prompt](#boost-chdir-prompt)
- [change file associations](#change-file-associations)
- [Why fork?](#why-fork)
@@ -187,9 +188,7 @@ Right, Enter, l, ^M | Open file or enter dir
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. Matching entries are shown instantly (search-as-you-type).
-Filters do not stack on top of each other. They are applied anew every time. There are 4 ways to reset a filter:
-
-The `Insert` key, an empty filter expression, a search with no results or an extra backspace at the filter prompt (like vi).
+Filters do not stack on top of each other. They are applied anew every time. There are 4 ways to reset a filter: `^L`, an empty filter expression, a search with no results or an extra backspace at the filter prompt (like vi).
If you want to list all matches starting with the filter expression (a common use case), start the expression with a `^` (caret) symbol.
@@ -278,7 +277,7 @@ As you might notice, nnn uses the environment variable `NNN_TMPFILE` to write th
nlay is a tiny standalone media type *player* by itself. To know how to customize or extend its functionality, please visit [nlay on wiki](https://github.com/jarun/nnn/wiki/all-about-nlay).
-#### copy current file path to clipboard
+#### copy file path to clipboard
nnn can pipe the absolute path of the current file to a copier script. For example, you can use `xsel` on Linux or `pbcopy` on OS X.
diff --git a/nnn.1 b/nnn.1
index 75a4b81..b7086b3 100644
--- a/nnn.1
+++ b/nnn.1
@@ -149,10 +149,9 @@ searching through the directory tree for a particular entry. Matching entries
are shown instantly (search-as-you-type).
.Pp
Filters do not stack on top of each other. They are applied anew
-every time. There are 4 ways to reset a filter:
-.Pp
-The \fIInsert\fR key, an empty filter expression, a search with no results or an
-extra backspace at the filter prompt (like vi).
+every time. There are 4 ways to reset a filter: \fI^L\fR, an empty filter
+expression, a search with no results or an extra backspace at the filter prompt
+(like vi).
.Pp
If you want to list all matches starting with the filter expression (a common
use case), start the expression with a
diff --git a/nnn.c b/nnn.c
index bc2aee7..78a817f 100644
--- a/nnn.c
+++ b/nnn.c
@@ -743,6 +743,10 @@ readln(char *path)
redraw(path);
printprompt(ln);
break;
+ case CONTROL('L'):
+ cur = oldcur;
+ *ch = CONTROL('L');
+ goto end;
default:
wln[len++] = (wchar_t)*ch;
wln[len] = '\0';
@@ -774,10 +778,6 @@ readln(char *path)
redraw(path);
printprompt(ln);
break;
- case KEY_IC:
- cur = oldcur;
- *ch = CONTROL('L');
- goto end;
case KEY_DOWN: // fallthrough
case KEY_UP: // fallthrough
case KEY_LEFT: // fallthrough