| keys | action |
|---|---|
ESCESC |
inserts the last command with sudo prefix (requires sudo plugin). |
ESC+. |
inserts the last argument of the previous history line, repeat to go back in history. (Same in Bash.) |
ESC+' |
quotes the whole line. (Useful for su -c or ssh). |
ESC+q |
clears the line and inserts it again on the next prompt, allowing you to issue an interim command. |
ESC+RETURN |
inserts a literal newline, so you can edit longer commands easily. |
|
returns the filename (in /dev/fd if supported or as a FIFO) of the pipe given by command for reading. (For example, use diff <(ruby foo.rb) <(ruby-1.9 foo.rb) to compare two program outputs). |
|
substitutes old with new once in the pwd and chdirs there. |
|
expands to the previous history line’s last argument, |
|
expands to the full path of foo in the PATH (like which foo). |
|
abbreviates |
|
globs numbers between 42 and 69. Drop the number(s) to make it open-valued. |
|
expands recursively like |
source: leahneukirchen
$> sh -c "$(curl -fsSL https://raw.githubusercontent.com/jujumo/memento/refs/heads/main/coding/linux/zsh-setup.sh)"$> sudo apt-get install zsh curl git
$> sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
$> sh -c "$(curl -fsSL https://raw.githubusercontent.com/jujumo/memento/refs/heads/main/coding/linux/zsh-setup.sh)"|
Note
|
if you get an error mentioning missing remote-https, please refer to git section in link:../../misc/synology.adoc .
|
get my theme
$> wget https://raw.githubusercontent.com/jujumo/memento/main/coding/linux/jumo.zsh-theme -O ~/.oh-my-zsh/themes/jumo.zsh-theme
$> curl https://raw.githubusercontent.com/jujumo/memento/main/coding/linux/jumo.zsh-theme -o ~/.oh-my-zsh/themes/jumo.zsh-theme # or use curl if you preferenable plugins
$> cat <<EOT >> profile.patch
11c11
< ZSH_THEME="robbyrussell"
---
> ZSH_THEME="jumo"
73c73,82
< plugins=(git)
---
> plugins=(
> cp
> gitfast
> common-aliases
> rsync
> debian
> sudo
> screen
> docker
> )
EOT
$> patch .zshrc -i profile.patch
$> . ~/.zshrc # apply changesIn some cases, through ssh, HOME and END does not work as expected.
Adding the following to .zshrc usually restore the their behavior.
...
bindkey "\033[1~" beginning-of-line
bindkey "\033[4~" end-of-line
or
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-charcomplete list of which zsh config files are loaded
| Interactive login | Interactive non═login | Script | |
|---|---|---|---|
|
A |
A |
A |
|
B |
B |
B |
|
C |
— |
— |
|
D |
— |
— |
|
E |
C |
— |
|
F |
D |
— |
|
G |
— |
— |
|
H |
— |
— |
on logout |
|||
|
I |
— |
— |
|
J |
— |
— |