Skip to content

Commit

Permalink
Update the keyboard shortcut documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Jan 18, 2025
1 parent ac96bb5 commit 5cc8d2f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,12 @@ There are pretty few hotkeys to remember:
* `ctrl-e` - Go to end of line and then to the next line
* `ctrl-n` - Scroll down 10 lines, or go to the next match if a search is active.
Insert a column when in the Markdown table editor.
Jump to a matching parenthesis or bracket if the arrow keys were just used.
* `ctrl-p` - Scroll up 10 lines, or go to the previous match if a search is active.
Remove an empty column when in the Markdown table editor.
Jump to a matching parenthesis or bracket if the arrow keys were just used.
* `ctrl-k` - Delete characters to the end of the line, then delete the line.
* `ctrl-_` - Jump to a matching parenthesis or bracket, if the cursor is on one,
otherwise insert a symbol by typing in a 2-letter [digraph](https://raw.githubusercontent.com/xyproto/digraph/main/digraphs.txt).
* `ctrl-_` - Insert a symbol by typing in a 2-letter [digraph](https://raw.githubusercontent.com/xyproto/digraph/main/digraphs.txt).
* `ctrl-d` - Delete a single character.
* `ctrl-t` - For C and C++: jump between the current header and source file. For Agda and Ivy, insert a symbol.
For Markdown: toggle checkboxes, or launch the table editor if the cursor is over a table.
Expand All @@ -222,8 +223,8 @@ There are pretty few hotkeys to remember:
* `ctrl-w` - Format the current file (see the table below), or cycle git rebase keywords. For Markdown, format the table under the cursor.
* `ctrl-g` - Jump to definition, for some programming languages (experimental feature), or toggle the status bar.
* `ctrl-\` - Comment in or out a block of code.
* `ctrl-~` - Jump to a matching parenthesis or bracket.
* `esc` - Redraw everything and clear the last search.
* `ctrl-~` - Start the spellchecker.
* `esc` - Redraw everything and clear the last search.

## Build and format

Expand Down
9 changes: 5 additions & 4 deletions o.1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.\" -*-Nroff-*-
.\"
.TH "o" 1 "19 Dec 2024" "o" "User Commands"
.TH "o" 1 "18 Jan 2025" "o" "User Commands"
.SH NAME
o \- an editor
.SH SYNOPSIS
Expand Down Expand Up @@ -82,9 +82,11 @@ Display brief usage information.
.B ctrl-n
Scroll down 10 lines or go to the next match if a search is active.
Insert a new column when in the Markdown table editor.
Jump to a matching parenthesis or bracket if the arrow keys were just used.
.B ctrl-p
Scroll up 10 lines or go to the previous match if a search is active.
Remove an empty column when in the Markdown table editor.
Jump to a matching parenthesis or bracket if the arrow keys were just used.
.sp
.B ctrl-k
Delete all characters to the end of the line. Delete the line if it is empty.
Expand Down Expand Up @@ -176,16 +178,15 @@ Display brief usage information.
The last used external command by `o` can be found in `~/.cache/o/last_command.sh`.
.sp
.B ctrl-~
Jump to a matching parenthesis, curly bracket or square bracket.
Start the spellchecker.
.sp
`o` will try to jump to the location where the error is and otherwise display "Success".
.sp
.B ctrl-\\\\
Toggle single-line comments for a block of code.
.sp
.B ctrl-_
If the cursor is on a parenthesis, jump to the matching parenthesis.
If not, insert a symbol by typing in a 2-letter digraph.
Insert a symbol by typing in a 2-letter digraph.
The digraphs are the same as for ViM.
For a full overview, see: https://raw.githubusercontent.com/xyproto/digraph/main/digraphs.txt
.sp
Expand Down
7 changes: 4 additions & 3 deletions v2/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,17 @@ ctrl-w for Zig, Rust, V and Go, format with the "... fmt" command
for Markdown, toggle checkboxes or re-format tables
for git interactive rebases, cycle the rebase keywords
ctrl-g jump to definition (experimental feature) or toggle the status bar
ctrl-_ jump to a matching parenthesis or bracket if on one,
otherwise insert a symbol by typing in a two letter ViM-style digraph
ctrl-_ insert a symbol by typing in a two letter ViM-style digraph
see https://raw.githubusercontent.com/xyproto/digraph/main/digraphs.txt
ctrl-a go to start of line, then start of text and then the previous line
ctrl-e go to end of line and then the next line
ctrl-n to scroll down 10 lines or go to the next match if a search is active
insert a column when in the Markdown table editor
go to next match when searching, or next typo when spellchecking
jump to a matching parenthesis or bracket if the arrow keys were just used
ctrl-p to scroll up 10 lines or go to the previous match
remove an empty column when in the Markdown table editor
jump to a matching parenthesis or bracket if the arrow keys were just used
ctrl-k to delete characters to the end of the line, then delete the line
ctrl-j to join lines
ctrl-d to delete a single character
Expand All @@ -66,7 +67,7 @@ ctrl-l to jump to a specific line or letter (press return to jump to the to
ctrl-f to find text. To search and replace, press Tab instead of Return.
to spellcheck, search for "t", then press ctrl-a to add and ctrl-i to ignore
ctrl-\ to toggle single-line comments for a block of code
ctrl-~ to jump to matching parenthesis
ctrl-~ spellcheck
esc to redraw the screen, clear the last search and clear the current macro
Set NO_COLOR=1 to disable colors.
Expand Down

0 comments on commit 5cc8d2f

Please sign in to comment.