From c449e13accd6301056804709f360d976be9a1ee1 Mon Sep 17 00:00:00 2001 From: Guillaume Dott Date: Mon, 8 Apr 2019 18:26:37 +0200 Subject: [PATCH] zsh: convert config to xdg --- zsh/{zprofile => .zlogin} | 3 --- zsh/.zshenv | 26 ++++++++++++++++++++++++++ zsh/{zshrc => .zshrc} | 21 +-------------------- 3 files changed, 27 insertions(+), 23 deletions(-) rename zsh/{zprofile => .zlogin} (51%) create mode 100644 zsh/.zshenv rename zsh/{zshrc => .zshrc} (92%) diff --git a/zsh/zprofile b/zsh/.zlogin similarity index 51% rename from zsh/zprofile rename to zsh/.zlogin index 9d65868..0eb744b 100755 --- a/zsh/zprofile +++ b/zsh/.zlogin @@ -1,8 +1,5 @@ emulate sh -c 'source /etc/profile' -export PATH="${PATH}:${HOME}/.bin" -export GTK2_RC_FILES="$HOME/.gtkrc-2.0" - if [ `tty` = /dev/tty1 ]; then startx fi diff --git a/zsh/.zshenv b/zsh/.zshenv new file mode 100644 index 0000000..76a46d5 --- /dev/null +++ b/zsh/.zshenv @@ -0,0 +1,26 @@ +export XDG_CONFIG_HOME=${HOME}/.config +export XDG_CACHE_HOME=${HOME}/.cache +export XDG_DATA_HOME=${HOME}/.local/share + +export PATH="${PATH}:${HOME}/.bin" +export PATH="${PATH}:${HOME}/.gem/ruby/2.5.0/bin" + +export GTK2_RC_FILES="$HOME/.gtkrc-2.0" + +export HISTFILE="$XDG_DATA_HOME/zsh/history" +if [ ! -d $(dirname $HISTFILE) ]; then mkdir -p $(dirname $HISTFILE); fi + +export HISTSIZE=5000 +export SAVEHIST=5000 + +export ZCOMPDUMP=$XDG_CACHE_HOME/zsh/zcompdump-$ZSH_VERSION +if [ ! -d $(dirname $ZCOMPDUMP) ]; then mkdir -p $(dirname $ZCOMPDUMP); fi + +# display time for commands taking longer than this value +export REPORTTIME=10 +export KEYTIMEOUT=1 + +export EDITOR=vim +export PAGER=less + +export ZDOTDIR=${XDG_CONFIG_HOME}/zsh diff --git a/zsh/zshrc b/zsh/.zshrc similarity index 92% rename from zsh/zshrc rename to zsh/.zshrc index d0df3e8..bc57b18 100755 --- a/zsh/zshrc +++ b/zsh/.zshrc @@ -12,13 +12,11 @@ zle -N edit-command-line # https://github.com/zsh-users/zsh-completions [ -d "$HOME/.zsh/zsh-completions/src" ] && fpath=($HOME/.zsh/zsh-completions/src $fpath) -autoload -Uz compinit && compinit +autoload -Uz compinit && compinit -d $ZCOMPDUMP autoload -U bashcompinit bashcompinit -zstyle :compinstall filename '/home/gdott9/.zshrc' - # Display a message when no match #zstyle ':completion:*:warnings' format 'No matches for: %d' @@ -82,8 +80,6 @@ setopt autopushd bindkey -v bindkey -M vicmd v edit-command-line -export KEYTIMEOUT=1 - # Affiche le mode (normal ou insert) dans le prompt de droite function zle-line-init zle-keymap-select { @@ -94,19 +90,6 @@ function zle-line-init zle-keymap-select zle -N zle-line-init zle -N zle-keymap-select -#-------------# -# Useful vars # -#-------------# -export HISTFILE=~/.histfile -export HISTSIZE=5000 -export SAVEHIST=5000 - -# display time for commands taking longer than this value -export REPORTTIME=10 - -export EDITOR=vim -export PAGER=less - if [ $(whoami) = "root" ] then if [ $USER = "root" ] @@ -123,8 +106,6 @@ fi export PS1='%m%{$fg[$COLOR]%}:%{$reset_color%}%~${vcs_info_msg_0_}%{$fg[$COLOR]%}%#%{$reset_color%} ' export PS2="%_> " -export PATH="${PATH}:${HOME}/.gem/ruby/2.5.0/bin" - export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking export LESS_TERMCAP_md=$'\E[01;31m' # begin bold export LESS_TERMCAP_me=$'\E[0m' # end mode