Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
vcs_info : git, hg, svn, fossil, etc.
- X-seq: zsh-users 17283
- From: Gautier DI FOLCO <gautier.difolco@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: vcs_info : git, hg, svn, fossil, etc.
- Date: Thu, 20 Sep 2012 22:45:32 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=i7e2v2EVWiMgcrCfC23THYGdhwi7PfEcWtxB/cqkpyw=; b=r+mzXEsJijRTSEXdA4ZKZqelY95pwi77PUsApCqiODVqBJRwWdvxQ45QivDuoBjrW2 1GXWuB3HuP/kWIEbif+PtzVrS+Sea3W1s+geFVQpuC47Fiw/FXLRUSmAv6SliSzosz5d WYNipP5UeMfQtaXT4ojQ64nH1/SX9Xn4L2x2QOn6tkRJVfLfzkl7+FaJ/1I6mxc/SNQj sW3ySb0+YvLJn7fm8UAIm4Rt7nciVuc0RJCbvPKmunUdjDca6zLqeX3qR3DRhhsAcKyy SI93XaHUdxsQWNfLSVR8vxdhbeF/UWL8K7b6L/xEsl4NeF9+oc4bBdDAZ1Oy9z1Olwf0 29Tw==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
Hi all,
I'm new to zsh and to this ML, so I have few questions.
To begin I'm running zsh 4.3.17 (i386-redhat-linux-gnu) on a fedora 17-i686,
I use oh-my-zsh, but I'm a bit limited by the lack of support from other VCS
that git, I also use svn, hg, fossil, so I search and I find vcs_info! I
fall in love
of zsh again. So I edit my them to have the following thing :
#!/usr/bin/env zsh
# Set required options.
setopt promptsubst
# Load required modules.
autoload -U add-zsh-hook
autoload -Uz vcs_info
# Add hook for calling vcs_info before each command.
add-zsh-hook precmd vcs_info
# Set vcs_info parameters.
zstyle ':vcs_info:*' enable hg bzr git svn fossil
zstyle ':vcs_info:*:*' check-for-changes true # Can be slow on big repos.
zstyle ':vcs_info:*:*' unstagedstr '!'
zstyle ':vcs_info:*:*' stagedstr '%B%{$fg[green]%} ✚%{$reset_color%}'
zstyle ':vcs_info:*:*' actionformats "%S" "%r/%s/%b %u%c (%a)"
zstyle ':vcs_info:*:*' formats "%c" "[|%i]
%B%{$fg[blue]%}%s:%{$fg[red]%}%b%{$reset_color%}"
zstyle ':vcs_info:*:*' nvcsformats "" ""
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b'
PROMPT='%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[red]%}➜
%{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="git:%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
RPROMPT='${vcs_info_msg_0_}
${vcs_info_msg_1_}${return_status}$(git_prompt_status)
$(git_time_since_commit)%{$reset_color%}'
It doesn't work :
- Git is well supported (because it is part of omz)
- Branches aren't supported for svn (only the root directory is printed)
- Hg last commit doesn't appear
- Fossil is not supported at all
My goal is to have a rprompt with (in order) a maximum of informations about
the repository (add, remove, modified, etc. files), the date of the last
commit,
the last commit id, the vcs name and the branch.
Have the same information for svn, hg, git or fossil.
Is it possible to do it simply? where I'm wrong in my code?
For your help,
In advance,
Thanks.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author