aboutsummaryrefslogtreecommitdiffstats
path: root/zsh/.config
diff options
context:
space:
mode:
authorPeter Son Struschka <me@peter-struschka.com>2020-05-30 11:24:37 +0800
committerPeter Son Struschka <me@peter-struschka.com>2020-05-30 11:24:37 +0800
commit0902ce59971bf8c75c7e6544d4956e4164c66990 (patch)
treefb492ec49600109a5b7ed887a72fb18ea74273ee /zsh/.config
parent32d7a981ba338c2ad5d3e32164cfacb65cf201e0 (diff)
downloaddotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.tar.gz
dotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.tar.bz2
dotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.tar.lz
dotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.tar.xz
dotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.tar.zst
dotfiles-0902ce59971bf8c75c7e6544d4956e4164c66990.zip
zsh: Set XDG base dirs and move ZSH config to ZDOTDIR
Diffstat (limited to 'zsh/.config')
-rwxr-xr-xzsh/.config/zsh/.zprofile66
-rw-r--r--zsh/.config/zsh/.zshrc115
2 files changed, 181 insertions, 0 deletions
diff --git a/zsh/.config/zsh/.zprofile b/zsh/.config/zsh/.zprofile
new file mode 100755
index 0000000..6a40089
--- /dev/null
+++ b/zsh/.config/zsh/.zprofile
@@ -0,0 +1,66 @@
+source /etc/zsh/zprofile
+#if type "cowfortune" > /dev/null; then
+# cowfortune
+#fi
+
+#. /etc/profile.d/vte.sh
+
+#export TERM=xterm-256color
+
+#export EDITOR="emacsclient -c"
+export EDITOR="nvim"
+
+export DEFAULT_USER=peter
+
+export QT_QPA_PLATFORMTHEME=qt5ct
+export QT_AUTO_SCREEN_SCALE_FACTOR=0
+export QT_SCALE_FACTOR=0
+
+export MTP_NO_PROBE="1"
+
+export XDG_CONFIG_HOME="$HOME/.config"
+
+[ -d "$HOME/.local/bin" ] && \
+ export PATH="$HOME/.local/bin:$PATH"
+[ -d "$HOME/.bin" ] && \
+ export PATH="$HOME/.bin:$PATH"
+[ -d "$HOME/bin" ] && \
+ export PATH="$HOME/bin:$PATH"
+
+# Android SDK
+if [ -d "$HOME/.local/share/android-sdk" ]; then
+ export ANDROID_HOME="$HOME/.local/share/android-sdk"
+ export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools/bin:$PATH"
+fi
+
+# Go
+if type "go" > /dev/null; then
+ export PATH="$HOME/go/bin:$PATH"
+ export GOPATH=$(go env GOPATH)
+fi
+
+# Rust
+if type "rustc" > /dev/null; then
+ export PATH="$HOME/.cargo/bin:$PATH"
+ export RUST_SRC_PATH="$(rustc --print sysroot)/lib/rustlib/src/rust/src"
+fi
+
+# Node
+if type "npm" > /dev/null; then
+ export PATH="$HOME/.node_modules/bin:$PATH"
+ export npm_config_prefix=~/.node_modules
+fi
+
+# Ruby
+if type "ruby" > /dev/null; then
+ export PATH="$PATH:$(ruby -e 'puts Gem.user_dir')/bin"
+fi
+
+# fzf
+if type "fzf" > /dev/null && type "rg" > /dev/null; then
+ export FZF_DEFAULT_COMMAND="rg --hidden --follow --ignore-vcs --files --iglob '!.git'"
+fi
+
+# Aliases
+alias open=xdg-open
+
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
new file mode 100644
index 0000000..fb9a6d0
--- /dev/null
+++ b/zsh/.config/zsh/.zshrc
@@ -0,0 +1,115 @@
+# 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
+
+# zplug
+source ~/.zplug/init.zsh
+
+# oh my zsh stuff
+
+zplug "plugins/archlinux", from:oh-my-zsh
+zplug "plugins/command-not-found", from:oh-my-zsh
+zplug "plugins/docker", from:oh-my-zsh
+zplug "plugins/git", from:oh-my-zsh
+zplug "plugins/git-extras", from:oh-my-zsh
+zplug "plugins/pip", from:oh-my-zsh
+zplug "plugins/rsync", from:oh-my-zsh
+zplug "plugins/sublime", from:oh-my-zsh
+zplug "plugins/systemd", from:oh-my-zsh
+zplug "plugins/taskwarrior", from:oh-my-zsh
+zplug "plugins/thefuck", from:oh-my-zsh
+zplug "plugins/tmux", from:oh-my-zsh
+zplug "plugins/virtualenvwrapper", from:oh-my-zsh
+zplug "plugins/zsh-navigation-tools", from:oh-my-zsh
+zplug "plugins/colored-man-pages", from:oh-my-zsh
+
+zplug "zsh-users/zsh-syntax-highlighting"
+zplug "zsh-users/zsh-autosuggestions"
+zplug "zsh-users/zsh-completions"
+zplug "zsh-users/zsh-history-substring-search"
+
+# THEME
+POWERLEVEL9K_PROMPT_ON_NEWLINE=true
+POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=""
+# POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="↳ "
+POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
+POWERLEVEL9K_MODE='awesome-fontconfig'
+POWERLEVEL9K_SHORTEN_DIR_LENGTH=3
+
+POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context virtualenv dir dir_writable vcs)
+POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status command_execution_time root_indicator background_jobs history time)
+
+# zplug theme https://gist.github.com/pstruschka/c05686e6cf10e12471a3104e42e6366b.git agnoster_custom
+
+#[ "$TERM" = "linux" ] || zplug romkatv/powerlevel10k, use:powerlevel10k.zsh-theme
+case "$TERM" in
+ "linux") ;;
+ "dumb") export PS1="> ";;
+ *) zplug romkatv/powerlevel10k, use:powerlevel10k.zsh-theme
+esac
+
+if ! zplug check; then
+ printf "Install? [y/N]: "
+ if read -q; then
+ echo; zplug install
+ fi
+fi
+
+zplug load
+
+fpath+=$XDG_DATA_DIR/zsh/functions
+
+autoload -Uz compinit
+compinit -d $XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION
+
+[ -n $ZSH ] && [ -e $ZSH/oh-my-zsh.sh ] && \
+ source $ZSH/oh-my-zsh.sh
+
+if [ "$TERM" = "linux" ]; then
+ _SEDCMD='s/.*\*color\([0-9]\{1,\}\).*#\([0-9a-fA-F]\{6\}\).*/\1 \2/p'
+ for i in $(sed -n "$_SEDCMD" $HOME/.Xresources | awk '$1 < 16 {printf "\\e]P%X%s", $1, $2}'); do
+ echo -en "$i"
+ done
+ clear
+fi
+
+if type "kitty" > /dev/null; then
+ # Completion for kitty
+ kitty + complete setup zsh | source /dev/stdin
+
+ alias kdiff="kitty +kitten diff"
+ alias kicat="kitty +kitten icat"
+ alias kunicode="kitty +kitten unicode_input"
+ alias kpanel="kitty +kitten panel"
+ alias khints="kitty +kitten hints"
+ alias kclip="kitty +kitten clipboard"
+fi
+
+
+if type "exa" > /dev/null; then
+ alias ls=exa
+fi
+
+if type "thefuck" > /dev/null; then
+ eval $(thefuck --alias)
+fi
+
+if type "fasd" > /dev/null; then
+ eval "$(fasd --init auto)"
+fi
+
+# python virtualenvwrapper
+export WORKON_HOME=~/.virtualenvs
+[[ -e /usr/bin/virtualenvwrapper_lazy.sh ]] && \
+ source /usr/bin/virtualenvwrapper_lazy.sh
+
+alias ec="emacsclient -c"
+
+[[ -e /usr/share/doc/pkgfile/command-not-found.zsh ]] && \
+ source /usr/share/doc/pkgfile/command-not-found.zsh
+
+# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
+#[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh