# # .zshrc - started by panki on 20200226 # fpath+=($HOME/.zsh/pure) autoload -Uz compinit promptinit autoload -z edit-command-line zle -N edit-command-line compinit promptinit # fix background color being black... PS1=${PS1//\%K{black}/%k} # Return Code on right prompt RPS1='[%F{yellow}%?%f]' # history stuff HISTSIZE=9000 SAVEHIST=9000 setopt appendhistory bindkey -e path+=('/home/panki/.local/bin') # thanks to slashbeast for these ones # Fancy cd that can cd into parent directory, if trying to cd into file. # useful with ^F fuzzy searcher. cd() { if (( $+2 )); then builtin cd "$@" return 0 fi if [ -f "$1" ]; then echo "${yellow}cd ${1:h}${NC}" >&2 builtin cd "${1:h}" else builtin cd "${@}" fi } alias sudo='sudo --preserve-env=HOME' alias grep='grep --colour=auto' alias ls='ls --color=auto' alias ll='ls -alFh' alias vi='nvim' alias vim='vi' alias devel='cd /mnt/c/devel' alias desk='cd /mnt/c/Users/PankratzF/Desktop' alias e='explorer.exe .' alias nmap='/mnt/c/Program\ Files\ \(x86\)/Nmap/nmap.exe' alias sudo='sudo ' alias ds='dig +short' alias kw='date +%V' lt () { ls -lt ${1} | head } # define slash and underscore as word separators WORDCHARS=${WORDCHARS/\/} WORDCHARS=${WORDCHARS/_} # vi stuff if [[ "$(command -v nvim)" ]]; then export EDITOR='nvim' export MANPAGER='nvim +Man!' export MANWIDTH=999 fi # jump to man flag function fman () { man -P "less -p \"^ +$2\"" $1 } # fzf stuff export FZF_TMUX=1 export FZF_DEFAULT_OPTS='--height 40%' export FZF_COMPLETION_TRIGGER='~~' source /usr/share/doc/fzf/examples/key-bindings.zsh alias fp='fzf --preview "bat --style=numbers --color=always --line-range :500 {}"' # cheat - display text reminders function cheat() { bat -l md -p ~/cheat/"$1" } compdef '_files -W "/home/panki/cheat"' cheat # tokens etc source ~/.exports # wezterm source ~/.zsh/wezterm.sh # This will set the default prompt to the fade theme if [[ $UID -eq 0 ]]; then HISTFILE="${HISTFILE%_history}_root_history" prompt fade red else HISTFILE=~/.histfile prompt pure fi ICONS=(😈 💀 🤡 👻 👽 👾 🤖 😺 💋 💥 🦥 🐣 🐧 🐸 🐢 🐍 🐳 🌴 🍉 🍎 🍒 🥝 🥥 🥨 🍕 ☕ 🚨 🚀 🛸 🪐 🌠 🌙 🌞 🌈 ⚡ 🔥 💧 ✨ 🎉 💎 💾 📎 💣 📡 ) export PURE_PROMPT_SYMBOL="$(shuf -n1 -e "${ICONS[@]}")" __wezterm_set_user_var "ICON" $PURE_PROMPT_SYMBOL