Adds command aliasing to vim keys for forward and back

This commit is contained in:
sloum 2020-05-15 17:32:08 -07:00
parent c58b40def2
commit a23e0026fa
2 changed files with 8 additions and 7 deletions

View File

@ -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

View File

@ -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)