Some things that I keep having to look up about the Z-shell.
- Argument modification
| mod |
result |
:h |
remove last component of pathname |
:t |
remove all leading components |
:r |
remove extension |
:e |
remove all but extension |
:u |
uppercase first letter |
:l |
lowercase first letter |
:s/l/r/ |
substitute l by r (& in r is replaced by l) |
:& |
repeat last substitution |
:g |
apply modifier once to each word |
:a |
apply modifier as much as possible |
:p |
print line but do not execute |
- History substitution
| mod |
result |
| |
Event selection |
!! |
previous command |
!n |
command number n |
!-n |
nth previous command |
!str |
most recent starting with str |
!?str[?] |
most recent containing str |
!# |
current command |
| |
Argument selection |
:0 |
first word (command) |
:n |
nth argument |
[:]^ |
first argument |
[:]$ |
last argument |
[:]% |
word matching str in most recent search |
:x-y |
range of words |
[:]* |
all arguments |
:x* |
:x-$ |
:x- |
:x-$ but omitting last argument |