X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshrc;h=258ee0ea99880740d911918be255113dc7eb9a05;hb=6cb30e41c45e28f3f55ab554f05301b7bb3eb205;hp=2a70da55b1a13f96144225f9a139c2985a20ed34;hpb=e2ee5436065b022bdc4b060fa1bbf1d33437a8e7;p=grml-etc-core.git diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 2a70da5..258ee0e 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -102,6 +102,40 @@ NOPRECMD=${NOPRECMD:-0} BATTERY=${BATTERY:-0} GRMLSMALL_SPECIFIC=${GRMLSMALL_SPECIFIC:-1} GRML_ALWAYS_LOAD_ALL=${GRML_ALWAYS_LOAD_ALL:-0} +GRML_WARN_SKEL=${GRML_WARN_SKEL:-1} + +if (( GRML_WARN_SKEL != 0 )) ; then + printf ' +Dear user, + +You updated grml'\''s zshrc which brings a major change. +The configuration is kept only in one file, being the global zshrc. +In the past, the configuration was split in two files, with the +second file being the .zshrc file from /etc/skel. + +If you have a .zshrc file in your home directory that originally +came from the skel directory, please remove it. This is also the case +if you followed earlier instructions from the grml-zsh-refcard or +from on non-grml systems. + +Please see the current grml-zsh-refcard for updated installation +information. In short, you don'\''t want a .zshrc.global file. Install +the global zshrc to ~/.zshrc and be done. + +If you need changes to the configuration, use ~/.zshrc.pre and +~/.zshrc.local. + +To remove this warning execute '\''grml_do_not_warn_skel'\''. + +' | more + +function grml_do_not_warn_skel() { + printf '# Do not warn about old skel dot-files anymore\n' >>! ~/.zshrc.pre + printf 'GRML_WARN_SKEL=0\n' >>! ~/.zshrc.pre +} + +fi + # }}} # {{{ check for version/system @@ -152,6 +186,11 @@ else isgrmlsmall() { return 1 } fi +isdarwin(){ + [[ $OSTYPE == darwin* ]] && return 0 + return 1 +} + #f1# are we running within an utf environment? isutfenv() { case "$LANG $CHARSET $LANGUAGE" in @@ -427,6 +466,18 @@ export SHELL='/bin/zsh' # color setup for ls: check_com -c dircolors && eval $(dircolors -b) +# color setup for ls on OS X: +isdarwin && export CLICOLOR=1 + +# do MacPorts setup on darwin +if isdarwin && [[ -d /opt/local ]]; then + # Note: PATH gets set in /etc/zprofile on Darwin, so this can't go into + # zshenv. + PATH="/opt/local/bin:/opt/local/sbin:$PATH" + MANPATH="/opt/local/share/man:$MANPATH" +fi +# do Fink setup on darwin +isdarwin && xsource /sw/bin/init.sh # set width of man pages to 80 for more convenient reading # export MANWIDTH=${MANWIDTH:-80} @@ -1213,6 +1264,11 @@ zstyle ':vcs_info:*' max-exports 1 # disable - Provide a list of systems, you don't want # the vcs_info() to check for repositories # (checked in the 'init' context, too). +# disable-patterns - A list of patterns that are checked against $PWD. +# If the pattern matches, vcs_info will be disabled. +# Say, ~/.zsh is a directory under version control, +# in which you do not want vcs_info to be active, do: +# zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+(|/*)" # use-simple - If there are two different ways of gathering # information, you can select the simpler one # by setting this style to true; the default @@ -1233,6 +1289,7 @@ zstyle ':vcs_info:*' max-exports 1 # max-exports 2 # enable true # disable (empty list) +# disable-patterns (empty list) # use-simple false # use-prompt-escapes true # @@ -1797,8 +1854,9 @@ vcs_info_lastmsg () { # {{{ } # }}} vcs_info () { # {{{ + local pat local -i found - local -a VCSs disabled + local -a VCSs disabled dps local -x vcs usercontext local -ax msgs local -Ax vcs_comm @@ -1831,6 +1889,15 @@ vcs_info () { # {{{ return 0 } zstyle -a ":vcs_info:${vcs}:${usercontext}" "disable" disabled + + zstyle -a ":vcs_info:${vcs}:${usercontext}:${rrn}" "disable-patterns" dps + for pat in ${dps} ; do + if [[ ${PWD} == ${~pat} ]] ; then + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + return 0 + fi + done + VCS_INFO_maxexports (( found = 0 ))