`: font NAME` was reverted on the next frame because the per-window chooser re-applied the config's code/writing font, and with two windows in different modes the font flipped every frame. Fonts per edit mode now live on the primary Editor (EditorFonts), shared with secondary windows like the buffer list. `: font` sets the font for the current buffer's mode, and the frontend picks one font per frame from the window with keyboard focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
129 lines
5.2 KiB
C++
129 lines
5.2 KiB
C++
/*
|
|
* HelpText.cc - embedded/customizable help content
|
|
*/
|
|
|
|
#include "HelpText.h"
|
|
|
|
|
|
std::string
|
|
HelpText::Text()
|
|
{
|
|
// Customize the help text here. This string will be used by C-k h first.
|
|
// You can keep it empty to fall back to the manpage or built-in defaults.
|
|
// Note: keep newline characters as-is; the renderer splits lines on '\n'.
|
|
|
|
return std::string(
|
|
"KTE - Kyle's Text Editor\n\n"
|
|
"About:\n"
|
|
" kte is Kyle's Text Editor. It keeps a small, fast core and uses a\n"
|
|
" WordStar/VDE-style command model with some emacs influences.\n"
|
|
"\n"
|
|
"K-commands (prefix C-k):\n"
|
|
" C-k ' Toggle read-only\n"
|
|
" C-k - Unindent region (mark required)\n"
|
|
" C-k = Indent region (mark required)\n"
|
|
" C-k / Toggle visual line mode\n"
|
|
" C-k ; Command prompt (:\\ )\n"
|
|
" C-k SPACE Toggle mark\n"
|
|
" C-k C-d Kill entire line\n"
|
|
" C-k C-q Quit now (no confirm)\n"
|
|
" C-k C-s Save\n"
|
|
" C-k C-x Save and quit\n"
|
|
" C-k a Mark start of file, jump to end\n"
|
|
" C-k b Switch buffer\n"
|
|
" C-k c Close current buffer\n"
|
|
" C-k d Kill to end of line\n"
|
|
" C-k e Open file (prompt)\n"
|
|
" C-k f Flush kill ring\n"
|
|
" C-k g Jump to line\n"
|
|
" C-k h Show this help\n"
|
|
" C-k i New empty buffer\n"
|
|
" C-k j Jump to mark\n"
|
|
" C-k k Center viewport on cursor\n"
|
|
" C-k l Reload buffer from disk\n"
|
|
" C-k m Toggle edit mode (code/writing)\n"
|
|
" C-k n Previous buffer\n"
|
|
" C-k o Change working directory (prompt)\n"
|
|
" C-k p Next buffer\n"
|
|
" C-k q Quit (confirm if dirty)\n"
|
|
" C-k r Redo\n"
|
|
" C-k s Save buffer\n"
|
|
" C-k u Undo\n"
|
|
" C-k v Toggle visual file picker (GUI)\n"
|
|
" C-k w Show working directory\n"
|
|
" C-k x Save and quit\n"
|
|
" C-k y Yank\n"
|
|
"\n"
|
|
"ESC/Alt commands:\n"
|
|
" ESC < Go to beginning of file\n"
|
|
" ESC > Go to end of file\n"
|
|
" ESC m Toggle mark\n"
|
|
" ESC w Copy region to kill ring (Alt-w)\n"
|
|
" ESC b Previous word\n"
|
|
" ESC f Next word\n"
|
|
" ESC d Delete next word (Alt-d)\n"
|
|
" ESC BACKSPACE Delete previous word (Alt-Backspace)\n"
|
|
" ESC q Reflow paragraph\n"
|
|
" ESC Enter Newline without auto-indent\n"
|
|
"\n"
|
|
"Universal argument:\n"
|
|
" C-u Begin repeat count (then type digits); C-u alone multiplies by 4\n"
|
|
" C-u N <cmd> Repeat <cmd> N times (e.g., C-u 8 C-f moves right 8 chars)\n"
|
|
"\n"
|
|
"Control keys:\n"
|
|
" C-a C-e Line start / end\n"
|
|
" C-b C-f Move left / right\n"
|
|
" C-n C-p Move down / up\n"
|
|
" C-d Delete char\n"
|
|
" C-w / C-y Kill region / Yank\n"
|
|
" C-s Incremental find\n"
|
|
" C-r Regex search\n"
|
|
" C-t Regex search & replace\n"
|
|
" C-h Search & replace\n"
|
|
" C-l / C-g Refresh / Cancel\n"
|
|
"\n"
|
|
"Buffers:\n +HELP+ is read-only. Press C-k ' to toggle; C-k h restores it.\n"
|
|
"\n"
|
|
"Edit modes:\n"
|
|
" code Monospace font (default for source files)\n"
|
|
" writing Proportional font, no highlighting (auto for .txt, .md,\n"
|
|
" .markdown, .rst, .org, .tex, .adoc, .asciidoc)\n"
|
|
" C-k m or : mode [code|writing] to toggle\n"
|
|
"\n"
|
|
"Command prompt (C-k ;, Tab completes):\n"
|
|
" : syntax on|off|reload Syntax highlighting for this buffer\n"
|
|
" : set filetype=NAME Pick the highlighter (cpp, go, python, rust,\n"
|
|
" shell, json, markdown, lisp, sql, erlang, forth)\n"
|
|
"\n"
|
|
"GUI commands (command prompt):\n"
|
|
" : theme NAME Set theme (amber, eink, everforest, gruvbox,\n"
|
|
" kanagawa-paper, lcars, leuchtturm, nord, old-book,\n"
|
|
" orbital, plan9, solarized, tufte, weyland-yutani,\n"
|
|
" zenburn)\n"
|
|
" : background MODE Background: light | dark\n"
|
|
" : font NAME Font for this edit mode (tab completes; b612, berkeley,\n"
|
|
" berkeley-bold, brassmono, brassmono-bold,\n"
|
|
" brassmonocode, brassmonocode-bold, crimsonpro,\n"
|
|
" default, etbook, fira, go, ibm, idealist,\n"
|
|
" inconsolata, inconsolataex, iosevka, iosevkaex,\n"
|
|
" sharetech, space, spectral, syne, triplicate,\n"
|
|
" unispace)\n"
|
|
" : font-size NUM Set font size in pixels\n"
|
|
" : mode [code|writing] Toggle or set edit mode\n"
|
|
"\n"
|
|
"Configuration:\n"
|
|
" Config file: ~/.config/kte/kge.toml (see CONFIG.md)\n"
|
|
" Legacy kge.ini is also supported.\n"
|
|
"\n"
|
|
"GUI keys (Cmd instead of Ctrl on macOS):\n"
|
|
" Ctrl+= Ctrl+- Ctrl+0 Font size bigger / smaller / reset\n"
|
|
" Ctrl+V Paste from the system clipboard\n"
|
|
"\n"
|
|
"GUI window management:\n"
|
|
" Cmd+N (macOS) Open a new editor window sharing the same buffers\n"
|
|
" Ctrl+Shift+N (Linux) Open a new editor window sharing the same buffers\n"
|
|
" Close window Secondary windows close independently; closing the\n"
|
|
" primary window quits the editor\n"
|
|
);
|
|
}
|