From 53a0ed5588845e02b4ea3bce5826ebc43d140c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20F=2E=20R=C3=B8dseth?= Date: Sat, 18 Jan 2025 17:42:42 +0100 Subject: [PATCH] Let ctrl-~ insert the current date and time --- README.md | 2 +- o.1 | 2 +- v2/help.go | 2 +- v2/keyloop.go | 5 ++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1972da56..145bc6be 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/o.1 b/o.1 index b7c3f226..22a47df9 100644 --- a/o.1 +++ b/o.1 @@ -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 diff --git a/v2/help.go b/v2/help.go index 910eb637..9e79e913 100644 --- a/v2/help.go +++ b/v2/help.go @@ -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. diff --git a/v2/keyloop.go b/v2/keyloop.go index bc7ac35b..bc759f4e 100644 --- a/v2/keyloop.go +++ b/v2/keyloop.go @@ -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)