diff --git a/README.md b/README.md index 3c44c2ae..e4db8ab7 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ You can move the cursor around with the arrow keys and mouse. * Ctrl-d: Half page down * PageUp: Page up * PageDown: Page down +* Home: Go to beginning +* End: Go to end * Ctrl-e: Execute a command You can also use the mouse to manipulate the text. Simply clicking and dragging will select text. You can also double click diff --git a/cmd/micro/help.go b/cmd/micro/help.go index dfeff02f..b1ef8b65 100644 --- a/cmd/micro/help.go +++ b/cmd/micro/help.go @@ -33,6 +33,9 @@ Ctrl-d: Half page down PageUp: Page up PageDown: Page down +Home: Go to beginning +End: Go to end + Ctrl-e: Execute a command Possible commands: diff --git a/cmd/micro/view.go b/cmd/micro/view.go index dbbd663a..84dd4cd4 100644 --- a/cmd/micro/view.go +++ b/cmd/micro/view.go @@ -485,6 +485,12 @@ func (v *View) HandleEvent(event tcell.Event) { v.OpenFile() // Rehighlight the entire buffer v.UpdateLines(v.topline, v.topline+v.height) + case tcell.KeyHome: + v.topline = 0 + relocate = false + case tcell.KeyEnd: + v.topline = len(v.buf.lines) - 1 - v.height + relocate = false case tcell.KeyPgUp: v.PageUp() relocate = false