Skip to content

Commit

Permalink
Let ctrl-~ insert the current date and time
Browse files Browse the repository at this point in the history
  • Loading branch information
xyproto committed Jan 18, 2025
1 parent e4a500f commit 53a0ed5
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ 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-~` - Start the spellchecker.
* `ctrl-~` - Insert the current date and time.
* `esc` - Redraw everything and clear the last search.

## Build and format
Expand Down
2 changes: 1 addition & 1 deletion o.1
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Display brief usage information.
The last used external command by `o` can be found in `~/.cache/o/last_command.sh`.
.sp
.B ctrl-~
Start the spellchecker.
Insert the current date and time.
.sp
`o` will try to jump to the location where the error is and otherwise display "Success".
.sp
Expand Down
2 changes: 1 addition & 1 deletion v2/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,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-~ spellcheck
ctrl-~ insert the current date and time
esc to redraw the screen, clear the last search and clear the current macro
Set NO_COLOR=1 to disable colors.
Expand Down
5 changes: 2 additions & 3 deletions v2/keyloop.go
Original file line number Diff line number Diff line change
Expand Up @@ -1686,9 +1686,8 @@ func Loop(tty *vt100.TTY, fnord FilenameOrData, lineNumber LineNumber, colNumber
e.redraw.Store(true)
}
e.redrawCursor.Store(true)

case "c:29", "c:30": // ctrl-~, insert the current date
if spellCheckFunc, err := e.CommandToFunction(c, tty, status, bookmark, undo, "spellcheck"); err == nil { // success
case "c:29", "c:30": // ctrl-~, insert the current date and time
if spellCheckFunc, err := e.CommandToFunction(c, tty, status, bookmark, undo, "insertdateandtime"); err == nil { // success
spellCheckFunc()
}
case "c:19": // ctrl-s, save (or step, if in debug mode)
Expand Down

0 comments on commit 53a0ed5

Please sign in to comment.