zsh
설치
- Arch Linux
- Debian
sudo pacman -S zsh
sudo apt install -y zsh
chsh -s $(which zsh)
starship
- Arch Linux
- Debian
sudo pacman -S ttf-meslo-nerd
sudo mkdir -p /usr/share/fonts/NerdFonts
curl -sL https://github.com/ryanoasis/nerd-fonts/releases/latest/download/Meslo.tar.xz \
| sudo tar -xvJf - -C /usr/share/fonts/NerdFonts \
&& sudo fc-cache -fv
curl -sS https://starship.rs/install.sh | sh
플러그인
- https://github.com/zsh-users/zsh-completions
- https://github.com/zsh-users/zsh-syntax-highlighting
- https://github.com/zsh-users/zsh-autosuggestions
ZSH_PLUGINS_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins \
&& mkdir -p $ZSH_PLUGINS_DIR \
&& git clone https://github.com/zsh-users/zsh-completions.git $ZSH_PLUGINS_DIR/zsh-completions \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_PLUGINS_DIR/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_PLUGINS_DIR/zsh-autosuggestions
.zshrc
~/.zshrc
is_installed() {
[ -n "$(command -v "$1" 2>/dev/null)" ]
}
######################
# User configuration #
######################
# History
HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt HIST_IGNORE_DUPS
export PATH=$PATH:$HOME/.local/bin
# Plugins
ZSH_PLUGINS_DIR=${XDG_DATA_HOME:-$HOME/.local/share}/zsh/plugins
fpath+=$ZSH_PLUGINS_DIR/zsh-completions/src
autoload -Uz compinit && compinit
source $ZSH_PLUGINS_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
source $ZSH_PLUGINS_DIR/zsh-autosuggestions/zsh-autosuggestions.zsh
is_installed fzf && eval "$(fzf --zsh)"
git_remove_local_branch () {
git remote update --prune \
&& git switch --detach origin/HEAD \
&& git for-each-ref --format '%(refname:short)' refs/heads | xargs -r -t git branch -D
}
# 마지막 줄
eval "$(starship init zsh)"