From d7464173633bf4cc9d09326895218e9fc8511717 Mon Sep 17 00:00:00 2001 From: Harri Lahtinen Date: Sat, 15 Jun 2019 17:45:10 +0300 Subject: [PATCH] zsh-stuff --- .zsh_aliases => .zaliases | 3 ++ .zshenv | 21 +++++++++ .zshrc | 99 +++++---------------------------------- 3 files changed, 36 insertions(+), 87 deletions(-) rename .zsh_aliases => .zaliases (96%) create mode 100644 .zshenv diff --git a/.zsh_aliases b/.zaliases similarity index 96% rename from .zsh_aliases rename to .zaliases index 3f85de5..da68c10 100644 --- a/.zsh_aliases +++ b/.zaliases @@ -16,6 +16,9 @@ alias aws1='ssh ubuntu@ec2-18-196-102-236.eu-central-1.compute.amazonaws.com' alias gcp='gcloud compute ssh instance-1' alias blist='borg list ssh://borg@docker1.home.hartzan.com:2222/backup/arch' +#Check the weather: +weath() { curl wttr.in/Hameenlinna ;} + fzf_find_edit() { local file=$( fzf --no-multi --preview 'bat --color=always --line-range :500 {}' diff --git a/.zshenv b/.zshenv new file mode 100644 index 0000000..4310c31 --- /dev/null +++ b/.zshenv @@ -0,0 +1,21 @@ +#ZSH-env +ZDOTDIR=$HOME +# display +export DEFAULT_USER="hate" +export VDPAU_DRIVER="va_gl" +export LIBVA_DRIVER_NAME="iHD" + +# Common apps +export ZSH=/home/hate/.oh-my-zsh +export EDITOR=nvim +export BROWSER=/usr/bin/google-chrome-stable +export GNUPGHOME="~/.gnupg" +export SSH_KEY_PATH="~/.ssh/id_rsa" + +#fzf +export FZF_CTRL_R_OPTS='--sort --exact' +export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'" +export FZF_DEFAULT_COMMAND='fd --type f --hidden' + +# Compilation flags +export ARCHFLAGS="-arch x86_64" diff --git a/.zshrc b/.zshrc index eba6890..2adb854 100644 --- a/.zshrc +++ b/.zshrc @@ -7,20 +7,19 @@ # ██████ ██████ ░██ ░██░ # ░░░░░░ ░░░░░░ ░░░ ░░░ -export DEFAULT_USER="hate" -export VDPAU_DRIVER="va_gl" -export LIBVA_DRIVER_NAME="iHD" -# If you come from bash you might have to change your $PATH. -# export PATH=$HOME/bin:/usr/local/bin:$PATH -# Path to your oh-my-zsh installation. -export ZSH=/home/hate/.oh-my-zsh +#------------------------------ +# Source config files +#------------------------------ +for file in ${ZDOTDIR}/{.zaliases,.zshenv}; do + . $file || { print "$file: cannot source file" && setopt warncreateglobal } +done + +# Host specific config +for file in ${ZDOTDIR}/hosts/${HOST}/{.zshenv,.zshrc,.zaliases}; do + [[ -r $file ]] && . $file +done -# Set name of the theme to load. Optionally, if you set this to "random" -# it'll load a random theme each time that oh-my-zsh is loaded. -# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes -#ZSH_THEME="agnoster" ZSH_THEME="spaceship" -#ZSH_THEME="powerlevel9k/powerlevel9k" # Auto completion autoload -Uz compinit @@ -51,27 +50,7 @@ setopt auto_list # automatically list choices on ambiguous completion setopt auto_menu # automatically use menu completion setopt always_to_end # move cursor to end if word had one match -# Uncomment the following line to enable command auto-correction. -#ENABLE_CORRECTION="true" - -# Uncomment the following line to display red dots whilst waiting for completion. -# COMPLETION_WAITING_DOTS="true" - -# Uncomment the following line if you want to disable marking untracked files -# under VCS as dirty. This makes repository status check for large repositories -# much, much faster. -# DISABLE_UNTRACKED_FILES_DIRTY="true" - -# Uncomment the following line if you want to change the command execution time -# stamp shown in the history command output. -# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" -# HIST_STAMPS="mm/dd/yyyy" - - -# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*) -# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/ -# Example format: plugins=(rails git textmate ruby lighthouse) -# Add wisely, as too many plugins slow down shell startup. +#oh-my-zsh plugins plugins=( git zsh-autosuggestions @@ -84,66 +63,15 @@ plugins=( source $ZSH/oh-my-zsh.sh -# User configuration -source ~/.zsh_aliases # My scripts PATH=/usr/local/bin:/home/hate/.local/bin:/home/hate/.config/Scripts:/home/hate/.gem/ruby/2.5.0/bin:$PATH -# zsh.functions -#FPATH="$HOME/.zfunc:$FPATH" - -# Load functions on terminal startup -#source ~/.zfunc/functions.zsh - -# GNUPG -GNUPGHOME=/home/hate/.gnupg - -# export MANPATH="/usr/local/man:$MANPATH" -# You may need to manually set your language environment -# export LANG=en_US.UTF-8 - -# Preferred editor -export EDITOR=nvim - -# Preferred browser -export BROWSER=/usr/bin/google-chrome-stable - -#fzf -export FZF_CTRL_R_OPTS='--sort --exact' -export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -200'" -export FZF_DEFAULT_COMMAND='fd --type f --hidden' - -# Compilation flags -export ARCHFLAGS="-arch x86_64" - -# Import colorscheme from 'wal' asynchronously -# & # Run the process in the background. -# ( ) # Hide shell job control messages. -#(cat ~/.cache/wal/sequences &) - # Wpg restore on terminals (cat ~/.config/wpg/sequences &) -# To add support for TTYs this line can be optionally added. -#source ~/.cache/wal/colors-tty.sh - -#gnupg -export GNUPGHOME="~/.gnupg" - -#ssh -export SSH_KEY_PATH="~/.ssh/id_rsa" - -#Check the weather: -weath() { curl wttr.in/Hameenlinna ;} - #FASD eval "$(fasd --init auto)" -# Set personal aliases, overriding those provided by oh-my-zsh libs, -# plugins, and themes. Aliases can be placed here, though oh-my-zsh -# users are encouraged to define aliases within the ZSH_CUSTOM folder. -# For a full list of active aliases, run `alias`. - [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh # The next line updates PATH for the Google Cloud SDK. @@ -151,6 +79,3 @@ if [ -f '/home/hate/google-cloud-sdk/path.zsh.inc' ]; then source '/home/hate/go # The next line enables shell command completion for gcloud. if [ -f '/home/hate/google-cloud-sdk/completion.zsh.inc' ]; then source '/home/hate/google-cloud-sdk/completion.zsh.inc'; fi -# Spaceship -# BATTERY -SPACESHIP_BATTERY_SHOW="true"