add special keys to default keybindings

This commit is contained in:
Gokcehan 2018-06-27 21:33:00 +03:00
parent d987c9e439
commit 5d5d00e30b
3 changed files with 12 additions and 8 deletions

8
doc.go
View File

@ -14,15 +14,15 @@ The following commands are provided by lf with default keybindings:
up (default 'k' and '<up>') up (default 'k' and '<up>')
half-up (default '<c-u>') half-up (default '<c-u>')
page-up (default '<c-b>') page-up (default '<c-b>' and '<pgup>')
down (default 'j' and '<down>') down (default 'j' and '<down>')
half-down (default '<c-d>') half-down (default '<c-d>')
page-down (default '<c-f>') page-down (default '<c-f>' and '<pgdn>')
updir (default 'h' and '<left>') updir (default 'h' and '<left>')
open (default 'l' and '<right>') open (default 'l' and '<right>')
quit (default 'q') quit (default 'q')
top (default 'gg') top (default 'gg' and '<home>')
bottom (default 'G') bottom (default 'G' and '<end>')
toggle (default '<space>') toggle (default '<space>')
invert (default 'v') invert (default 'v')
unmark (default 'u') unmark (default 'u')

View File

@ -18,15 +18,15 @@ The following commands are provided by lf with default keybindings:
up (default 'k' and '<up>') up (default 'k' and '<up>')
half-up (default '<c-u>') half-up (default '<c-u>')
page-up (default '<c-b>') page-up (default '<c-b>' and '<pgup>')
down (default 'j' and '<down>') down (default 'j' and '<down>')
half-down (default '<c-d>') half-down (default '<c-d>')
page-down (default '<c-f>') page-down (default '<c-f>' and '<pgdn>')
updir (default 'h' and '<left>') updir (default 'h' and '<left>')
open (default 'l' and '<right>') open (default 'l' and '<right>')
quit (default 'q') quit (default 'q')
top (default 'gg') top (default 'gg' and '<home>')
bottom (default 'G') bottom (default 'G' and '<end>')
toggle (default '<space>') toggle (default '<space>')
invert (default 'v') invert (default 'v')
unmark (default 'u') unmark (default 'u')

View File

@ -76,17 +76,21 @@ func init() {
gOpts.keys["<up>"] = &callExpr{"up", nil, 1} gOpts.keys["<up>"] = &callExpr{"up", nil, 1}
gOpts.keys["<c-u>"] = &callExpr{"half-up", nil, 1} gOpts.keys["<c-u>"] = &callExpr{"half-up", nil, 1}
gOpts.keys["<c-b>"] = &callExpr{"page-up", nil, 1} gOpts.keys["<c-b>"] = &callExpr{"page-up", nil, 1}
gOpts.keys["<pgup>"] = &callExpr{"page-up", nil, 1}
gOpts.keys["j"] = &callExpr{"down", nil, 1} gOpts.keys["j"] = &callExpr{"down", nil, 1}
gOpts.keys["<down>"] = &callExpr{"down", nil, 1} gOpts.keys["<down>"] = &callExpr{"down", nil, 1}
gOpts.keys["<c-d>"] = &callExpr{"half-down", nil, 1} gOpts.keys["<c-d>"] = &callExpr{"half-down", nil, 1}
gOpts.keys["<c-f>"] = &callExpr{"page-down", nil, 1} gOpts.keys["<c-f>"] = &callExpr{"page-down", nil, 1}
gOpts.keys["<pgdn>"] = &callExpr{"page-down", nil, 1}
gOpts.keys["h"] = &callExpr{"updir", nil, 1} gOpts.keys["h"] = &callExpr{"updir", nil, 1}
gOpts.keys["<left>"] = &callExpr{"updir", nil, 1} gOpts.keys["<left>"] = &callExpr{"updir", nil, 1}
gOpts.keys["l"] = &callExpr{"open", nil, 1} gOpts.keys["l"] = &callExpr{"open", nil, 1}
gOpts.keys["<right>"] = &callExpr{"open", nil, 1} gOpts.keys["<right>"] = &callExpr{"open", nil, 1}
gOpts.keys["q"] = &callExpr{"quit", nil, 1} gOpts.keys["q"] = &callExpr{"quit", nil, 1}
gOpts.keys["gg"] = &callExpr{"top", nil, 1} gOpts.keys["gg"] = &callExpr{"top", nil, 1}
gOpts.keys["<home>"] = &callExpr{"top", nil, 1}
gOpts.keys["G"] = &callExpr{"bottom", nil, 1} gOpts.keys["G"] = &callExpr{"bottom", nil, 1}
gOpts.keys["<end>"] = &callExpr{"bottom", nil, 1}
gOpts.keys["<space>"] = &callExpr{"toggle", nil, 1} gOpts.keys["<space>"] = &callExpr{"toggle", nil, 1}
gOpts.keys["v"] = &callExpr{"invert", nil, 1} gOpts.keys["v"] = &callExpr{"invert", nil, 1}
gOpts.keys["u"] = &callExpr{"unmark", nil, 1} gOpts.keys["u"] = &callExpr{"unmark", nil, 1}