Xavier Olive research teaching python blog til cli

Bindkeys

30 October 2021

Illustrating most basic keyboard motions (a.k.a. bindkeys) with a basic command, and a cursor placed somewhere in the middle of the line:

tar xvf program-1.2.3.t@ar.gz; cd ${-%%.tar.gz}

Basic motions

  • Ctrl+A stands for beginning-of-line
@tar xvf program-1.2.3.tar.gz; cd ${-%%.tar.gz}
  • Ctrl+E stands for end-of-line
tar xvf program-1.2.3.tar.gz; cd ${-%%.tar.gz}@ 
  • Ctrl+B stands for backward-char
tar xvf program-1.2.3.@tar.gz; cd ${-%%.tar.gz}
  • Ctrl+F stands for forward-char
tar xvf program-1.2.3.ta@r.gz; cd ${-%%.tar.gz}
  • Alt+B stands for backward-word
tar xvf program-1.2.3.@tar.gz; cd ${-%%.tar.gz}
  • Alt+F stands for forward-word
tar xvf program-1.2.3.tar.@gz; cd ${-%%.tar.gz}

Killing

  • Ctrl+D stands for kill-char
tar xvf program-1.2.3.t@r.gz; cd ${-%%.tar.gz}
  • Ctrl+H stands for backward-kill-char
tar xvf program-1.2.3.@ar.gz; cd ${-%%.tar.gz}
  • Alt+D stands for kill-word
tar xvf program-1.2.3.t@.gz; cd ${-%%.tar.gz}
  • Ctrl+W stands for backward-kill-word
tar xvf program-1.2.3.@ar.gz; cd ${-%%.tar.gz}
  • Ctrl+K stands for kill-line
tar xvf program-1.2.3.t@
  • Ctrl+U stands for kill-whole-line
@

Miscellaneous

  • Alt+Q stands for push-line
    Alt+G stands for get-line
tar xvf program-1.2.3.t@ar.gz; cd ${-%%.tar.gz}

press Alt+Q (and look for help pages?):

@

get it back with Alt+G (or after returning a (possibly empty) command)

tar xvf program-1.2.3.tar.gz; cd ${-%%.tar.gz}@
  • Alt+T stands for transpose-word

Start from:

tar xvf program-1.2.3.tar.@gz; cd ${-%%.tar.gz}

and get:

tar xvf program-1.2.3.gz.tar@; cd ${-%%.tar.gz}
  • Ctrl+X = stands for what-cursor-position
tar xvf program-1.2.3.gz.t@ar; cd ${-%%.tar.gz}
Char: a (0141, 97, 0x61) point 26 of 49(52%) column 25
  • Ctrl+X Ctrl+E stands for edit-command-line
    Edit current line in your EDITOR