diff options
author | Urbain Vaes <urbain@vaes.uk> | 2017-12-13 12:26:48 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2017-12-13 12:26:48 +0100 |
commit | 926c3860ad0ce0464eaad00804556b204b1b7d71 (patch) | |
tree | 3d2ebac2b094656a1a41923bd20298a9cb575c99 | |
parent | 52bccdd45a0e24fa8d38679da3b3d78654761bf6 (diff) |
Split zsh configuration in several file
This allows the environment defined in .zshenv to be available when
running commands with 'ssh user@host command'
-rw-r--r-- | zsh/.zsh/.gitignore | 1 | ||||
-rw-r--r-- | zsh/.zsh/.zprofile | 8 | ||||
-rw-r--r-- | zsh/.zsh/.zshrc | 29 | ||||
-rw-r--r-- | zsh/.zshenv | 10 | ||||
-rw-r--r-- | zsh/.zshrc | 50 |
5 files changed, 48 insertions, 50 deletions
diff --git a/zsh/.zsh/.gitignore b/zsh/.zsh/.gitignore new file mode 100644 index 0000000..4d45295 --- /dev/null +++ b/zsh/.zsh/.gitignore @@ -0,0 +1 @@ +.zcompdump* diff --git a/zsh/.zsh/.zprofile b/zsh/.zsh/.zprofile new file mode 100644 index 0000000..13942bb --- /dev/null +++ b/zsh/.zsh/.zprofile @@ -0,0 +1,8 @@ +export EDITOR=vim +export HISTSIZE=1000000 + +# We need to reset $PATH because /etc/profile is read after ~/.zshenv +export PATH="$HOME/bin:$HOME/.guix-profile/bin:$HOME/bin:/usr/lib/surfraw${PATH:+:}$PATH" + +# Start X automatically +[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx diff --git a/zsh/.zsh/.zshrc b/zsh/.zsh/.zshrc new file mode 100644 index 0000000..a5fdea8 --- /dev/null +++ b/zsh/.zsh/.zshrc @@ -0,0 +1,29 @@ +# source /home/urbain/.nix-profile/etc/profile.d/nix.sh + +# Source configuration files +source "$HOME/.zsh/plugins" +source "$HOME/.zsh/functions" +source "$HOME/.zsh/alias" + +# 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 + +PROMPT='%0~ $ ' + +[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh + +# Options +unsetopt histverify + +# Use fzf with z +unalias z 2> /dev/null +z() { + [ $# -gt 0 ] && _z "$*" && return + cd "$(_z -l 2>&1 | fzf --height 40% --reverse --inline-info +s --tac --query "$*" | sed 's/^[0-9,.]* *//')" + zle && zle reset-prompt +} +zle -N z +bindkey '^z' z diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..140e8fd --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,10 @@ +export ZDOTDIR=$HOME/.zsh + +# Guix stuff +export PATH="$HOME/bin:$HOME/.guix-profile/bin:$HOME/.guix-profile/sbin:$HOME/bin:/usr/lib/surfraw${PATH:+:}$PATH" +export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale +export GUIX_PACKAGE_PATH=$HOME/Dropbox/projects/guix-packages +export GUILE_LOAD_PATH=$HOME/.guix-profile/share/guile/site/2.2:$GUILE_LOAD_PATH +export GUILE_LOAD_COMPILED_PATH=$HOME/.guix-profile/lib/guile/2.2/site-ccache:$GUILE_LOAD_COMPILED_PATH +export CPATH="/home/urbain/.guix-profile/include${CPATH:+:}$CPATH" +export LIBRARY_PATH="/home/urbain/.guix-profile/lib${LIBRARY_PATH:+:}$LIBRARY_PATH" diff --git a/zsh/.zshrc b/zsh/.zshrc deleted file mode 100644 index 4f63ef2..0000000 --- a/zsh/.zshrc +++ /dev/null @@ -1,50 +0,0 @@ -export PATH="${PATH}:$HOME/bin:/usr/lib/surfraw" -export EDITOR=vim -export HISTSIZE=1000000 - - -# source /home/urbain/.nix-profile/etc/profile.d/nix.sh - -# Guix stuff -export PATH="/home/urbain/.guix-profile/bin${PATH:+:}$PATH" -export GUIX_LOCPATH=$HOME/.guix-profile/lib/locale -export GUIX_PACKAGE_PATH=$HOME/Dropbox/projects/guix-packages -export GUILE_LOAD_PATH=$HOME/.guix-profile/share/guile/site/2.2:$GUILE_LOAD_PATH -export GUILE_LOAD_COMPILED_PATH=$HOME/.guix-profile/lib/guile/2.2/site-ccache:$GUILE_LOAD_COMPILED_PATH -export CPATH="/home/urbain/.guix-profile/include${CPATH:+:}$CPATH" -export LIBRARY_PATH="/home/urbain/.guix-profile/lib${LIBRARY_PATH:+:}$LIBRARY_PATH" - -# Source configuration files -source "$HOME/.zsh/plugins" -source "$HOME/.zsh/functions" -source "$HOME/.zsh/alias" - -# 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 - -# 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 - -PROMPT='%0~ $ ' - -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh - -# Options -unsetopt histverify - -# Use fzf with z -unalias z 2> /dev/null -z() { - [ $# -gt 0 ] && _z "$*" && return - cd "$(_z -l 2>&1 | fzf --height 40% --reverse --inline-info +s --tac --query "$*" | sed 's/^[0-9,.]* *//')" - zle && zle reset-prompt -} -zle -N z -bindkey '^z' z |