export TERMCMD=urxvtc export BROWSER=/usr/bin/firefox export LANG=en_US.UTF-8 export SUDO_EDITOR=nano export VISUAL=nano export EDITOR=nano export MANPAGER="sh -c 'col -bx | bat -l man -p'" export PAGER="most" export PATH="/home/josh/.cargo/bin:$PATH" export PATH="/home/josh/.local/bin:$PATH" export FZF_DEFAULT_OPS="--extended" export FZF_DEFAULT_COMMAND="fd --type f" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" source /usr/share/z/z.sh source /home/josh/.zsh_aliases # For tmux in linux export EVENT_NOEPOLL=1 #================================================================================ # DO NOT EDIT AFTER THIS LINE # The following lines were added by compinstall zstyle ':completion:*' auto-description 'Introduce %d' zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix zstyle ':completion:*' completions 1 zstyle ':completion:*' condition 0 zstyle ':completion:*' expand prefix zstyle ':completion:*' file-sort name zstyle ':completion:*' format 'Completing %d' zstyle ':completion:*' glob 1 zstyle ':completion:*' group-name '' zstyle ':completion:*' insert-unambiguous true zstyle ':completion:*' list-colors '' zstyle ':completion:*' list-prompt '%SHit TAB for more results...%s' zstyle ':completion:*' list-suffixes true zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=* r:|=*' zstyle ':completion:*' max-errors 2 zstyle ':completion:*' menu select=0 zstyle ':completion:*' original true zstyle ':completion:*' preserve-prefix '//[^/]##/' zstyle ':completion:*' prompt 'Found %e errors...' zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s' zstyle ':completion:*' substitute 1 zstyle ':completion:*' verbose true zstyle :compinstall filename '/home/josh/.zshrc' autoload -Uz compinit compinit # End of lines added by compinstall # Lines configured by zsh-newuser-install HISTFILE=~/.histfile HISTSIZE=10000 SAVEHIST=10000 setopt appendhistory autocd extendedglob nomatch unsetopt beep bindkey -v # End of lines configured by zsh-newuser-install # DO NOT EDIT BEFORE THIS LINE #================================================================================ # Own configuration: setopt nohashdirs setopt completealiases setopt INC_APPEND_HISTORY setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_DUPS setopt HIST_IGNORE_SPACE setopt HIST_EXPIRE_DUPS_FIRST setopt HIST_REDUCE_BLANKS setopt HIST_VERIFY function ranger-cd { tempfile='/tmp/chosendir' /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}" test -f "$tempfile" && if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then cd -- "$(cat "$tempfile")" fi rm -f -- "$tempfile" } typeset -A key key[Home]=${terminfo[khome]} key[End]=${terminfo[kend]} key[Insert]=${terminfo[kich1]} key[Delete]=${terminfo[kdch1]} key[Up]=${terminfo[kcuu1]} key[Down]=${terminfo[kcud1]} key[Left]=${terminfo[kcub1]} key[Right]=${terminfo[kcuf1]} key[PageUp]=${terminfo[kpp]} key[PageDown]=${terminfo[knp]} # setup key accordingly [[ -n "${key[Home]}" ]] && bindkey "${key[Home]}" beginning-of-line [[ -n "${key[End]}" ]] && bindkey "${key[End]}" end-of-line [[ -n "${key[Insert]}" ]] && bindkey "${key[Insert]}" overwrite-mode [[ -n "${key[Delete]}" ]] && bindkey "${key[Delete]}" delete-char [[ -n "${key[Left]}" ]] && bindkey "${key[Left]}" backward-char [[ -n "${key[Right]}" ]] && bindkey "${key[Right]}" forward-char [[ -n "${key[PageUp]}" ]] && bindkey "${key[PageUp]}" beginning-of-buffer-or-history [[ -n "${key[PageDown]}" ]] && bindkey "${key[PageDown]}" end-of-buffer-or-history [[ -n "${key[Up]}" ]] && bindkey "${key[Up]}" history-beginning-search-backward [[ -n "${key[Down]}" ]] && bindkey "${key[Down]}" history-beginning-search-forward # Finally, make sure the terminal is in application mode, when zle is # active. Only then are the values from $terminfo valid. if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then function zle-line-init () { echoti smkx } function zle-line-finish () { echoti rmkx } zle -N zle-line-init zle -N zle-line-finish fi setopt prompt_subst autoload -U colors && colors function calculate_width { temp=" ${USER} _ ${HOST} _ _" dir_actual=$PWD if [[ "$dir_actual[0,${#HOME}]" == "$HOME" ]] then dir_actual="~$dir_actual[$((${#HOME}+1)),-1]" fi let remaining=${COLUMNS}-${#temp} dir_length=${#dir_actual} if [[ "$dir_length" -gt "$remaining" ]] then dir_actual="...${dir_actual:$(($dir_length-$remaining+3))}" fi } function ranger_level { if [ -z "$RANGER_LEVEL" ] then string_level="" else string_level=" ranger │" fi } reload () { exec "${SHELL}" "$@" } case $TERM in termite|*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term) separator1= separator2= separator3= precmd () { print -Pn "\e]0;%n@%M: %1~ \a" calculate_width tmux_sessions print "" } preexec () { print -Pn "\e]0;%n@%M %1~ ($1)\a" } ;; screen|screen-256color) separator1= separator2= separator3= precmd () { print -Pn "\e]83;title \"$1\"\a" print -Pn "\e]0;TMUX - %n@%M %1~\a" calculate_width tmux_sessions print "" } preexec () { print -Pn "\e]83;title \"$1\"\a" print -Pn "\e]0;TMUX - %n@%M %# %1~ ($1)\a" } ;; *) separator1=▒ separator2=│ separator3=▒ precmd () { print "" calculate_width tmux_sessions print "" } ;; esac over_ssh() { if [ -n "${SSH_CLIENT}" ]; then return 0 else return 1 fi } if over_ssh; then prompt_is_ssh="%{%K{green}%B%F{white}%} SSH %{%b%K{cyan}%F{green}%}" else prompt_is_ssh="%{%b%K{cyan}%F{green}%}" fi if [ -n "${RANGER_LEVEL}" ] then ranger_level="%{%K{cyan}%B%F{white}%} ranger %{%b%K{magenta}%F{cyan}%}" else ranger_level="%{%K{magenta}%F{cyan}%}" fi tmux_sessions(){ if $(tmux info &> /dev/null) then tmux_number="%{%K{magenta}%B%F{white}%} tmux: $(tmux ls | wc -l) %{%b%K{cyan}%F{magenta}%}" else tmux_number="%{%b%K{cyan}%F{magenta}%}" fi } PROMPT='%{%B%K{blue}%15F%} %n %{%b%K{green}%F{blue}%}$separator1%{%B%15F%} %m %{%b%K{cyan}%F{green}%}$separator1%{%B%15F%} $dir_actual %{%b%k%F{cyan}%}$separator1 $prompt_is_ssh$separator1 $ranger_level$separator1 $tmux_number$separator1 %{%K{cyan}%B%F{white}%}%(0?,,%{%b%K{cyan}%15F%}$separator2%{%B%F{white}%}%?)%{%b%k%F{cyan}%}$separator1%{%b%k$reset_color%} ' RPROMPT='%{%F{cyan}%}$separator3%{%B%K{cyan}%F{white}%} %@ %{%b%F{cyan}%}$separator1%{$reset_color%}' autoload -U edit-command-line zle -N edit-command-line bindkey -M vicmd 'v' edit-command-line setopt interactivecomments [[ -s /home/josh/.autojump/etc/profile.d/autojump.sh ]] && source /home/josh/.autojump/etc/profile.d/autojump.sh autoload -U compinit && compinit -u [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh