mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Support ~, - and & keyboard shortcuts at the bookmark prompt.
In nav-as-you-type mode only control keys are understood when filter is enabled. We need some way to quicly jump HOME, last visited dir or start dir.
This commit is contained in:
parent
2094157630
commit
43134cdfa8
|
@ -340,6 +340,8 @@ Set environment variable `NNN_BMS` as a string of `key:location` pairs (max 10)
|
||||||
|
|
||||||
export NNN_BMS='doc:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
|
export NNN_BMS='doc:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
|
||||||
|
|
||||||
|
The bookmark prompt also understands the <kbd>~</kbd> (HOME), <kbd>-</kbd> (last visited directory) and <kbd>&</kbd> (start directory) shortcuts.
|
||||||
|
|
||||||
#### use cd .....
|
#### use cd .....
|
||||||
|
|
||||||
To jump to the n<sup>th</sup> level parent, with PWD at level 0, use `n + 1` dots. For example, to jump to the 6<th> parent of the current directory, use 7 dots. If the number of dots would take you *beyond* `/` (which isn't possible), you'll be placed at `/`.
|
To jump to the n<sup>th</sup> level parent, with PWD at level 0, use `n + 1` dots. For example, to jump to the 6<th> parent of the current directory, use 7 dots. If the number of dots would take you *beyond* `/` (which isn't possible), you'll be placed at `/`.
|
||||||
|
|
1
nnn.1
1
nnn.1
|
@ -220,6 +220,7 @@ when dealing with the !, e and p commands respectively.
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
export NNN_BMS='doc:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
|
export NNN_BMS='doc:~/Documents;u:/home/user/Cam Uploads;D:~/Downloads/'
|
||||||
.Ed
|
.Ed
|
||||||
|
The bookmark prompt also understands the \fI~\fR (HOME), \fI-\fR (last visited directory) and \fI&\fR shortcuts.
|
||||||
.Pp
|
.Pp
|
||||||
\fBNNN_USE_EDITOR:\fR use EDITOR (preferably CLI, fallback vi) to handle text
|
\fBNNN_USE_EDITOR:\fR use EDITOR (preferably CLI, fallback vi) to handle text
|
||||||
files.
|
files.
|
||||||
|
|
8
nnn.c
8
nnn.c
|
@ -2726,9 +2726,15 @@ nochange:
|
||||||
printprompt("key: ");
|
printprompt("key: ");
|
||||||
tmp = readinput();
|
tmp = readinput();
|
||||||
clearprompt();
|
clearprompt();
|
||||||
if (tmp == NULL)
|
if (tmp == NULL || tmp[0] == '\0')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
/* Interpret ~, - and & keys */
|
||||||
|
if ((tmp[1] == '\0') && (tmp[0] == '~' || tmp[0] == '-' || tmp[0] == '&')) {
|
||||||
|
presel = tmp[0];
|
||||||
|
goto begin;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_bm_loc(tmp, newpath) == NULL) {
|
if (get_bm_loc(tmp, newpath) == NULL) {
|
||||||
printmsg(messages[STR_INVBM_ID]);
|
printmsg(messages[STR_INVBM_ID]);
|
||||||
goto nochange;
|
goto nochange;
|
||||||
|
|
Loading…
Reference in a new issue