tiny icon indicating copy to clipboard operation
tiny copied to clipboard

Implement a binding for deleting one word forward (maybe C-delete?)

Open osa1 opened this issue 7 years ago • 7 comments

osa1 avatar Feb 26 '19 04:02 osa1

also perhaps M-d (alt-delete): standard in Emacs and the Bash shell

ghost avatar Feb 26 '19 04:02 ghost

Ah, I wasn't aware of that binding. Indeed if it's the standard then we should use it.

osa1 avatar Feb 26 '19 04:02 osa1

To expand on that with some random keybinding info:

Shared between bash, Emacs and tiny:

  • C-a/C-e move cursor to beginning of line/end of line
  • C-k delete the rest of the line
  • C-n/C-p (tiny: next/previous tab, which makes sense because input is only one line.) bash/emacs: next/previous line

In Emacs, C-w deletes the selected region, and in web browsers it deletes the current tab. Currently in tiny, C-w deletes one word backwards, like in Bash.

Possible shortcuts:

  • C-t could be a shortcut to insert /join # into the input field, for quickly joining a channel (following the example of opening a new tab in Firefox and Chrome). In Bash, C-t switches the current char with the previous char (not very useful)
  • C-tab could switch to the previous tab that you were in (useful if you /switched or Alt-#ed from a far away tab), which follows the useful shortcut in web browsers (no binding in Bash or Emacs)

Edit: also:

  • C-b/C-f (move forward and backwards 1 char, Bash and Emacs)
  • M-f/M-b (move forwards and backwards 1 word, Bash and Emacs)

ghost avatar Feb 26 '19 05:02 ghost

  • C-tab could switch to the previous tab that you were in (useful if you /switched or Alt-#ed from a far away tab), which follows the useful shortcut in web browsers (no binding in Bash or Emacs)

Which browser does this? I have Chrome and Firefox installed, and they both switch to the next tab instead of the previous tab.

osa1 avatar Feb 26 '19 05:02 osa1

Ah yes, that's correct. In firefox you have to enable "cycle through tabs in recently used order" apparently. https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly#w_windows-tabs

ghost avatar Feb 26 '19 16:02 ghost

Ah, one problem with using M for this is that we use M-key for changing tabs, e.g. M-n currently switches to tab #tiny for me, M-u switches to #rust etc.

osa1 avatar Feb 27 '19 06:02 osa1

I see. Those were just some suggestions, I guess. Maybe long term the user will be able to set their own keybindings after #66

ghost avatar Feb 27 '19 18:02 ghost