It's time for more intuitive command line movements

From razwiki
Jump to navigation Jump to search

The alphabet of command line stuff!!!

Control
a start of line
b back one letter
c interrupt
d delete forward / send eof
e end of line
f forward one char
g send bell \a (does a cancel in emacs)
h delete backwards
i send tab
j send return
k delete forward to end of line
l clear screen
m send carriage return (obsolete)
n next history item
o ... nothing?
p previous history item
q ... nothing? c-p c-q detaches from docker container
r ... nothing by itself, same as c-p when there is text
s ... nothing by itself, I bind it to accept autocompletion
t TRANSPOSE CHARS WOO
u delete backwards to start of line
v escape key for typing control characters, also used for visual block in vim
w delete word backward
x ... nothing, used as prefix key in emacs
y yank
z stop foreground process

Meta
a ... just types a?
b backward word
c capitalize word and move forward
d delete word forward
e start $EDITOR
f forward word
g ... just types g?
h OPEN CURRENT COMMAND IN MAN
i ... just types i?
j ... just types j?
k ... k
l whoa does ls
m ... m
n ... n
o ... nothing
p whoa adds &| less
q de facto quit
r ... r
s whoa prepend with sudo
t WOOO TRANSPOSE WORDS
u whoa uppercase word
v whoa open in pico
w whoa show whatis for current command
x ... x
y ... nothing
z ... z

tbd: shift+control, shift+meta, special chars.

alt-backspace deletes backwards word

How to delete previous characters until whitespace? Just c-w I guess and delete previous subword is alt-backspace

also there's tricks like alt-up to get the last word of the last command at least on mac


C-a _s_tart of line

|1|here is a lo|0|ng test sentence

C-e _e_nd of line

here is a lo|0|ng test sentence|1|

M-b _b_ack one word

here is a |1|lo|0|ng test sentence