]> git.rmz.io Git - dotfiles.git/commitdiff
zsh: use XDG_{CONFIG,CACHE}_HOME
authorSamir Benmendil <samir.benmendil@gmail.com>
Wed, 29 Jan 2014 23:19:00 +0000 (00:19 +0100)
committerSamir Benmendil <samir.benmendil@gmail.com>
Wed, 29 Jan 2014 23:57:10 +0000 (00:57 +0100)
Makefile
profile [new file with mode: 0644]
zprofile [new file with mode: 0644]
zsh/.gitignore
zsh/lib/completion.zsh
zshrc

index c9c01e45f08fe129291546e651da4967592a9b64..033358f780932138147e461e689f7dadca5dce5b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,8 @@
 APATH := $(realpath .)
 
 FILES := bin
-DOTFILES := aliases bash* conky* flexget git* goobookrc msmtp* mutt ncmpcpp offlineimap* vim* weechat xbindkeysrc Xresources xprofile zsh*
-CONFIGFILES := compton.conf mimeo.conf mpd retroarch xkb
+DOTFILES := aliases bash* conky* flexget git* goobookrc msmtp* mutt ncmpcpp offlineimap* profile vim* weechat xbindkeysrc Xresources xprofile zprofile zshrc
+CONFIGFILES := compton.conf mimeo.conf mpd retroarch xkb zsh
 
 .PHONY: install $(FILES) $(DOTFILES) $(CONFIGFILES)
 install: $(FILES) $(DOTFILES) $(CONFIGFILES)
diff --git a/profile b/profile
new file mode 100644 (file)
index 0000000..fc234d9
--- /dev/null
+++ b/profile
@@ -0,0 +1,4 @@
+export PATH="$HOME/bin:$PATH"
+export XDG_CONFIG_HOME="$HOME/.config"
+export XDG_DATA_HOME="$HOME/.local/share"
+export XDG_CACHE_HOME="$HOME/.cache"
diff --git a/zprofile b/zprofile
new file mode 100644 (file)
index 0000000..53ca887
--- /dev/null
+++ b/zprofile
@@ -0,0 +1 @@
+emulate sh -c 'source ~/.profile'
index 51a5ee6c396f012ae162d0d63006d4d8e765b92f..536c39dee919f9169cb2d8340b99a5187701c731 100644 (file)
@@ -6,4 +6,3 @@ custom/*
 !custom/example.zsh
 *.swp
 !custom/example.zshcache
-cache/
index d81b6eb2c5e021276c6407b3932a187d694dc5f2..13d98cd3fe5f2e7412af58da6855b68b5e476bc2 100644 (file)
@@ -41,8 +41,9 @@ hosts=(
 zstyle ':completion:*:hosts' hosts $hosts
 
 # Use caching so that commands like apt and dpkg complete are useable
+[[ -d "$XDG_CACHE_HOME/zsh" ]] || mkdir -p "$XDG_CACHE_HOME/zsh"
 zstyle ':completion::complete:*' use-cache 1
-zstyle ':completion::complete:*' cache-path $ZSH/cache/
+zstyle ':completion::complete:*' cache-path $XDG_CACHE_HOME/zsh
 
 # Don't complete uninteresting users
 zstyle ':completion:*:*:*:users' ignored-patterns \
diff --git a/zshrc b/zshrc
index 653f9741d16208ea9faec1b2cc9ee4dc12a2a9fd..7ad8443cfc8191eb977a4336e035d76e74709e6d 100644 (file)
--- a/zshrc
+++ b/zshrc
@@ -1,5 +1,6 @@
-# Path to your oh-my-zsh configuration.
-ZSH=$HOME/.zsh
+# Path to config files
+ZSH=$XDG_CONFIG_HOME/zsh
+[[ ! -d "$ZSH" ]] && echo "Missing config dir: '$ZSH'" && return
 
 # Load all of the config files in $ZSH/lib that end in .zsh
 for config_file ($ZSH/lib/*.zsh); do
@@ -16,7 +17,9 @@ typeset -U fpath    # make fpath a unique array
 [[ -d ~/.zsh/functions ]] && fpath=(~/.zsh/functions $fpath)
 autoload -U ${fpath[1]}/*(:t)   # loads all functions in the first element of fpath
 
-autoload -U compinit; compinit
+# initialise completion
+[[ -d "$XDG_CACHE_HOME/zsh" ]] || mkdir -p "$XDG_CACHE_HOME/zsh"
+autoload -U compinit; compinit -d "$XDG_CACHE_HOME/zsh/zcompdump"
 
 # miscelaneous options
 setopt extendedglob