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. 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 .TP
.B .B
b b, h
Navigate back one place in your document history. Navigate back one place in your document history.
.TP .TP
.B .B
@ -71,7 +71,7 @@ d
Scroll down an amount corresponding to 75% of your terminal window height in the current document. Scroll down an amount corresponding to 75% of your terminal window height in the current document.
.TP .TP
.B .B
f f, l
Navigate forward one place in your document history. Navigate forward one place in your document history.
.TP .TP
.B .B
@ -95,6 +95,7 @@ n
Jump to next found text item. Jump to next found text item.
.TP .TP
.B .B
N
Jump to previous found text item. Jump to previous found text item.
.TP .TP
.B .B

View File

@ -168,15 +168,15 @@ func (c *client) TakeControlInput() {
} else { } else {
c.goToLink(string(input)) c.goToLink(string(input))
} }
case 'j', 'J': case 'j':
// scroll down one line // scroll down one line
c.ClearMessage() c.ClearMessage()
c.Scroll(1) c.Scroll(1)
case 'k', 'K': case 'k':
// scroll up one line // scroll up one line
c.ClearMessage() c.ClearMessage()
c.Scroll(-1) c.Scroll(-1)
case 'q', 'Q': case 'q':
// quit bombadillo // quit bombadillo
cui.Exit(0, "") cui.Exit(0, "")
case 'g': case 'g':
@ -197,7 +197,7 @@ func (c *client) TakeControlInput() {
c.ClearMessage() c.ClearMessage()
distance := c.Height - c.Height/4 distance := c.Height - c.Height/4
c.Scroll(-distance) c.Scroll(-distance)
case 'b': case 'b', 'h':
// go back // go back
c.ClearMessage() c.ClearMessage()
err := c.PageState.NavigateHistory(-1) err := c.PageState.NavigateHistory(-1)
@ -222,7 +222,7 @@ func (c *client) TakeControlInput() {
// open the bookmarks browser // open the bookmarks browser
c.BookMarks.ToggleOpen() c.BookMarks.ToggleOpen()
c.Draw() c.Draw()
case 'f', 'F': case 'f', 'l':
// go forward // go forward
c.ClearMessage() c.ClearMessage()
err := c.PageState.NavigateHistory(1) err := c.PageState.NavigateHistory(1)