Repository navigation
Closed
Labels
Description
Problem
The editor has a full Vim mode (features/vim-mode.mdx) and nothing for Emacs. The custom text view answers some of the Control keys macOS binds in every text field, but not all, and its kill ring does not behave like one:
- It implements the line and paragraph moves,
moveUp,moveDown,deleteToEndOfParagraphandyank, soCtrl+A,Ctrl+E,Ctrl+N,Ctrl+P,Ctrl+KandCtrl+Ywork (apple/Packages/TableProEditor/Sources/TableProTextEngine/TextView/TextView+Move.swift,TextView+Insert.swift:34). - It has no
moveForward,moveBackward,transposeor mark selectors, soCtrl+F,Ctrl+BandCtrl+Tdo nothing. - Every deletion goes into the kill ring, Backspace included (
TextView+Delete.swift:68), soCtrl+K, then a Backspace, thenCtrl+Yyanks the one character the Backspace removed. Consecutive kills do not append either. Ctrl+Spaceis Show completions, built into the editor and not rebindable (features/keyboard-shortcuts.mdx), which is Emacs's set-mark key.
Proposed solution
- An Emacs mode beside Vim mode in Settings > Editor, off by default.
- Movement, kill and yank:
Ctrl+A,Ctrl+E,Ctrl+F,Ctrl+B,Ctrl+N,Ctrl+P,Ctrl+K,Ctrl+Y,Alt+F,Alt+B,Alt+D, plusAlt+Yto cycle the ring after a yank. - Mark and region with
Ctrl+Space, andCtrl+WandAlt+Wover it. In Emacs modeCtrl+Spacesets the mark, so Show completions needs another key there, chosen in this issue. - A real kill ring: only kill commands fill it, and kills in a row append to one entry. Fix the Backspace case for the default bindings too, since it affects everyone who uses
Ctrl+KandCtrl+Ytoday. - The same interception path Vim mode uses (
apple/TablePro/Core/Vim/VimKeyInterceptor.swift), so the two cannot both be active.
Alternatives considered
The default bindings, which cover the line moves and Ctrl+K and Ctrl+Y, and none of the rest.
Platform
macOS
Related database type
N/A / General
Activity