2024-04-06 19:14:58 +08:00
|
|
|
#!/bin/zsh
|
|
|
|
|
2024-04-16 13:54:22 +08:00
|
|
|
#--- zshrc ---#
|
2024-04-16 15:08:35 +08:00
|
|
|
|
|
|
|
profile () {
|
2024-04-16 13:54:22 +08:00
|
|
|
source $profile
|
|
|
|
}
|
2024-04-16 15:08:35 +08:00
|
|
|
profile-edit () {
|
|
|
|
$POPUP_EDIT $profile
|
|
|
|
profile
|
|
|
|
}
|
2024-04-16 13:54:22 +08:00
|
|
|
|
2024-04-22 18:55:30 +08:00
|
|
|
#--- custom CLI tools ---#
|
|
|
|
|
|
|
|
# Fast run a command in background with no log
|
|
|
|
bg () {
|
|
|
|
eval "$@" &>/dev/null &disown
|
|
|
|
}
|
|
|
|
|
|
|
|
# Execute an AppImage and automaticly +x it
|
|
|
|
appimage() {
|
|
|
|
chmod a+x $1
|
|
|
|
$1
|
|
|
|
}
|
|
|
|
|
|
|
|
# Set file meta (like icons) in linux fs
|
|
|
|
file-set-icon () {
|
|
|
|
gio set $1 metadata::custom-icon $2
|
|
|
|
}
|
|
|
|
file-rm-icon () {
|
|
|
|
gio set -d $1 metadata::custom-icon
|
|
|
|
}
|
|
|
|
cat-desktop-ini () {
|
|
|
|
cat "$1/desktop.ini"
|
|
|
|
}
|
|
|
|
|
|
|
|
# # where proxy
|
|
|
|
# proxy () {
|
|
|
|
# export http_proxy="http://127.0.0.1:7890"
|
|
|
|
# export https_proxy="http://127.0.0.1:7890"
|
|
|
|
# echo "HTTP Proxy on"
|
|
|
|
# }
|
|
|
|
|
|
|
|
# # where noproxy
|
|
|
|
# noproxy () {
|
|
|
|
# unset http_proxy
|
|
|
|
# unset https_proxy
|
|
|
|
# echo "HTTP Proxy off"
|
|
|
|
# }
|
|
|
|
|
|
|
|
#--- enhanced CLI tools aliases ---#
|
|
|
|
|
|
|
|
# cat is bat
|
2024-04-06 19:14:58 +08:00
|
|
|
alias cat='bat'
|
2024-04-22 18:55:30 +08:00
|
|
|
# ls is lsd
|
2024-04-06 19:14:58 +08:00
|
|
|
alias cols='lsd'
|
|
|
|
alias crls='cols'
|
|
|
|
alias ccls='crls -g'
|
|
|
|
alias cl='ccls -lA'
|
|
|
|
alias cll='ccls -l'
|
|
|
|
alias cla='ccls -la'
|
|
|
|
alias lc='ccls'
|
|
|
|
alias ls='lc'
|
|
|
|
alias l='cl'
|
|
|
|
alias ll='cll'
|
|
|
|
alias la='cla'
|
|
|
|
alias lgg='ccls --tree'
|
2024-04-22 18:55:30 +08:00
|
|
|
# cd is zoxide
|
2024-04-06 19:14:58 +08:00
|
|
|
# zoxide must init after compinit is called
|
|
|
|
eval "$(zoxide init zsh)"
|
|
|
|
alias cd='z'
|
2024-04-22 18:55:30 +08:00
|
|
|
# fuck
|
|
|
|
eval $(thefuck --alias)
|
|
|
|
|
|
|
|
#--- other toolchain alias ---#
|
|
|
|
|
|
|
|
# gcc c++ complier
|
|
|
|
alias gpp="g++"
|
|
|
|
alias gxx="g++"
|