From e146e947c52ac4adbe426b3f893faff1e46ed5f8 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 19 Apr 2016 15:24:25 +0100 Subject: Use GNU stow for dotfiles management --- zsh/.zsh/.gitignore | 2 ++ zsh/.zsh/alias | 32 ++++++++++++++++++++++++++++++++ zsh/.zsh/functions | 16 ++++++++++++++++ zsh/.zsh/plugins | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ zsh/.zshrc | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ zsh/alias | 32 -------------------------------- zsh/functions | 16 ---------------- zsh/plugins | 52 ---------------------------------------------------- zsh/zshrc | 52 ---------------------------------------------------- 9 files changed, 154 insertions(+), 152 deletions(-) create mode 100644 zsh/.zsh/.gitignore create mode 100644 zsh/.zsh/alias create mode 100644 zsh/.zsh/functions create mode 100644 zsh/.zsh/plugins create mode 100644 zsh/.zshrc delete mode 100644 zsh/alias delete mode 100644 zsh/functions delete mode 100644 zsh/plugins delete mode 100644 zsh/zshrc (limited to 'zsh') diff --git a/zsh/.zsh/.gitignore b/zsh/.zsh/.gitignore new file mode 100644 index 0000000..8ca273a --- /dev/null +++ b/zsh/.zsh/.gitignore @@ -0,0 +1,2 @@ +tmp +zgen diff --git a/zsh/.zsh/alias b/zsh/.zsh/alias new file mode 100644 index 0000000..7da7fb5 --- /dev/null +++ b/zsh/.zsh/alias @@ -0,0 +1,32 @@ +#!/bin/zsh + +# Commands +alias c='clear' +alias ca='printf "\ec"' +alias cdd='cd ~/dotfiles' + +# Shortcut to files +alias notes='vim ~/dotfiles/.notes' +alias el='nvim ~/dotfiles/ledger/perso.ledger' + +# Programs +alias a='vifm . .' +alias ff='FreeFem++' +alias g='git' +alias l='ledger' +alias m='cd ~/.mutt/attachments && mutt && cd -' +alias e='nvim' +alias n='nvim' +alias ns='nvim -S Session.vim' +alias v='vim' +alias vs="vim -S Session.vim" + +# Build +alias mc='make clean' +alias mca='make clean-all' + +# Tmux +alias son="tmux set -g status on" +alias soff="tmux set -g status off" + +unalias ag diff --git a/zsh/.zsh/functions b/zsh/.zsh/functions new file mode 100644 index 0000000..7c2b49a --- /dev/null +++ b/zsh/.zsh/functions @@ -0,0 +1,16 @@ +#!/bin/zsh + +function colo { + + # Change colors for current session + $HOME/bin/recolor < ~/.Xresources/$1 + + # Load Xresources file for future sessions + xrdb -I$HOME ~/.Xresources/$1 + + # Change environment variable + export COLORSCHEME=$1 + + # Change default environment variable for future sessions + sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export COLORSCHEME=$1/g" ~/.zsh/tmp +} diff --git a/zsh/.zsh/plugins b/zsh/.zsh/plugins new file mode 100644 index 0000000..1016b88 --- /dev/null +++ b/zsh/.zsh/plugins @@ -0,0 +1,52 @@ +#! /bin/zsh + +# Load zgen +source "$HOME/.zsh/zgen/zgen.zsh" + +# Load plugins +if ! zgen saved; then + + echo "Creating a zgen save" + + # Load oh-my-zsh framework + zgen oh-my-zsh + + # Oh-my-zsh plugins + zgen oh-my-zsh plugins/git + zgen oh-my-zsh plugins/vi-mode + zgen oh-my-zsh plugins/archlinux + zgen oh-my-zsh plugins/ubuntu + zgen oh-my-zsh plugins/tmux + zgen oh-my-zsh plugins/themes + + # zsh-users plugins + zgen load zsh-users/zsh-completions src + zgen load zsh-users/zsh-syntax-highlighting + + # Appearance + zgen oh-my-zsh themes/eastwood + + # Navigation plugins + zgen load uvaes/fzf-marks + + # Other plugins + zgen load rupa/z + zgen load supercrabtree/k + zgen load djui/alias-tips + zgen load tarruda/zsh-autosuggestions + zgen load joel-porquet/zsh-dircolors-solarized + + # Save all to init script + zgen save +fi + +# Plugins configuration + +# Autosuggestion +{ + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' + bindkey '^y' autosuggest-accept +} + +# Z +export _Z_EXCLUDE_DIRS=("$HOME/sshfs", "$HOME/nfs") diff --git a/zsh/.zshrc b/zsh/.zshrc new file mode 100644 index 0000000..fe44e9e --- /dev/null +++ b/zsh/.zshrc @@ -0,0 +1,52 @@ +# Write tmp file if it doesn't exist +[[ ! -f ~/.zsh/tmp ]] && echo "export COLORSCHEME=dark" > ~/.zsh/tmp + +# Source configuration files +source "$HOME/.zsh/plugins" +source "$HOME/.zsh/functions" +source "$HOME/.zsh/alias" +source "$HOME/.zsh/tmp" + +# Custom key bindings for built-in widgets +bindkey -a 'k' history-beginning-search-backward +bindkey -a 'j' history-beginning-search-forward +bindkey '^P' history-beginning-search-backward +bindkey '^N' history-beginning-search-forward + +# Paths of executables +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin/core_perl:$HOME/bin" + +# Editor +export EDITOR=/usr/bin/nvim + +# Fix tmux colors +if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then + case $(tmux showenv TERM 2>/dev/null) in + *256color) ;& + TERM=fbterm) + TERM=screen-256color ;; + *) + TERM=screen + esac +fi + +# Export GPG-agent related +if [[ -f "${HOME}/.gpg-agent-info" ]]; then + source ${HOME}/.gpg-agent-info + export GPG_AGENT_INFO + export SSH_AUTH_SOCK +fi + + +# Tmux colors fix +if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then + case $(tmux showenv TERM 2>/dev/null) in + *256color) ;& + TERM=fbterm) + TERM=screen-256color ;; + *) + TERM=screen + esac +fi + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh diff --git a/zsh/alias b/zsh/alias deleted file mode 100644 index 7da7fb5..0000000 --- a/zsh/alias +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/zsh - -# Commands -alias c='clear' -alias ca='printf "\ec"' -alias cdd='cd ~/dotfiles' - -# Shortcut to files -alias notes='vim ~/dotfiles/.notes' -alias el='nvim ~/dotfiles/ledger/perso.ledger' - -# Programs -alias a='vifm . .' -alias ff='FreeFem++' -alias g='git' -alias l='ledger' -alias m='cd ~/.mutt/attachments && mutt && cd -' -alias e='nvim' -alias n='nvim' -alias ns='nvim -S Session.vim' -alias v='vim' -alias vs="vim -S Session.vim" - -# Build -alias mc='make clean' -alias mca='make clean-all' - -# Tmux -alias son="tmux set -g status on" -alias soff="tmux set -g status off" - -unalias ag diff --git a/zsh/functions b/zsh/functions deleted file mode 100644 index 7c2b49a..0000000 --- a/zsh/functions +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/zsh - -function colo { - - # Change colors for current session - $HOME/bin/recolor < ~/.Xresources/$1 - - # Load Xresources file for future sessions - xrdb -I$HOME ~/.Xresources/$1 - - # Change environment variable - export COLORSCHEME=$1 - - # Change default environment variable for future sessions - sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export COLORSCHEME=$1/g" ~/.zsh/tmp -} diff --git a/zsh/plugins b/zsh/plugins deleted file mode 100644 index 43b2916..0000000 --- a/zsh/plugins +++ /dev/null @@ -1,52 +0,0 @@ -#! /bin/zsh - -# Load zgen -source "$HOME/.zgen/zgen.zsh" - -# Load plugins -if ! zgen saved; then - - echo "Creating a zgen save" - - # Load oh-my-zsh framework - zgen oh-my-zsh - - # Oh-my-zsh plugins - zgen oh-my-zsh plugins/git - zgen oh-my-zsh plugins/vi-mode - zgen oh-my-zsh plugins/archlinux - zgen oh-my-zsh plugins/ubuntu - zgen oh-my-zsh plugins/tmux - zgen oh-my-zsh plugins/themes - - # zsh-users plugins - zgen load zsh-users/zsh-completions src - zgen load zsh-users/zsh-syntax-highlighting - - # Appearance - zgen oh-my-zsh themes/eastwood - - # Navigation plugins - zgen load uvaes/fzf-marks - - # Other plugins - zgen load rupa/z - zgen load supercrabtree/k - zgen load djui/alias-tips - zgen load tarruda/zsh-autosuggestions - zgen load joel-porquet/zsh-dircolors-solarized - - # Save all to init script - zgen save -fi - -# Plugins configuration - -# Autosuggestion -{ - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=6' - bindkey '^y' autosuggest-accept -} - -# Z -export _Z_EXCLUDE_DIRS=("$HOME/sshfs", "$HOME/nfs") diff --git a/zsh/zshrc b/zsh/zshrc deleted file mode 100644 index fe44e9e..0000000 --- a/zsh/zshrc +++ /dev/null @@ -1,52 +0,0 @@ -# Write tmp file if it doesn't exist -[[ ! -f ~/.zsh/tmp ]] && echo "export COLORSCHEME=dark" > ~/.zsh/tmp - -# Source configuration files -source "$HOME/.zsh/plugins" -source "$HOME/.zsh/functions" -source "$HOME/.zsh/alias" -source "$HOME/.zsh/tmp" - -# Custom key bindings for built-in widgets -bindkey -a 'k' history-beginning-search-backward -bindkey -a 'j' history-beginning-search-forward -bindkey '^P' history-beginning-search-backward -bindkey '^N' history-beginning-search-forward - -# Paths of executables -export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/bin/core_perl:$HOME/bin" - -# Editor -export EDITOR=/usr/bin/nvim - -# Fix tmux colors -if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then - case $(tmux showenv TERM 2>/dev/null) in - *256color) ;& - TERM=fbterm) - TERM=screen-256color ;; - *) - TERM=screen - esac -fi - -# Export GPG-agent related -if [[ -f "${HOME}/.gpg-agent-info" ]]; then - source ${HOME}/.gpg-agent-info - export GPG_AGENT_INFO - export SSH_AUTH_SOCK -fi - - -# Tmux colors fix -if [[ -n ${TMUX} && -n ${commands[tmux]} ]];then - case $(tmux showenv TERM 2>/dev/null) in - *256color) ;& - TERM=fbterm) - TERM=screen-256color ;; - *) - TERM=screen - esac -fi - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh -- cgit v1.2.3