!
!n
!-n
!!
(!-1
)
!str
!?str
[?\n
] — containing
^str^str^
— equiv. to !:s^str^str^
!#:
typed so far, entire
:0 |
command word |
:n |
nth arg |
^ |
word 1 |
$ |
word minus one (last) |
% |
first word that matched "containing" |
:m-n |
range of words |
-n
|
:0-n |
*-
|
:1-$ |
:x*
|
:x-$ |
:x-
|
x to without last |
:h |
directory
(head) |
||
:t |
only
file name (tail) |
||
:r |
without.xxx |
||
:e |
only .xxx |
||
:p |
dry
run |
||
:q |
quote subs |
||
:x |
quote but break |
||
: |
[gG]s D… |
D |
…[D/endl] |
& |
→ null → & → prev |
||
:& |
same sub |
History expansion | supplement | |||||
---|---|---|---|---|---|---|
!$ |
last arg last
command |
|||||
!^ |
first arg last command |
|||||
!-2:0^ | subcmd name of previous last | |||||
!? |
commit message | |||||
ls .. !#$/.. !#$/.. !#$/.. | typed so far | |||||
!!- | command w/o last arg | |||||
!!
|
swap "HEAD" for "HEAD^" | |||||
!?ommi?:p | then | !:0 !% | ||||
after dry run search for 'commit' | — | command word and matched word | ||||
ls !$:h | visit file's directory | !$:t | filename | tail | ||
head | !$:t:r | w/o dot suffix | (any leng) | |||
!* | only args | (set -Ho history) | in scripts |