Skip to main content

zsh & utility


설치

sudo pacman -S curl git zsh
chsh -s $(which zsh) \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-completions.git \
${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-autosuggestions \
${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
.zshrc
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"

ZSH_THEME="powerlevel10k/powerlevel10k"

zstyle '"':omz:update'"' mode auto
zstyle '"':omz:update'"' frequency 13 # in days

DISABLE_UNTRACKED_FILES_DIRTY="true"

plugins=(
git
zsh-syntax-highlighting
zsh-autosuggestions
aws
fzf
)

fpath+=${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions/src
source $ZSH/oh-my-zsh.sh

# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh

is_installed() {
[ -n "$(command -v "$1" 2>/dev/null)" ]
}

# User configuration

export PATH=$PATH:$HOME/.local/bin
wget https://github.com/romkatv/dotfiles-public/raw/master/.local/share/fonts/NerdFonts/MesloLGS%20NF%20Regular.ttf

Install MesloLGS NF Regular.ttf

p10k configure

Utility

fcitx5

sudo pacman -S fcitx5-hangul fcitx5-im
/etc/environment
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

asdf

git clone https://github.com/asdf-vm/asdf.git ~/.asdf
.zshrc
# asdf
. $HOME/.asdf/asdf.sh
fpath=(${ASDF_DIR}/completions $fpath)

# 마지막 줄에 추가
autoload -Uz compinit && compinit

fzf

sudo pacman -S fzf
.zshrc
# fzf
export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --border'
# fdfind를 사용하는 경우
export FZF_DEFAULT_COMMAND='fd --type f --follow' # --hidden --exclude .git
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"

경로를 완성할 때 **<Tab>을 사용하면 하위 경로 검색이 가능합니다. 예를 들어 aaa/bbb/ccc/ddd.txt를 찾고 싶으면 aaa/**<Tab> 후에 원하는 파일명을 특징 지을 수 있는 문자열 몇개를 입력하면 됩니다. Ex) b/c/d 또는 c/d.txt

bat

sudo pacman -S bat
.zshrc
# bat
alias cat="bat -p --paging=never"

fd

sudo pacman -S fd

ripgrep(rg)

sudo pacman -S ripgrep

lsd

sudo pacman -S lsd
# lsd
alias ls='lsd --icon never -F'
alias tree='lsd --icon never --tree -F'

pet

wget https://github.com/knqyf263/pet/releases/download/v0.4.0/pet_0.4.0_linux_amd64.deb \
&& sudo dpkg -i pet_0.4.0_linux_amd64.deb
.zshrc
function pet-select() {
BUFFER=$(pet search --query "$LBUFFER")
CURSOR=$#BUFFER
zle redisplay
}
zle -N pet-select
bindkey '^s' pet-select

<param> or <param=default> 기능이 좋긴 한데, < >가 사용되는 명령어들은 파싱이 이상하게 되는 경우가 있습니다. 시간이 되면 PR...

bpytop

python3 -m pip install bpytop