master
Felix Pankratz 6 months ago
parent cc6a54b8f2
commit 0d61dc21b9

100
.zshrc

@ -2,25 +2,27 @@
# .zshrc - started by panki on 20200226 # .zshrc - started by panki on 20200226
# #
fpath+=($HOME/.zsh/pure)
autoload -Uz compinit promptinit autoload -Uz compinit promptinit
autoload -z edit-command-line autoload -z edit-command-line
zle -N edit-command-line zle -N edit-command-line
compinit compinit
promptinit promptinit
# This will set the default prompt to the fade theme # fix background color being black...
prompt fade green PS1=${PS1//\%K{black}/%k}
# Return Code on right prompt # Return Code on right prompt
RPS1='[%F{yellow}%?%f]' RPS1='[%F{yellow}%?%f]'
# history stuff # history stuff
HISTFILE=~/.histfile HISTSIZE=9000
HISTSIZE=1000 SAVEHIST=9000
SAVEHIST=1000
setopt appendhistory setopt appendhistory
bindkey -e bindkey -e
path+=('/home/panki/.local/bin')
# thanks to slashbeast for these ones # thanks to slashbeast for these ones
@ -40,41 +42,61 @@ cd() {
fi fi
} }
setup_git_prompt() { alias sudo='sudo --preserve-env=HOME'
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then alias grep='grep --colour=auto'
unset git_prompt alias ls='ls --color=auto'
return 0 alias ll='ls -alFh'
fi alias vi='nvim'
alias vim='vi'
local git_status_dirty git_branch alias devel='cd /mnt/c/devel'
alias desk='cd /mnt/c/Users/PankratzF/Desktop'
if [ "$(git status --untracked-files='no' --porcelain)" ]; then alias e='explorer.exe .'
git_status_dirty='%F{green}*' alias nmap='/mnt/c/Program\ Files\ \(x86\)/Nmap/nmap.exe'
else alias sudo='sudo '
unset git_status_dirty alias ds='dig +short'
fi alias kw='date +%V'
lt () { ls -lt ${1} | head }
git_branch="$(git symbolic-ref HEAD 2>/dev/null)"
git_branch="${git_branch#refs/heads/}"
if [ "${#git_branch}" -ge 24 ]; then
git_branch="${git_branch:0:21}..."
fi
git_branch="${git_branch:-no branch}"
git_prompt=" %F{blue}[%F{253}${git_branch}${git_status_dirty}%F{blue}]"
# 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
precmd() { # tokens etc
setup_git_prompt source ~/.exports
}
PS1='%F{green}%B%K{green}█▓▒░%F{white}%K{green}%B%n@%m%b%F{green}%K{black}█▓▒░%F{white}%K{black}%B %D{%a %b %d} %D{%I:%M:%S%P} # wezterm
%}%F{green}%K{black}%B%~/%b%k${git_prompt}%f ' source ~/.zsh/wezterm.sh
# aliases # This will set the default prompt to the fade theme
alias grep='grep --colour=auto' if [[ $UID -eq 0 ]]; then
alias ll='ls -alFh' HISTFILE="${HISTFILE%_history}_root_history"
lt () { ls -lt ${1} | head } prompt fade red
EDITOR=vim else
HISTFILE=~/.histfile
prompt pure
fi
ICONS=(😈 💀 🤡 👻 👽 👾 🤖 😺 💋 💥 🦥 🐣 🐧 🐸 🐢 🐍 🐳 🌴 🍉 🍎 🍒 🥝 🥥 🥨 🍕 ☕ 🚨 🚀 🛸 🪐 🌠 🌙 🌞 🌈 ⚡ 🔥 💧 ✨ 🎉 💎 💾 📎 💣 📡 )
export PURE_PROMPT_SYMBOL="$(shuf -n1 -e "${ICONS[@]}")"
__wezterm_set_user_var "ICON" $PURE_PROMPT_SYMBOL

Loading…
Cancel
Save