I have been using oh-my-zsh for some years now and I like it so much, that installing zsh and oh-my-zsh is one of the first things I do when I get access to a new system. So this is my new go-to place to copy commands and settings from.
Installing zsh and git, debian-based linux:
sudo apt install zsh git
Installing oh-my-zsh:
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
After having installed oh-my-zsh (and possibly manually set your default shell to zsh), it’s time to configure .zshrc
. Usually, this configuration is very dependent on the use of the system, so here are a few snippets.
ZSH_THEME="ys"
alias push="git push"
alias pull="git pull"
alias status="git status"
alias add="git add"
alias commit="git commit"
alias open=xdg-open
alias pbcopy="xclip -i -selection clipboard"
alias pbpaste="xclip -o -selection clipboard"
bindkey '^R' history-incremental-pattern-search-backward
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export VISUAL=vim
export EDITOR=vim
copypwd () {
/usr/bin/keyring get $1 $2 | pbcopy
}
showpwd () {
/usr/bin/keyring get $1 $2
}
setpwd () {
/usr/bin/keyring set $1 $2
}
activate () {
if [ -e "./$1/bin/activate" ] ; then
source "./$1/bin/activate"
else
if [ -e "./$1/activate" ] ; then
source "./$1/activate"
else
if [ -e "./$1/activate.env" ] ; then
source "./$1/activate.env"
else
if [ -e "$HOME/env/$1/bin/activate" ] ; then
source "$HOME/env/$1/bin/activate"
else
if [ -e "$HOME/env/$1/activate" ] ; then
source "$HOME/env/$1/activate"
else
if [ -e "$HOME/env/$1/activate.env" ] ; then
source "$HOME/env/$1/activate.env"
else
fi
fi
fi
fi
fi
fi
}