gphalkes / tilde

The Tilde text editor
395 stars 21 forks source link

[Feature Request] More shortcuts! #84

Open rdrms opened 2 years ago

rdrms commented 2 years ago

Hello! I really like this editor. One thing I don't often use in other editors but can be quite useful is shortcuts to go to the next character, word, sentence, and paragraph. Of course you can use the arrow keys for characters, and ctrl+arrow_keys for next word, but perhaps it would be worth it to add additional shortcuts?

For some prior art, here is a few examples:

Cursor movement in uemacs, the ageing editor used by Linus Torvalds:

^ = control+key
Backward character ....      ^B         Forward character .....      ^F
Previous word ......... Meta  B         Next word ............. Meta  F
Beginning of line .....      ^A         End of line ...........      ^E
Previous line .........      ^P         Next line .............      ^N
Previous paragraph .... Meta  P         Next paragraph ........ Meta  N
Previous page .........      ^Z         Next page .............      ^V
Beginning of file ..... Meta  <         End of file ........... Meta  >

GNU EMACS: https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html

vim:

h   move one character left
j   move one row down
k   move one row up
l   move one character right
w   move to beginning of next word
b   move to previous beginning of word
e   move to end of word
W   move to beginning of next word after a whitespace
B   move to beginning of previous word before a whitespace
E   move to end of word before a whitespace

More vim shortcuts here: https://vim.fandom.com/wiki/All_the_right_moves

Obviously some of these examples conflict with current shortcuts (and tilde is not a modal editor like vim). I think the current shortcuts are really great since most users are already used to ctrl+x to copy, for example. But there's lots of characters on the keyboard left to add shortcuts to, but it really is your editor and up to you if you want to add these, unless there is a way to keep the current shortcuts but add the functionality so that one could edit the settings to add their own keybinds (if they choose)?

Thanks for your time and the great editor!