sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

mainline.diff (6115B)


      1 # Description: Change key bindings for comfortable use with Colemak-DH keyboard
      2 #              layout. This diff was made in 4.5 release version of nnn.
      3 #
      4 # Author: github.com/anjerukare
      5 
      6 diff --git a/src/nnn.c b/src/nnn.c
      7 index ecedee43..9d779f90 100644
      8 --- a/src/nnn.c
      9 +++ b/src/nnn.c
     10 @@ -5098,40 +5098,40 @@ static void show_help(const char *path)
     11  	"2(___n))\n"
     12  	"0\n"
     13  	"1NAVIGATION\n"
     14 -	       "9Up k  Up%16PgUp ^U  Page up\n"
     15 -	       "9Dn j  Down%14PgDn ^D  Page down\n"
     16 -	       "9Lt h  Parent%12~ ` @ -  ~, /, start, prev\n"
     17 -	   "5Ret Rt l  Open%20'  First file/match\n"
     18 -	       "9g ^A  Top%21J  Jump to entry/offset\n"
     19 -	       "9G ^E  End%20^J  Toggle auto-advance on open\n"
     20 +	       "9Up e  Up%16PgUp ^U  Page up\n"
     21 +	       "9Dn n  Down%14PgDn ^D  Page down\n"
     22 +	       "9Lt m  Parent%12~ ` @ -  ~, /, start, prev\n"
     23 +	   "5Ret Rt i  Open%20'  First file/match\n"
     24 +	       "9g ^E  Top%21J  Jump to entry/offset\n"
     25 +	       "9G ^N  End%20^J  Toggle auto-advance on open\n"
     26  	      "8B (,)  Book(mark)%11b ^/  Select bookmark\n"
     27  		"a1-4  Context%11(Sh)Tab  Cycle/new context\n"
     28  	    "62Esc ^Q  Quit%20q  Quit context\n"
     29  		 "b^G  QuitCD%18Q  Pick/err, quit\n"
     30  	"0\n"
     31  	"1FILTER & PROMPT\n"
     32 -		  "c/  Filter%17^N  Toggle type-to-nav\n"
     33 +		  "c/  Filter%17^F  Toggle type-to-nav\n"
     34  		"aEsc  Exit prompt%12^L  Toggle last filter\n"
     35  		  "c.  Toggle hidden%05Alt+Esc  Unfilter, quit context\n"
     36  	"0\n"
     37  	"1FILES\n"
     38 -	       "9o ^O  Open with%15n  Create new/link\n"
     39 -	       "9f ^F  File stats%14d  Detail mode toggle\n"
     40 +	       "9o ^O  Open with%15c  Create new/link\n"
     41 +	          "cf  File stats%14d  Detail mode toggle\n"
     42  		 "b^R  Rename/dup%14r  Batch rename\n"
     43 -		  "cz  Archive%17e  Edit file\n"
     44 +		  "cz  Archive%17y  Edit file\n"
     45  		  "c*  Toggle exe%14>  Export list\n"
     46 -	    "6Space +  (Un)select%12m-m  Select range/clear\n"
     47 +	    "6Space +  (Un)select%12s-s  Select range/clear\n"
     48  	          "ca  Select all%14A  Invert sel\n"
     49  	       "9p ^P  Copy here%12w ^W  Cp/mv sel as\n"
     50 -	       "9v ^V  Move here%15E  Edit sel list\n"
     51 +	       "9v ^V  Move here%15l  Edit sel list\n"
     52  	       "9x ^X  Delete%18S  Listed sel size\n"
     53  		"aEsc  Send to FIFO\n"
     54  	"0\n"
     55  	"1MISC\n"
     56  	      "8Alt ;  Select plugin%11=  Launch app\n"
     57  	       "9! ^]  Shell%19]  Cmd prompt\n"
     58 -		  "cc  Connect remote%10u  Unmount remote/archive\n"
     59 -	       "9t ^T  Sort toggles%12s  Manage session\n"
     60 +		  "ch  Connect remote%10u  Unmount remote/archive\n"
     61 +	       "9t ^T  Sort toggles%12k  Manage session\n"
     62  		  "cT  Set time type%110  Lock\n"
     63  		 "b^L  Redraw%18?  Help, conf\n"
     64  	};
     65 diff --git a/src/nnn.h b/src/nnn.h
     66 index 3e4ea19c..c81ef392 100644
     67 --- a/src/nnn.h
     68 +++ b/src/nnn.h
     69 @@ -131,18 +131,18 @@ struct key {
     70  static struct key bindings[] = {
     71  	/* Back */
     72  	{ KEY_LEFT,       SEL_BACK },
     73 -	{ 'h',            SEL_BACK },
     74 +	{ 'm',            SEL_BACK },
     75  	/* Inside or select */
     76  	{ KEY_ENTER,      SEL_OPEN },
     77  	{ '\r',           SEL_OPEN },
     78  	/* Pure navigate inside */
     79  	{ KEY_RIGHT,      SEL_NAV_IN },
     80 -	{ 'l',            SEL_NAV_IN },
     81 +	{ 'i',            SEL_NAV_IN },
     82  	/* Next */
     83 -	{ 'j',            SEL_NEXT },
     84 +	{ 'n',            SEL_NEXT },
     85  	{ KEY_DOWN,       SEL_NEXT },
     86  	/* Previous */
     87 -	{ 'k',            SEL_PREV },
     88 +	{ 'e',            SEL_PREV },
     89  	{ KEY_UP,         SEL_PREV },
     90  	/* Page down */
     91  	{ KEY_NPAGE,      SEL_PGDN },
     92 @@ -155,11 +155,11 @@ static struct key bindings[] = {
     93  	/* First entry */
     94  	{ KEY_HOME,       SEL_HOME },
     95  	{ 'g',            SEL_HOME },
     96 -	{ CONTROL('A'),   SEL_HOME },
     97 +	{ CONTROL('E'),   SEL_HOME },
     98  	/* Last entry */
     99  	{ KEY_END,        SEL_END },
    100  	{ 'G',            SEL_END },
    101 -	{ CONTROL('E'),   SEL_END },
    102 +	{ CONTROL('N'),   SEL_END },
    103  	/* Go to first file */
    104  	{ '\'',           SEL_FIRST },
    105  	/* Jump to an entry number/offset */
    106 @@ -176,7 +176,7 @@ static struct key bindings[] = {
    107  	{ 'b',            SEL_BMOPEN },
    108  	{ CONTROL('_'),   SEL_BMOPEN },
    109  	/* Connect to server over SSHFS */
    110 -	{ 'c',            SEL_REMOTE },
    111 +	{ 'h',            SEL_REMOTE },
    112  	/* Cycle contexts in forward direction */
    113  	{ '\t',           SEL_CYCLE },
    114  	/* Cycle contexts in reverse direction */
    115 @@ -199,14 +199,13 @@ static struct key bindings[] = {
    116  	/* Filter */
    117  	{ '/',            SEL_FLTR },
    118  	/* Toggle filter mode */
    119 -	{ CONTROL('N'),   SEL_MFLTR },
    120 +	{ CONTROL('F'),   SEL_MFLTR },
    121  	/* Toggle hide .dot files */
    122  	{ '.',            SEL_HIDDEN },
    123  	/* Detailed listing */
    124  	{ 'd',            SEL_DETAIL },
    125  	/* File details */
    126  	{ 'f',            SEL_STATS },
    127 -	{ CONTROL('F'),   SEL_STATS },
    128  	/* Toggle executable status */
    129  	{ '*',            SEL_CHMODX },
    130  	/* Create archive */
    131 @@ -220,13 +219,13 @@ static struct key bindings[] = {
    132  	{ ' ',            SEL_SEL },
    133  	{ '+',            SEL_SEL },
    134  	/* Toggle select multiple files */
    135 -	{ 'm',            SEL_SELMUL },
    136 +	{ 's',            SEL_SELMUL },
    137  	/* Select all files in current dir */
    138  	{ 'a',            SEL_SELALL },
    139  	/* Invert selection in current dir */
    140  	{ 'A',            SEL_SELINV },
    141  	/* List, edit selection */
    142 -	{ 'E',            SEL_SELEDIT },
    143 +	{ 'l',            SEL_SELEDIT },
    144  	/* Copy from selection buffer */
    145  	{ 'p',            SEL_CP },
    146  	{ CONTROL('P'),   SEL_CP },
    147 @@ -243,7 +242,7 @@ static struct key bindings[] = {
    148  	{ 'o',            SEL_OPENWITH },
    149  	{ CONTROL('O'),   SEL_OPENWITH },
    150  	/* Create a new file */
    151 -	{ 'n',            SEL_NEW },
    152 +	{ 'c',            SEL_NEW },
    153  	/* Show rename prompt */
    154  	{ CONTROL('R'),   SEL_RENAME },
    155  	/* Rename contents of current dir */
    156 @@ -255,7 +254,7 @@ static struct key bindings[] = {
    157  	/* Toggle auto-advance on file open */
    158  	{ CONTROL('J'),   SEL_AUTONEXT },
    159  	/* Edit in EDITOR */
    160 -	{ 'e',            SEL_EDIT },
    161 +	{ 'y',            SEL_EDIT },
    162  	/* Run a plugin */
    163  	{ ';',            SEL_PLUGIN },
    164  	/* Show total size of listed selection */
    165 @@ -270,7 +269,7 @@ static struct key bindings[] = {
    166  	/* Lock screen */
    167  	{ '0',            SEL_LOCK },
    168  	/* Manage sessions */
    169 -	{ 's',            SEL_SESSIONS },
    170 +	{ 'k',            SEL_SESSIONS },
    171  	/* Export list */
    172  	{ '>',            SEL_EXPORT },
    173  	/* Set time type */