dotfiles

My dotfiles for Arch Linux
git clone git://git.janispagel.de/dotfiles.git
Log | Files | Refs | README

commit 10f5865930a9f8202ca9cff391215e59020782e1
parent cb5ec8ea9b5dc66452b241e8585bd2777c5dbea4
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Wed,  7 Oct 2020 21:53:11 +0200

Move zsh config files

Diffstat:
Azsh/.config/zsh/dot-zprofile | 6++++++
Rzsh/dot-zsh_aliases -> zsh/.config/zsh/dot-zsh_aliases | 0
Rzsh/dot-zsh_functions -> zsh/.config/zsh/dot-zsh_functions | 0
Azsh/.config/zsh/dot-zshrc | 213+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dzsh/dot-zprofile | 35-----------------------------------
Azsh/dot-zshenv | 32++++++++++++++++++++++++++++++++
Dzsh/dot-zshrc | 213-------------------------------------------------------------------------------
7 files changed, 251 insertions(+), 248 deletions(-)

diff --git a/zsh/.config/zsh/dot-zprofile b/zsh/.config/zsh/dot-zprofile @@ -0,0 +1,6 @@ +################## +#### Basics ###### +################## + +# Source ~/.zshrc +source $ZDOTDIR/.zshrc diff --git a/zsh/dot-zsh_aliases b/zsh/.config/zsh/dot-zsh_aliases diff --git a/zsh/dot-zsh_functions b/zsh/.config/zsh/dot-zsh_functions diff --git a/zsh/.config/zsh/dot-zshrc b/zsh/.config/zsh/dot-zshrc @@ -0,0 +1,213 @@ +################# +### Functions ### +################# + +# Source functions +if [ -f $ZDOTDIR/.zsh_functions ]; then + source $ZDOTDIR/.zsh_functions +fi + +######################## +#### Key bindings ###### +######################## + +bindkey '^[[P' delete-char # Delete +bindkey '^[[5~' up-line-or-history # PageUp +bindkey '^[[6~' down-line-or-history # PageDown + +######################## +#### Autocomplete ###### +######################## + +# Perform some sanity checks on completion option +autoload -Uz compinit +compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION + +bindkey '^i' expand-or-complete-prefix # Complete inside of string +zstyle ':completion:*' completer _complete _match _approximate # Enable fuzzy matching +zstyle ':completion:*:match:*' original only +zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' # Tolerance of approximate increases by amount of characters typed so far +zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes # Avoid getting the same file offered again with certain programs +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*:descriptions' format "- %d -" +zstyle ':completion:*:corrections' format "- %d - (errors %e})" +zstyle ':completion:*:default' list-prompt '%S%M matches%s' +zstyle ':completion:*' group-name '' +zstyle ':completion:*:manuals' separate-sections true +zstyle ':completion:*:manuals.(^1*)' insert-sections true +zstyle ':completion:*:ssh:*' hosts off # Do not use /etc/hosts in ssh autocompletion +zstyle ':completion:*:scp:*' hosts off # Do not use /etc/hosts in scp autocompletion +zstyle ':completion:*' menu select +zstyle ':completion:*' verbose yes +zstyle ':completion:*' rehash true +# Speed up completion by setting cache +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache + +####################### +### Options ########### +####################### + +setopt CORRECT # Make suggestions for correcting spelling mistakes +setopt EXTENDED_GLOB # Inlude ~ in globbing +setopt CASE_GLOB # Case sensitive globbing +setopt GLOB_COMPLETE # Use pattern matching for wildcards and ~ +setopt NUMERIC_GLOB_SORT # Sort numerically if numbers are present in globbing +setopt RC_EXPAND_PARAM # Expand globbing arrays to full names +setopt NO_BEEP # Disable system beeps +setopt MARK_DIRS # Always append trailing / to dirs +setopt APPEND_HISTORY # Append to history file instead of overwriting +setopt HIST_IGNORE_ALL_DUPS # Ignore all history dups +setopt AUTO_CD # No need to type 'cd' if standard input is a valid path +setopt PROMPT_SUBST # Enable command substitution in prompt + +########################## +######## Basics ########## +########################## + +# Set history options +HISTFILE="$XDG_DATA_HOME"/zsh/history +HISTSIZE=1000000 +SAVEHIST=1000000 + +# Source aliases +if [ -f $ZDOTDIR/.zsh_aliases ]; then + source $ZDOTDIR/.zsh_aliases +fi + +# Use fish-like history substring search +if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then + source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh + # bind UP and DOWN arrow keys to history substring search + zmodload zsh/terminfo + bindkey "$terminfo[kcuu1]" history-substring-search-up + bindkey "$terminfo[kcud1]" history-substring-search-down + bindkey '^[[A' history-substring-search-up + bindkey '^[[B' history-substring-search-down +fi +# Use fish-like autosuggestion +if [ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then + source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=2' +fi +# Use fish-like syntax highlighting +#if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then +# source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +#fi +# fzf file history +if [ -f /usr/share/fzf/key-bindings.zsh ]; then + source /usr/share/fzf/key-bindings.zsh +fi + +###################### +####### Prompt ####### +###################### + +# set left prompt +PROMPT='%(!.#.$>) %E' + +###### +# This whole git prompt stuff was taken from Manjaro's zsh setup, slightly modified +###### + +# Modify the colors and symbols in these variables as desired. +GIT_PROMPT_SYMBOL="" # clean repo +GIT_PROMPT_PREFIX="[" +GIT_PROMPT_SUFFIX="]" +GIT_PROMPT_AHEAD="ANUM" # A"NUM" - ahead by "NUM" commits +GIT_PROMPT_BEHIND="BNUM" # B"NUM" - behind by "NUM" commits +GIT_PROMPT_MERGING="%F{1}!%f" # merge conflict +GIT_PROMPT_UNTRACKED="%F{1}++%f" # untracked files +GIT_PROMPT_MODIFIED="%F{3}+%f" # tracked files modified +GIT_PROMPT_STAGED="%F{2}->%f" # staged changes present = ready for "git push" + +# Right prompt with exit status of previous command if not successful +# Also show background process, git information and current dir +RPROMPT='$(bg_process) $(git_prompt_string) %(?..[%?]) [%1~/]' + +################# +##### Misc ###### +################# + +# TMUX +if [[ -z $TMUXAUTOATTACH ]]; then # Prevent from running if variable is set + if [[ -z "$TMUX" ]] && [[ -n "$DISPLAY" ]]; then # Test if tmux is running + ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session + if [[ -z "$ID" ]]; then # if not available create a new one + tmux new-session + else + tmux attach-session -t "$ID" # if available attach to it + fi + fi +fi +if [ -n "$TMUX" ]; then # If tmux is running + # create a global per-pane variable that holds the pane's PWD + export PS1=$PS1'$( [ -n $TMUX ] && tmux setenv -g TMUX_PWD_$(tmux display -p "#D" | tr -d %) $PWD)' +fi + +# Color man pages +export LESS_TERMCAP_mb=$'\E[01;32m' +export LESS_TERMCAP_md=$'\E[01;32m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;47;34m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;36m' +export LESS=-r + +# Load DIRCOLORS +test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors) + +# Add support for GnuPG +export GPG_TTY=$(tty) + +# Disable graphical interface for SSH password +unset SSH_ASKPASS + +# Customize tty +if [ "$TERM" = "linux" ]; then + printf '\033]P03b4252'; # black + printf '\033]P1bf616a'; # red + printf '\033]P2a3be8c'; # green + printf '\033]P3ebcb8b'; # yellow + printf '\033]P481a1c1'; # blue + printf '\033]P5b48ead'; # magenta + printf '\033]P688c0d0'; # cyan + printf '\033]P7e5e9f0'; # white + printf '\033]P84c566a'; # bright black + printf '\033]P9bf616a'; # bright red + printf '\033]PAa3be8c'; # bright green + printf '\033]PBebcb8b'; # bright yellow + printf '\033]PC81a1c1'; # bright blue + printf '\033]PDb48ead'; # bright magenta + printf '\033]PE8fbcbb'; # bright cyan + printf '\003]PFeceff4'; # bright white + clear; + if [ -f "/usr/share/kbd/consolefonts/ter-v24n.psf.gz" ]; then + setfont ter-v24n + fi +fi + +# added by travis gem +[ -f /home/janis/.travis/travis.sh ] && source /home/janis/.travis/travis.sh + +# >>> conda initialize >>> +# !! Contents within this block are managed by 'conda init' !! +__conda_setup="$('/home/janis/build/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" +if [ $? -eq 0 ]; then + eval "$__conda_setup" +else + if [ -f "/home/janis/build/anaconda3/etc/profile.d/conda.sh" ]; then + . "/home/janis/build/anaconda3/etc/profile.d/conda.sh" + else + export PATH="/home/janis/build/anaconda3/bin:$PATH" + fi +fi +unset __conda_setup +# <<< conda initialize <<< + +# Start X in tty2 +if [[ "$(tty)" = "/dev/tty2" ]]; then + pgrep dwm || startx +fi diff --git a/zsh/dot-zprofile b/zsh/dot-zprofile @@ -1,35 +0,0 @@ -################## -#### Basics ###### -################## - -# Source ~/.zshrc -source ~/.zshrc - -# Set path -typeset -U path -# Add ~/bin to path -# Add ruby scripts to path -path=(~/bin ~/.local/bin $(ruby -e 'print Gem.user_dir')/bin $(go env GOPATH)/bin $path[@]) - -################ -## Variables ### -################ - -# default config path -export XDG_CONFIG_HOME=~/.config - -# set default programs -export EDITOR="vim" -export VISUAL="vim" -export PAGER="less" -export TERMINAL="st" -export BROWSER="firefox-nightly" -export EMAILCLIENT="mutt" -export MUSICPLAYER="ncmpcpp" -export TOP="top" -export READER="zathura" -export RSSREADER="newsboat" - -# Program-specific variables -export WEECHAT_HOME=$XDG_CONFIG_HOME/weechat # weechat -export IMAPFILTER_HOME=$XDG_CONFIG_HOME/imapfilter # imapfilter diff --git a/zsh/dot-zshenv b/zsh/dot-zshenv @@ -0,0 +1,32 @@ +# Set path +typeset -U path +# Add ~/bin to path +# Add ruby scripts to path +# Add golang to path +path=(~/bin ~/.local/bin $(ruby -e 'print Gem.user_dir')/bin $(go env GOPATH)/bin $path[@]) + +################ +## Variables ### +################ + +# default config path +export XDG_CONFIG_HOME=$HOME/.config +export XDG_CACHE_HOME=$HOME/.cache +export XDG_DATA_HOME=$HOME/.local/share + +# set default programs +export EDITOR="vim" +export VISUAL="vim" +export PAGER="less" +export TERMINAL="st" +export BROWSER="firefox-nightly" +export EMAILCLIENT="mutt" +export MUSICPLAYER="ncmpcpp" +export TOP="top" +export READER="zathura" +export RSSREADER="newsboat" + +# Program-specific variables +export ZDOTDIR=$XDG_CONFIG_HOME/zsh +export WEECHAT_HOME=$XDG_CONFIG_HOME/weechat # weechat +export IMAPFILTER_HOME=$XDG_CONFIG_HOME/imapfilter # imapfilter diff --git a/zsh/dot-zshrc b/zsh/dot-zshrc @@ -1,213 +0,0 @@ -################# -### Functions ### -################# - -# Source functions -if [ -f ~/.zsh_functions ]; then - source ~/.zsh_functions -fi - -######################## -#### Key bindings ###### -######################## - -bindkey '^[[P' delete-char # Delete -bindkey '^[[5~' up-line-or-history # PageUp -bindkey '^[[6~' down-line-or-history # PageDown - -######################## -#### Autocomplete ###### -######################## - -# Perform some sanity checks on completion option -autoload -Uz compinit -compinit - -bindkey '^i' expand-or-complete-prefix # Complete inside of string -zstyle ':completion:*' completer _complete _match _approximate # Enable fuzzy matching -zstyle ':completion:*:match:*' original only -zstyle -e ':completion:*:approximate:*' max-errors 'reply=( $(( ($#PREFIX+$#SUFFIX)/3 )) numeric )' # Tolerance of approximate increases by amount of characters typed so far -zstyle ':completion:*:(rm|kill|diff):*' ignore-line yes # Avoid getting the same file offered again with certain programs -zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" -zstyle ':completion:*:descriptions' format "- %d -" -zstyle ':completion:*:corrections' format "- %d - (errors %e})" -zstyle ':completion:*:default' list-prompt '%S%M matches%s' -zstyle ':completion:*' group-name '' -zstyle ':completion:*:manuals' separate-sections true -zstyle ':completion:*:manuals.(^1*)' insert-sections true -zstyle ':completion:*:ssh:*' hosts off # Do not use /etc/hosts in ssh autocompletion -zstyle ':completion:*:scp:*' hosts off # Do not use /etc/hosts in scp autocompletion -zstyle ':completion:*' menu select -zstyle ':completion:*' verbose yes -zstyle ':completion:*' rehash true -# Speed up completion by setting cache -zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path ~/.zsh/cache - -####################### -### Options ########### -####################### - -setopt CORRECT # Make suggestions for correcting spelling mistakes -setopt EXTENDED_GLOB # Inlude ~ in globbing -setopt CASE_GLOB # Case sensitive globbing -setopt GLOB_COMPLETE # Use pattern matching for wildcards and ~ -setopt NUMERIC_GLOB_SORT # Sort numerically if numbers are present in globbing -setopt RC_EXPAND_PARAM # Expand globbing arrays to full names -setopt NO_BEEP # Disable system beeps -setopt MARK_DIRS # Always append trailing / to dirs -setopt APPEND_HISTORY # Append to history file instead of overwriting -setopt HIST_IGNORE_ALL_DUPS # Ignore all history dups -setopt AUTO_CD # No need to type 'cd' if standard input is a valid path -setopt PROMPT_SUBST # Enable command substitution in prompt - -########################## -######## Basics ########## -########################## - -# Set history options -HISTFILE=~/.zhistory -HISTSIZE=1000000 -SAVEHIST=1000000 - -# Source aliases -if [ -f ~/.zsh_aliases ]; then - source ~/.zsh_aliases -fi - -# Use fish-like history substring search -if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then - source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh - # bind UP and DOWN arrow keys to history substring search - zmodload zsh/terminfo - bindkey "$terminfo[kcuu1]" history-substring-search-up - bindkey "$terminfo[kcud1]" history-substring-search-down - bindkey '^[[A' history-substring-search-up - bindkey '^[[B' history-substring-search-down -fi -# Use fish-like autosuggestion -if [ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then - source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh - ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=2' -fi -# Use fish-like syntax highlighting -#if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then -# source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -#fi -# fzf file history -if [ -f /usr/share/fzf/key-bindings.zsh ]; then - source /usr/share/fzf/key-bindings.zsh -fi - -###################### -####### Prompt ####### -###################### - -# set left prompt -PROMPT='%(!.#.$>) %E' - -###### -# This whole git prompt stuff was taken from Manjaro's zsh setup, slightly modified -###### - -# Modify the colors and symbols in these variables as desired. -GIT_PROMPT_SYMBOL="" # clean repo -GIT_PROMPT_PREFIX="[" -GIT_PROMPT_SUFFIX="]" -GIT_PROMPT_AHEAD="ANUM" # A"NUM" - ahead by "NUM" commits -GIT_PROMPT_BEHIND="BNUM" # B"NUM" - behind by "NUM" commits -GIT_PROMPT_MERGING="%F{1}!%f" # merge conflict -GIT_PROMPT_UNTRACKED="%F{1}++%f" # untracked files -GIT_PROMPT_MODIFIED="%F{3}+%f" # tracked files modified -GIT_PROMPT_STAGED="%F{2}->%f" # staged changes present = ready for "git push" - -# Right prompt with exit status of previous command if not successful -# Also show background process, git information and current dir -RPROMPT='$(bg_process) $(git_prompt_string) %(?..[%?]) [%1~/]' - -################# -##### Misc ###### -################# - -# TMUX -if [[ -z $TMUXAUTOATTACH ]]; then # Prevent from running if variable is set - if [[ -z "$TMUX" ]] && [[ -n "$DISPLAY" ]]; then # Test if tmux is running - ID="$( tmux ls | grep -vm1 attached | cut -d: -f1 )" # get the id of a deattached session - if [[ -z "$ID" ]]; then # if not available create a new one - tmux new-session - else - tmux attach-session -t "$ID" # if available attach to it - fi - fi -fi -if [ -n "$TMUX" ]; then # If tmux is running - # create a global per-pane variable that holds the pane's PWD - export PS1=$PS1'$( [ -n $TMUX ] && tmux setenv -g TMUX_PWD_$(tmux display -p "#D" | tr -d %) $PWD)' -fi - -# Color man pages -export LESS_TERMCAP_mb=$'\E[01;32m' -export LESS_TERMCAP_md=$'\E[01;32m' -export LESS_TERMCAP_me=$'\E[0m' -export LESS_TERMCAP_se=$'\E[0m' -export LESS_TERMCAP_so=$'\E[01;47;34m' -export LESS_TERMCAP_ue=$'\E[0m' -export LESS_TERMCAP_us=$'\E[01;36m' -export LESS=-r - -# Load DIRCOLORS -test -r "~/.dir_colors" && eval $(dircolors ~/.dir_colors) - -# Add support for GnuPG -export GPG_TTY=$(tty) - -# Disable graphical interface for SSH password -unset SSH_ASKPASS - -# Customize tty -if [ "$TERM" = "linux" ]; then - printf '\033]P03b4252'; # black - printf '\033]P1bf616a'; # red - printf '\033]P2a3be8c'; # green - printf '\033]P3ebcb8b'; # yellow - printf '\033]P481a1c1'; # blue - printf '\033]P5b48ead'; # magenta - printf '\033]P688c0d0'; # cyan - printf '\033]P7e5e9f0'; # white - printf '\033]P84c566a'; # bright black - printf '\033]P9bf616a'; # bright red - printf '\033]PAa3be8c'; # bright green - printf '\033]PBebcb8b'; # bright yellow - printf '\033]PC81a1c1'; # bright blue - printf '\033]PDb48ead'; # bright magenta - printf '\033]PE8fbcbb'; # bright cyan - printf '\003]PFeceff4'; # bright white - clear; - if [ -f "/usr/share/kbd/consolefonts/ter-v24n.psf.gz" ]; then - setfont ter-v24n - fi -fi - -# added by travis gem -[ -f /home/janis/.travis/travis.sh ] && source /home/janis/.travis/travis.sh - -# >>> conda initialize >>> -# !! Contents within this block are managed by 'conda init' !! -__conda_setup="$('/home/janis/build/anaconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)" -if [ $? -eq 0 ]; then - eval "$__conda_setup" -else - if [ -f "/home/janis/build/anaconda3/etc/profile.d/conda.sh" ]; then - . "/home/janis/build/anaconda3/etc/profile.d/conda.sh" - else - export PATH="/home/janis/build/anaconda3/bin:$PATH" - fi -fi -unset __conda_setup -# <<< conda initialize <<< - -# Start X in tty2 -if [[ "$(tty)" = "/dev/tty2" ]]; then - pgrep dwm || startx -fi