mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
vim-ish binding for jump to first and last entry
It was troubling me. Mimicking 'gg' would have been hacky and would need additional processing... 'g' was free. Who cares even if you press twice? ;)
This commit is contained in:
parent
aebe6c1898
commit
07c59cfd62
|
@ -23,6 +23,11 @@ nnn is a fork of [noice](http://git.2f30.org/noice/), a blazing-fast terminal fi
|
||||||
|
|
||||||
The only issue with noice is hard-coded file associations. There is no config file (better performance and simpler to maintain) and one has to modify the source to change associations (see [how to change file associations](#change-file-associations)). nnn solves the problem by adding the flexibility of using the default desktop opener at runtime. There are several other improvements too (see [fork-toppings](#fork-toppings)).
|
The only issue with noice is hard-coded file associations. There is no config file (better performance and simpler to maintain) and one has to modify the source to change associations (see [how to change file associations](#change-file-associations)). nnn solves the problem by adding the flexibility of using the default desktop opener at runtime. There are several other improvements too (see [fork-toppings](#fork-toppings)).
|
||||||
|
|
||||||
|
You can try
|
||||||
|
|
||||||
|
alias n='nnn -d'
|
||||||
|
and see how nnn simplifies those long desktop sessions.
|
||||||
|
|
||||||
Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/issues/1).
|
Have fun with it! PRs are welcome. Check out [#1](https://github.com/jarun/nnn/issues/1).
|
||||||
|
|
||||||
### Why fork?
|
### Why fork?
|
||||||
|
@ -113,8 +118,8 @@ Start nnn (default: current directory):
|
||||||
| `Down`, `j`, `^N` | Next entry |
|
| `Down`, `j`, `^N` | Next entry |
|
||||||
| `PgUp`, `^U` | Scroll half page up |
|
| `PgUp`, `^U` | Scroll half page up |
|
||||||
| `PgDn`, `^D` | Scroll half page down |
|
| `PgDn`, `^D` | Scroll half page down |
|
||||||
| `Home`, `^`, `^A` | Jump to first dir entry |
|
| `Home`, `g`, `^`, `^A` | Jump to first entry |
|
||||||
| `End`, `$`, `^E` | Jump to last dir entry |
|
| `End`, `G`, `$`, `^E` | Jump to last entry |
|
||||||
| `Right`, `Enter`, `l`, `^M` | Open file or enter dir |
|
| `Right`, `Enter`, `l`, `^M` | Open file or enter dir |
|
||||||
| `Left`, `Backspace`, `h`, `^H` | Go to parent dir |
|
| `Left`, `Backspace`, `h`, `^H` | Go to parent dir |
|
||||||
| `~` | Jump to HOME dir |
|
| `~` | Jump to HOME dir |
|
||||||
|
|
|
@ -53,10 +53,12 @@ struct key bindings[] = {
|
||||||
{ CONTROL('U'), SEL_PGUP, "", "" },
|
{ CONTROL('U'), SEL_PGUP, "", "" },
|
||||||
/* Home */
|
/* Home */
|
||||||
{ KEY_HOME, SEL_HOME, "", "" },
|
{ KEY_HOME, SEL_HOME, "", "" },
|
||||||
|
{ 'g', SEL_HOME, "", "" },
|
||||||
{ CONTROL('A'), SEL_HOME, "", "" },
|
{ CONTROL('A'), SEL_HOME, "", "" },
|
||||||
{ '^', SEL_HOME, "", "" },
|
{ '^', SEL_HOME, "", "" },
|
||||||
/* End */
|
/* End */
|
||||||
{ KEY_END, SEL_END, "", "" },
|
{ KEY_END, SEL_END, "", "" },
|
||||||
|
{ 'G', SEL_END, "", "" },
|
||||||
{ CONTROL('E'), SEL_END, "", "" },
|
{ CONTROL('E'), SEL_END, "", "" },
|
||||||
{ '$', SEL_END, "", "" },
|
{ '$', SEL_END, "", "" },
|
||||||
/* Change dir */
|
/* Change dir */
|
||||||
|
|
4
nnn.1
4
nnn.1
|
@ -30,9 +30,9 @@ Move to next entry
|
||||||
Scroll up half a page
|
Scroll up half a page
|
||||||
.It Ic [PgDn], ^D
|
.It Ic [PgDn], ^D
|
||||||
Scroll down half a page
|
Scroll down half a page
|
||||||
.It Ic [Home], ^, ^A
|
.It Ic [Home], g, ^, ^A
|
||||||
Move to the first entry
|
Move to the first entry
|
||||||
.It Ic [End], $, ^E
|
.It Ic [End], G, $, ^E
|
||||||
Move to the last entry
|
Move to the last entry
|
||||||
.It Ic [Right], [Enter], l, ^M
|
.It Ic [Right], [Enter], l, ^M
|
||||||
Open file or enter directory
|
Open file or enter directory
|
||||||
|
|
4
nnn.c
4
nnn.c
|
@ -845,8 +845,8 @@ show_help(void)
|
||||||
[Down], j, ^N Next entry\n\
|
[Down], j, ^N Next entry\n\
|
||||||
[PgUp], ^U Scroll half page up\n\
|
[PgUp], ^U Scroll half page up\n\
|
||||||
[PgDn], ^D Scroll half page down\n\
|
[PgDn], ^D Scroll half page down\n\
|
||||||
[Home], ^, ^A Jump to first dir entry\n\
|
[Home], g, ^, ^A Jump to first entry\n\
|
||||||
[End], $, ^E Jump to last dir entry\n\
|
[End], G, $, ^E Jump to last entry\n\
|
||||||
[Right], [Enter], l, ^M Open file or enter dir\n\
|
[Right], [Enter], l, ^M Open file or enter dir\n\
|
||||||
[Left], [Backspace], h, ^H Go to parent dir\n\
|
[Left], [Backspace], h, ^H Go to parent dir\n\
|
||||||
~ Jump to HOME dir\n\
|
~ Jump to HOME dir\n\
|
||||||
|
|
Loading…
Reference in a new issue