Razzi Unified Keyboard Interface: Difference between revisions

From razwiki
Jump to navigation Jump to search
No edit summary
 
Line 20: Line 20:
== ctrl ==
== ctrl ==
Unlike windows, I use ctrl keys like emacs does. That means ctrl-a moves the cursor to the start of the line, rather than selecting all the text (alt-a does that). Every keyboard I use has a control key. I map caps lock to control; I don't have a caps lock.
Unlike windows, I use ctrl keys like emacs does. That means ctrl-a moves the cursor to the start of the line, rather than selecting all the text (alt-a does that). Every keyboard I use has a control key. I map caps lock to control; I don't have a caps lock.

=== Some keybindings ===
ctrl+tab focuses the next tab to the right. None of that most-recently-used algorithm junk, I like to be able to see where the focus is moving.

ctrl-a sends "home" or start of line

ctrl-b sends backwards character

ctrl-c is application-specific... this ain't windows, it's not for copying

ctrl-d deletes forward. Some applications overload this to send EOF and that's fine.

ctrl-e end of line

ctrl-f forward char

ctrl-g application specific, often functioning similarly as "escape" in gui programs (emacs for example)

ctrl-h backspace

ctrl-i literal tab?

ctrl-j sends enter

ctrl-k delete forwards until eol

ctrl-l

ctrl-m

ctrl-n down arrow

ctrl-o

ctrl-p up arrow

ctrl-q TBD, I used to have this go backwords a word but things like docker use this raw control character, so that's a hassle

ctrl-r

ctrl-s TBD, I use this for autocomplete, but it's also used for search in emacs for example

ctrl-t transpose characters

ctrl-u delete backwards to start of line

ctrl-v TBD, application-dependent, I used to use this for forward word

ctrl-x

ctrl-y yank, like a second clipboard that is filled by ctrl-k, but this one is janky and hard to support. Maybe it should be unified with clipboard

ctrl-z

==== Unused ====
ctrl-enter

ctrl-backspace

ctrl-space (I use this in tmux as a prefix key)

ctrl-\ reserved by shell

ctrl-=

ctrl--

ctrl-+

ctrl-1 through 9 ??

ctrl-` ?? open terminal?

ctrl-arrow-keys: ??


== alt ==
== alt ==
Line 27: Line 101:


I tried to use alternate keyboard layouts for a bit, such as workman, and dvorak is very well known. However it was too much work for my brain and the payoff was too little, so I stopped. Generally I can type plenty fast on qwerty, and since so much of my typing is technical, I make heavy use of autocompletion, but that's a tangent.
I tried to use alternate keyboard layouts for a bit, such as workman, and dvorak is very well known. However it was too much work for my brain and the payoff was too little, so I stopped. Generally I can type plenty fast on qwerty, and since so much of my typing is technical, I make heavy use of autocompletion, but that's a tangent.

=== Some keybindings ===
Hitting alt by itself sends escape.

alt+space opens an Alfred-like app launcher.

right-alt space functions like alt-tab.

alt-1 through alt-9 is used for switching focus on tabs.

alt-` cycles focus between windows of an application

alt-- and alt-= zoom in and out via text sizing

alt-0 resets zoom

alt-backspace: TBD, on macos it deletes until the start of the line, which is redundant with ctrl-u

alt-\ ??

alt-s save

alt-r reload

== Shift ==
shift+enter adds a newline to a field and does not send the input. (for messages for example)

conversely, command+enter submits a form that has a textarea-style input.

== Ok let's put that all together into a table ==
{| class="wikitable"
|+
!
!
!control
!alt
!shift+control
|-
|space
|
|application-specific prefix key
|OS-level spotlight; right-alt space opens tab switcher (should it though?)
|
|-
|return
|submit input/newline
|
|
|
|-
|tab
|focus next element/autocomplete
|focus next tab to the right
|cycle focus through applications
|focus next tab to the left
|-
|a
|send a
|move cursor to start of line
|select all text
|
|-
|alt (alone)
|send escape
|
|n/a
|
|}


= Case studies =
= Case studies =

Latest revision as of 23:33, 4 March 2023

I have 2+ computers with the usual suspects of operating systems: windows, debian/ubuntu, macos. Perhaps macos will fade into obscurity in my computing life, but currently it has the best support for keyboard shortcuts.

On top of the operating system, we have the desktop environment. In the windows and macos case, these are synonymous with the operating system. In debian/ubuntu, I tend to stick with the default gnome. This has windows-like keyboard shortcuts. It also introduced me to a longtime favorite: control+alt+t for a terminal.

The applications I use are basically: terminal, browser, text editor.

Browser

Firefox is currently my browser of choice, though I think there's a lot of innovation possible here.

Terminal

Terminals are all pretty much the same, ever since windows came out with Windows Terminal which is not garbage. Tmux introduces its own keybindings, though I think ideally I'd work this one out of my standard setup and use it more as a special-purpose tool; it'd be nice to use os-level concepts of tabs and leave out the complexity of mouse+tmux kinds of issues.

Text Editor

Text editor of choice tends to be emacs, though it pisses me off sometimes. Still it's the best. I use vim a lot as well. I tend to shy away from IDEs, as they tend to be slow, distract from the purpose of text editing, and are slow... so slow I say it twice.

That's the backstory for this effort I'm partaking in now, which is: to document the keyboard shortcuts I use on a regular basis, and the progress towards implementing all of them on all the various OSes I use.

Modifier Keys

ctrl

Unlike windows, I use ctrl keys like emacs does. That means ctrl-a moves the cursor to the start of the line, rather than selecting all the text (alt-a does that). Every keyboard I use has a control key. I map caps lock to control; I don't have a caps lock.

Some keybindings

ctrl+tab focuses the next tab to the right. None of that most-recently-used algorithm junk, I like to be able to see where the focus is moving.

ctrl-a sends "home" or start of line

ctrl-b sends backwards character

ctrl-c is application-specific... this ain't windows, it's not for copying

ctrl-d deletes forward. Some applications overload this to send EOF and that's fine.

ctrl-e end of line

ctrl-f forward char

ctrl-g application specific, often functioning similarly as "escape" in gui programs (emacs for example)

ctrl-h backspace

ctrl-i literal tab?

ctrl-j sends enter

ctrl-k delete forwards until eol

ctrl-l

ctrl-m

ctrl-n down arrow

ctrl-o

ctrl-p up arrow

ctrl-q TBD, I used to have this go backwords a word but things like docker use this raw control character, so that's a hassle

ctrl-r

ctrl-s TBD, I use this for autocomplete, but it's also used for search in emacs for example

ctrl-t transpose characters

ctrl-u delete backwards to start of line

ctrl-v TBD, application-dependent, I used to use this for forward word

ctrl-x

ctrl-y yank, like a second clipboard that is filled by ctrl-k, but this one is janky and hard to support. Maybe it should be unified with clipboard

ctrl-z

Unused

ctrl-enter

ctrl-backspace

ctrl-space (I use this in tmux as a prefix key)

ctrl-\ reserved by shell

ctrl-=

ctrl--

ctrl-+

ctrl-1 through 9 ??

ctrl-` ?? open terminal?

ctrl-arrow-keys: ??

alt

Also known as "command" in macos. These are application sort of shortcuts. alt-w is close tab, for example. This get a bit tricky in terminal, as alt-d is delete forward word. This kind of clashing is why I'm putting some effort into making a unified keyboard interface.

I only type in english and don't really use accents. MacOS has an option key with some nice shortcuts, such as option-n for n-tilde. They also have a fancy accent-adding ui and emoji selector built in. I don't really use these, but they are cool. good work mac ui engineers.

I tried to use alternate keyboard layouts for a bit, such as workman, and dvorak is very well known. However it was too much work for my brain and the payoff was too little, so I stopped. Generally I can type plenty fast on qwerty, and since so much of my typing is technical, I make heavy use of autocompletion, but that's a tangent.

Some keybindings

Hitting alt by itself sends escape.

alt+space opens an Alfred-like app launcher.

right-alt space functions like alt-tab.

alt-1 through alt-9 is used for switching focus on tabs.

alt-` cycles focus between windows of an application

alt-- and alt-= zoom in and out via text sizing

alt-0 resets zoom

alt-backspace: TBD, on macos it deletes until the start of the line, which is redundant with ctrl-u

alt-\ ??

alt-s save

alt-r reload

Shift

shift+enter adds a newline to a field and does not send the input. (for messages for example)

conversely, command+enter submits a form that has a textarea-style input.

Ok let's put that all together into a table

control alt shift+control
space application-specific prefix key OS-level spotlight; right-alt space opens tab switcher (should it though?)
return submit input/newline
tab focus next element/autocomplete focus next tab to the right cycle focus through applications focus next tab to the left
a send a move cursor to start of line select all text
alt (alone) send escape n/a

Case studies

control-t

control t transposes the 2 characters before the cursor. This one saves me a lot of time and generally allows me to relax while typing: hitting 2 keys out of order just means I recognize it, hit control-t, and move on. Taking this way further there is the keychording typing model, which I haven't looked in to yet.

ctrl-t windows macos debian
browser https://sr.ht/~razzi/firefox-control-t/ built in TODO
terminal bind \ct transpose-chars
text editor https://github.com/razzius/.emacs.d/blob/master/init.el#L450

alt-f

opens a find text interface. This is tricky in firefox on windows because the default shortcut for this is control f, but I swap control and alt in firefox using dark magic, but then vimium things alt-f is for its "open links" functionality so it takes over. The current workaround for this use case is to use insert mode then hit alt-f. I could do some vimium remapping to remove f and maybe use o for opening links.

See Also

https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts