1
0
Fork 0
dotfiles/.zshrc

106 lines
2.8 KiB
Bash
Raw Permalink Normal View History

2021-09-10 12:58:38 +00:00
# Autocompletion
2022-07-19 18:13:04 +00:00
autoload -Uz compinit promptinit vcs_info
2021-09-10 12:58:38 +00:00
compinit
zmodload zsh/complist
promptinit
# Include hidden files
_comp_options+=(globdots)
2022-07-19 18:13:04 +00:00
setopt prompt_subst
2021-10-18 21:49:16 +00:00
setopt extendedglob
2021-09-10 12:58:38 +00:00
setopt COMPLETE_ALIASES
setopt autocd
2021-09-10 16:36:18 +00:00
setopt CORRECT
setopt CORRECT_ALL
CORRECT_IGNORE="[_|.]*"
2021-09-10 12:58:38 +00:00
# Autocompletion cache
zstyle ':completion:*' use-cache on
2021-11-04 21:33:52 +00:00
zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh"
2021-09-10 12:58:38 +00:00
# Double TAB arrow-key driven selection
zstyle ':completion:*' menu select
# Ignore completion functions for unavailable commands
zstyle ':completion:*:functions' ignored-patterns '_*'
# Remove trailing directory slash
zstyle ':completion:*' squeeze-slashes true
2022-07-19 18:13:04 +00:00
# Enable (only) git detection
zstyle ':vcs_info:*' enable git
2021-09-10 12:58:38 +00:00
# History
2022-02-16 18:11:16 +00:00
setopt hist_ignore_all_dups
2021-09-10 12:58:38 +00:00
HISTFILE="$HOME/.zsh/history"
2022-02-16 18:11:16 +00:00
HISTSIZE=100000000
2021-09-10 12:58:38 +00:00
SAVEHIST=$HISTSIZE
2022-07-19 18:13:04 +00:00
# Functions
git_branch() {
git symbolic-ref --short HEAD 2> /dev/null
}
2021-09-10 12:58:38 +00:00
# Prompt theme
2022-07-19 18:13:04 +00:00
precmd() { print -rP "%F{#ebcb8b}%n%f%F{#8fbcbb}@%F{#81a1c1}%m%f %F{#d08770}%B%~%b%f %F{#a3be8c}$(git_branch)%f" }
2021-09-11 01:20:34 +00:00
PROMPT=' > '
2021-09-10 12:58:38 +00:00
2021-09-10 16:36:18 +00:00
eval $(dircolors ~/.dir_colors)
zstyle ':completion:*:default' list-colors "${(s.:.)LS_COLORS}"
2021-09-10 12:58:38 +00:00
# Bindings
bindkey -e
bindkey "^[[A" history-beginning-search-backward
bindkey "^[[B" history-beginning-search-forward
# Aliases
alias ls='ls -A --color=auto'
2021-09-10 16:36:18 +00:00
alias l='ls -Ahl --color=auto'
2021-09-10 12:58:38 +00:00
alias grep='grep --color=auto'
2022-07-19 18:13:04 +00:00
alias less='less -i'
2021-09-10 12:58:38 +00:00
alias vim=nvim
alias vi=nvim
2022-02-16 18:11:16 +00:00
alias cat=bat
2021-09-10 12:58:38 +00:00
alias cx=clear
2021-11-04 21:33:52 +00:00
alias mpva='mpv --no-video'
alias gpgsim='gpg -c --no-symkey-cache --cipher-algo AES256 --digest-algo SHA512'
alias updm='sudo reflector --ipv4 --latest 40 --sort rate --save /etc/pacman.d/mirrorlist'
2022-07-19 18:13:04 +00:00
alias clpkc='paccache -rk0 && paccache -ruk0 && pacman -Qtdq | sudo pacman -Rns -'
2021-11-04 21:33:52 +00:00
alias noscreenblanking='xset s off -dpms'
2022-02-16 18:11:16 +00:00
alias ytlistf='yt-dlp --list-formats'
2021-11-04 21:33:52 +00:00
alias gc='gcc -lm -O2 -g -Wall -Wextra'
2021-11-17 21:06:46 +00:00
alias g+='g++ -lm -O2 -g -Wall -Wextra'
2021-11-04 21:33:52 +00:00
alias redscreen='redshift -P -O 4000'
alias updchroot='arch-nspawn $CHROOT/root pacman -Syu'
alias chrooted='CHROOT=$HOME/chroot'
2021-11-17 21:06:46 +00:00
alias axelf='axel -4kN'
2021-09-10 12:58:38 +00:00
2022-07-19 18:13:04 +00:00
# git
alias gits='git status'
2021-09-10 12:58:38 +00:00
# just in case
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
# tar stuff
alias untar='tar -xvf'
alias tarxzu="tar --owner=root --group=root --use-compress-program='xz -9eT0' -cvf"
alias tarlzu='tarlz --anonymous -9vcf'
2021-11-17 21:06:46 +00:00
# archive
2022-02-16 18:11:16 +00:00
alias 7zu='7z a -t7z -m0=lzma2 -mfb=273 -md=1536m -mx=9 -ms=on'
2021-11-17 21:06:46 +00:00
2022-07-19 18:13:04 +00:00
# source list
#alias meson-list-src='tree -L 100000 -ifF --noreport $1 | rg -v /$ | sed s/$/,/g'
2021-09-10 12:58:38 +00:00
# export
export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp'
2022-07-19 18:13:04 +00:00
#export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
#export PATH="$PATH:$GEM_HOME/bin:$HOME/bin"
2021-11-04 21:33:52 +00:00
export LESSHISTFILE="$XDG_CACHE_HOME/less/history"
2021-11-17 21:06:46 +00:00
# Plugins
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
2022-07-19 18:13:04 +00:00
source /usr/share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh