diff --git a/.gitmodules b/.gitmodules index ae8340b..7430100 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "autojump"] path = autojump url = git://github.com/joelthelion/autojump.git +[submodule "dircolors-solarized"] + path = dircolors-solarized + url = git://github.com/seebi/dircolors-solarized.git diff --git a/README b/README index 22386cb..f35b380 100644 --- a/README +++ b/README @@ -3,21 +3,18 @@ Due to many requests I share my zsh configuration compilation. Copy the repository to ~/.zsh and run 'make install' once -(or link the ~/.zsh/zshrc manually to ~/.zshrc) +(or link the ~/.config/zsh/zshrc manually to ~/.zshrc) ### File description -~/.zsh/README - This file -~/.zsh/Makefile - make-config to run with 'make install' -~/.zsh/aliases - alias definitions which can be edited/modified with 'aedit' -~/.zsh/completion - tab completion configuration -~/.zsh/functions - functions and key bindings to that functions -~/.zsh/options - shell options as history size, general keyindings, etc -~/.zsh/prompt - the prompt definition -~/.zsh/zshrc - the main RC file (will be linked to ~/.zshrc) +$ZSH_CONFIG/README - This file +$ZSH_CONFIG/Makefile - make-config to run with 'make install' +$ZSH_CONFIG/aliases - alias definitions which can be edited/modified with 'aedit' +$ZSH_CONFIG/completion - tab completion configuration +$ZSH_CONFIG/functions - functions and key bindings to that functions +$ZSH_CONFIG/options - shell options as history size, general keyindings, etc +$ZSH_CONFIG/prompt - the prompt definition +$ZSH_CONFIG/zshrc - the main RC file (will be linked to ~/.zshrc) ### These files are not in the repository but will be created -~/.zsh/history - the history file (shared for all zsh instances) -~/.zsh/private - private commands/aliases etc. (included at the end) - this should also include definitions for - EDITOR, PAGER, cdpath, fpath etc. +$ZSH_CACHE/history - the history file (shared for all zsh instances) diff --git a/aliases.zsh b/aliases.zsh index 05b5c73..6d4f397 100644 --- a/aliases.zsh +++ b/aliases.zsh @@ -22,9 +22,9 @@ alias j=' j' # default ls is untouched, except coloring alias ls=' ls --color=auto' alias myls=' ls -C -F -h --color=always' -alias l=" myls" +alias l=" myls -l" alias ll=' myls -l' -alias la=' myls -A' +alias la=' myls -lA' alias v=" clear; ll -gh" # standard directory view alias vs=" v **/*(.)" # show all files in all subdirs plain in a list diff --git a/completion.zsh b/completion.zsh index 2502be8..baa0681 100644 --- a/completion.zsh +++ b/completion.zsh @@ -6,7 +6,7 @@ # add an autoload function path, if directory exists # http://www.zsh.org/mla/users/2002/msg00232.html -functionsd="$HOME/.zsh/functions.d" +functionsd="$ZSH_CONFIG/functions.d" if [[ -d "$functionsd" ]] { fpath=( $functionsd $fpath ) autoload -U $functionsd/*(:t) @@ -63,7 +63,7 @@ zstyle ':completion:*' matcher-list 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' # caching of completion stuff zstyle ':completion:*' use-cache on -zstyle ':completion:*' cache-path "${HOME}/.zsh/${HOST}-cache" +zstyle ':completion:*' cache-path "$ZSH_CACHE" # ~dirs: reorder output sorting: named dirs over userdirs diff --git a/darwin.zsh b/darwin.zsh index ce01dd1..8d7a79a 100644 --- a/darwin.zsh +++ b/darwin.zsh @@ -18,9 +18,10 @@ export LSCOLORS="gxfxcxdxbxegedabagacad" export FPATH=/usr/local/share/zsh-completions:$FPATH # activate gls colors -if [[ -a $HOME/.dir_colors ]]; then +export ZSH_DIRCOLORS="$ZSH_CONFIG/dircolors-solarized/dircolors.256dark" +if [[ -a $ZSH_DIRCOLORS ]]; then if [[ "$TERM" == *256* ]]; then - which gdircolors > /dev/null && eval "`gdircolors -b $HOME/.dir_colors`" + which gdircolors > /dev/null && eval "`gdircolors -b $ZSH_DIRCOLORS`" else # standard colors for non-256-color terms which gdircolors > /dev/null && eval "`gdircolors -b`" diff --git a/dircolors-solarized b/dircolors-solarized new file mode 160000 index 0000000..82342cd --- /dev/null +++ b/dircolors-solarized @@ -0,0 +1 @@ +Subproject commit 82342cd0ceb221d562e5107a7f53094aac098ea1 diff --git a/linux.zsh b/linux.zsh index a854d3e..9484965 100644 --- a/linux.zsh +++ b/linux.zsh @@ -1,8 +1,9 @@ # activate ls colors, (private if possible) -if [[ -a $HOME/.dir_colors ]]; then +export ZSH_DIRCOLORS="$ZSH_CONFIG/dircolors-solarized/dircolors.256dark" +if [[ -a $ZSH_DIRCOLORS ]]; then if [[ "$TERM" == *256* ]]; then - which dircolors > /dev/null && eval "`dircolors -b $HOME/.dir_colors`" + which dircolors > /dev/null && eval "`dircolors -b $ZSH_DIRCOLORS`" else # standard colors for non-256-color terms which dircolors > /dev/null && eval "`dircolors -b`" diff --git a/options.zsh b/options.zsh index 37e45fd..b7efa5e 100644 --- a/options.zsh +++ b/options.zsh @@ -25,9 +25,9 @@ bindkey '^[[B' down-line-or-search # History Settings (big history for use with many open shells and no dups) # Different History files for root and standard user if (( ! EUID )); then - HISTFILE=~/.zsh/history_root + HISTFILE=$ZSH_CACHE/history_root else - HISTFILE=~/.zsh/history + HISTFILE=$ZSH_CACHE/history fi SAVEHIST=10000 HISTSIZE=12000 diff --git a/zshrc b/zshrc index 11c755e..6fdfa0c 100644 --- a/zshrc +++ b/zshrc @@ -4,37 +4,38 @@ # the main RC file (will be linked to ~/.zshrc) # +export XDG_CONFIG_HOME="$HOME/.config" +export XDG_CACHE_HOME="$HOME/.cache" +export ZSH_CONFIG="$XDG_CONFIG_HOME/zsh" +export ZSH_CACHE="$XDG_CACHE_HOME/zsh" +mkdir -p $ZSH_CACHE + typeset -ga sources -#sources+="$HOME/.zsh/colors.zsh" # maybe we do not need this anymore -sources+="$HOME/.zsh/options.zsh" -sources+="$HOME/.zsh/prompt.zsh" -sources+="$HOME/.zsh/functions.zsh" -sources+="$HOME/.zsh/aliases.zsh" +sources+="$ZSH_CONFIG/options.zsh" +sources+="$ZSH_CONFIG/prompt.zsh" +sources+="$ZSH_CONFIG/functions.zsh" +sources+="$ZSH_CONFIG/aliases.zsh" # highlights the live command line # Cloned From: git://github.com/nicoulaj/zsh-syntax-highlighting.git -sources+="$HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" +sources+="$ZSH_CONFIG/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" # provides the package name of a non existing executable # (sudo apt-get install command-not-found) sources+="/etc/zsh_command_not_found" -# Bash and Zsh completion support for git-flow -# https://github.com/bobthecow/git-flow-completion -sources+="$HOME/.zsh/git-flow-completion/git-flow-completion.zsh" - # Autojump: a cd command that learns # Cloned From: git://github.com/joelthelion/autojump.git -sources+="$HOME/.zsh/autojump/autojump.zsh" +sources+="$ZSH_CONFIG/autojump/autojump.zsh" # Check for a system specific file systemFile=`uname -s | tr "[:upper:]" "[:lower:]"` -sources+="$HOME/.zsh/$systemFile.zsh" +sources+="$ZSH_CONFIG/$systemFile.zsh" # Finally include the private.zsh file -sources+="$HOME/.zsh/private.zsh" +sources+="$ZSH_CONFIG/private.zsh" -sources+="$HOME/.zsh/completion.zsh" +sources+="$ZSH_CONFIG/completion.zsh" # try to include all sources foreach file (`echo $sources`)