From a23e0026fa31954d347414d6f36b146ef7359d9a Mon Sep 17 00:00:00 2001 From: sloum Date: Fri, 15 May 2020 17:32:08 -0700 Subject: [PATCH] Adds command aliasing to vim keys for forward and back --- bombadillo.1 | 5 +++-- client.go | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bombadillo.1 b/bombadillo.1 index ef3e479..b337a8e 100644 --- a/bombadillo.1 +++ b/bombadillo.1 @@ -59,7 +59,7 @@ Displaying web content directly in \fBbombadillo\fP requires lynx, w3m or elinks These commands work as a single keypress anytime \fBbombadillo\fP is not taking in a line based command or when the user is being prompted for action. This is the default command mode of \fBbombadillo\fP. .TP .B -b +b, h Navigate back one place in your document history. .TP .B @@ -71,7 +71,7 @@ d Scroll down an amount corresponding to 75% of your terminal window height in the current document. .TP .B -f +f, l Navigate forward one place in your document history. .TP .B @@ -95,6 +95,7 @@ n Jump to next found text item. .TP .B +N Jump to previous found text item. .TP .B diff --git a/client.go b/client.go index bb580f1..f9a3198 100644 --- a/client.go +++ b/client.go @@ -168,15 +168,15 @@ func (c *client) TakeControlInput() { } else { c.goToLink(string(input)) } - case 'j', 'J': + case 'j': // scroll down one line c.ClearMessage() c.Scroll(1) - case 'k', 'K': + case 'k': // scroll up one line c.ClearMessage() c.Scroll(-1) - case 'q', 'Q': + case 'q': // quit bombadillo cui.Exit(0, "") case 'g': @@ -197,7 +197,7 @@ func (c *client) TakeControlInput() { c.ClearMessage() distance := c.Height - c.Height/4 c.Scroll(-distance) - case 'b': + case 'b', 'h': // go back c.ClearMessage() err := c.PageState.NavigateHistory(-1) @@ -222,7 +222,7 @@ func (c *client) TakeControlInput() { // open the bookmarks browser c.BookMarks.ToggleOpen() c.Draw() - case 'f', 'F': + case 'f', 'l': // go forward c.ClearMessage() err := c.PageState.NavigateHistory(1)