dotfiles-remastered/.zshrc

125 lines
3.5 KiB
Bash
Raw Normal View History

2020-06-11 13:11:19 +00:00
############################
# #
# ███████╗███████╗██╗ ██╗ #
# ╚══███╔╝██╔════╝██║ ██║ #
# ███╔╝ ███████╗███████║ #
# ███╔╝ ╚════██║██╔══██║ #
# ███████╗███████║██║ ██║ #
# ╚══════╝╚══════╝╚═╝ ╚═╝ #
# #
############################
2020-06-11 19:54:49 +00:00
# Required packages:
# - zsh
2020-08-03 15:03:44 +00:00
# - oh-my-zsh-git (AUR)
2020-08-03 14:28:12 +00:00
# - zsh-theme-powerlevel10k
# - zsh-syntax-highlighting
2020-06-11 19:54:49 +00:00
# - zsh-completions
# - zsh-autosuggestions
2020-08-03 14:28:12 +00:00
# - nerd-font-hack (AUR)
# - lsd
# - fzf
# - pkgfile
2020-07-14 21:04:54 +00:00
# - trash-cli (with gvfs)
2020-06-11 19:54:49 +00:00
2022-05-29 16:52:19 +00:00
export PATH=$HOME/.local/bin:$HOME/.dotnet/tools:$XDG_DATA_HOME/npm_global/bin:$XDG_DATA_HOME/npm_global/bin:$XDG_DATA_HOME/cargo/bin:$PATH
2020-06-11 13:11:19 +00:00
[[ $- != *i* ]] && return
2021-02-26 15:11:35 +00:00
[ -n $SSH_CONNECTION ] && source ~/.profile
2020-06-11 13:11:19 +00:00
# Oh my zsh stuff
2020-06-12 15:41:36 +00:00
# powerline instant promt
if [ -z $SSH_CONNECTION ]; then
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
2020-06-11 13:11:19 +00:00
fi
export ZSH="/usr/share/oh-my-zsh"
export HISTFILE="$XDG_CACHE_HOME/zsh_history"
if [[ -n $SSH_CONNECTION ]]; then
ZSH_THEME="gallois"
else
ZSH_THEME="../../zsh-theme-powerlevel10k/powerlevel10k"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
# [[ ! -f "$XDG_CACHE_HOME/p10k.zsh" ]] || source "$XDG_CACHE_HOME/p10k.zsh"
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
fi
2020-06-25 19:28:33 +00:00
# wal subshell
(cat ~/.cache/wal/sequences &)
2020-06-25 19:28:33 +00:00
2020-06-11 13:11:19 +00:00
DISABLE_UPDATE_PROMPT=true
DISABLE_AUTO_UPDATE=true
ZSH_CACHE_DIR="$XDG_CACHE_HOME/oh-my-zsh" # mkdir ~/.cache/oh-my-zsh
_Z_DATA="$XDG_CACHE_HOME/z"
2021-02-26 15:11:35 +00:00
2020-06-11 13:11:19 +00:00
plugins=(
git
last-working-dir
colored-man-pages
extract
z
)
# start oh my zsh
source $ZSH/oh-my-zsh.sh
2020-12-18 17:09:44 +00:00
autoload -U compinit -d "$XDG_CACHE_HOME/zcompdump"
2020-06-11 13:11:19 +00:00
# Sytax highlight
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# autosugestion
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
# command not found
source /usr/share/doc/pkgfile/command-not-found.zsh
# Variables
# ZSH percent fix
export PROMPT_EOL_MARK=""
# FZF
export FZF_DEFAULT_COMMAND="fd --type file --color=always"
export FZF_DEFAULT_OPTS="--ansi"
2021-10-28 17:43:04 +00:00
# nvm
[ -z "$NVM_DIR" ] && export NVM_DIR="$XDG_CACHE_HOME/nvm"
alias nvm-init="source /usr/share/nvm/nvm.sh;source /usr/share/nvm/install-nvm-exec"
2020-06-11 13:11:19 +00:00
# Aliases
alias vim="nvim"
alias sudo='sudo '
alias please='sudo '
2021-05-24 13:31:03 +00:00
[ -z $SSH_CONNECTION ] && alias ls='exa --icons'
2020-06-11 13:11:19 +00:00
alias svim='sudo -E nvim'
alias xclip='xclip -selection "clipboard"'
alias mixer='ncpamixer'
alias dotfiles="git --git-dir=$XDG_DATA_HOME/dotfiles-remastered --work-tree=$HOME" # dotfile config --local status.showUntrackedFiles no
2020-06-15 14:49:25 +00:00
alias open="xdg-open"
2020-06-25 17:52:20 +00:00
alias mixer="pulsemixer"
2021-10-28 17:43:04 +00:00
alias yt-dl-audio="youtube-dl --extract-audio --audio-format mp3 -o '%(title)s.%(ext)s'"
2020-07-14 21:04:54 +00:00
alias rm="trash"
2020-10-26 23:09:54 +00:00
alias modx="chmod +x"
2020-10-27 23:14:23 +00:00
alias mv="mv -iv"
alias cp="cp -riv"
alias mkdir="mkdir -pv"
2021-02-26 15:11:35 +00:00
alias ssh="TERM=xterm-256color ssh"
alias yeet="sudo pacman -Rns"
2021-05-24 13:31:03 +00:00
alias ip="ip -c=auto"
2021-10-28 17:43:04 +00:00
alias syu="sudo pacman -Syu"
alias virsh="virsh -c qemu:///system"