mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Add emacs-like keybinds for next/prev entry selection
This commit is contained in:
parent
ac2a7e2788
commit
dc711f2fad
3
noice.c
3
noice.c
|
@ -34,6 +34,7 @@
|
||||||
#define LEN(x) (sizeof(x) / sizeof(*(x)))
|
#define LEN(x) (sizeof(x) / sizeof(*(x)))
|
||||||
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||||
#define ISODD(x) ((x) & 1)
|
#define ISODD(x) ((x) & 1)
|
||||||
|
#define CONTROL(c) ((c) ^ 0x40)
|
||||||
|
|
||||||
struct assoc {
|
struct assoc {
|
||||||
char *regex; /* Regex to match on filename */
|
char *regex; /* Regex to match on filename */
|
||||||
|
@ -182,12 +183,14 @@ nextsel(int *cur, int max)
|
||||||
/* next */
|
/* next */
|
||||||
case 'j':
|
case 'j':
|
||||||
case KEY_DOWN:
|
case KEY_DOWN:
|
||||||
|
case CONTROL('N'):
|
||||||
if (*cur < max - 1)
|
if (*cur < max - 1)
|
||||||
(*cur)++;
|
(*cur)++;
|
||||||
break;
|
break;
|
||||||
/* prev */
|
/* prev */
|
||||||
case 'k':
|
case 'k':
|
||||||
case KEY_UP:
|
case KEY_UP:
|
||||||
|
case CONTROL('P'):
|
||||||
if (*cur > 0)
|
if (*cur > 0)
|
||||||
(*cur)--;
|
(*cur)--;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue