about summary refs log tree commit diff stats
path: root/res
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-08 20:07:58 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-08 20:23:42 +0200
commit39e9d80a49124067edb38c4711c58d5cb790c91e (patch)
treee4c676814f13078ad77ffaa5101f852870d05809 /res
parent099550625e55ad59a6ed6bef54ad0d86470cdd91 (diff)
downloadchawan-39e9d80a49124067edb38c4711c58d5cb790c91e.tar.gz
Add vi-style numeric prefixes, make gotoLine 1-based
* it is now possible to jump to the nth line by typing {n}G
* gotoLine is now 1-based, so to go to the first line you would use
  pager.gotoLine(1)
* it is now allowed to return a function from a keybinding (which will be
  subsequently executed as a regular keybinding)
Diffstat (limited to 'res')
-rw-r--r--res/config.toml6
1 files changed, 4 insertions, 2 deletions
diff --git a/res/config.toml b/res/config.toml
index b96f05d8..14b746fd 100644
--- a/res/config.toml
+++ b/res/config.toml
@@ -38,6 +38,9 @@ default-headers = {
 	Cache-Control = "no-cache"
 }
 
+[input]
+vi-numeric-prefix = true
+
 [display]
 color-mode = "auto"
 format-mode = "auto"
@@ -104,9 +107,8 @@ U = 'pager.reload()'
 r = 'pager.redraw()'
 R = 'pager.reshape()'
 M-C-c = 'pager.cancel()'
-1G = 'pager.cursorFirstLine()'
 g = 'pager.cursorFirstLine()'
-G = 'pager.cursorLastLine()'
+G = 'n => n ? pager.gotoLine(n) : pager.cursorLastLine()'
 M-g = 'pager.gotoLine()'
 z = 'pager.centerLine()'
 C-g = 'pager.lineInfo()'