Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Oh my ViaRézo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ViaRézo
Oh my ViaRézo
Commits
90da31c7
Commit
90da31c7
authored
8 years ago
by
Ayaz Badouraly
Browse files
Options
Downloads
Patches
Plain Diff
Using vcs_info to gather info from vcs
parent
d8a2fb2e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+10
-0
10 additions, 0 deletions
README.md
via.zsh-theme
+24
-16
24 additions, 16 deletions
via.zsh-theme
with
34 additions
and
16 deletions
README.md
+
10
−
0
View file @
90da31c7
...
...
@@ -7,6 +7,16 @@ This is a theme for ZSH which mainly forks the historical theme used on
ZSH frameworks such as
[
Oh-My-ZSH
](
https://github.com/robbyrussell/oh-my-zsh
)
.
Info
----
### VCS caption
| Color | State |
|:-----:|:-----:|
| green | any |
Usage
-----
...
...
This diff is collapsed.
Click to expand it.
via.zsh-theme
+
24
−
16
View file @
90da31c7
...
...
@@ -22,22 +22,30 @@ local current_dir="%{$fg_bold[green]%}%~%{$reset_color%}"
PROMPT
=
'${clock} ${user_host} ${current_dir}${eol} '
# Display git info
ZSH_THEME_GIT_PROMPT_PREFIX
=
"%{
$fg
[magenta]%}(%{
$fg
[white]%}git%{
$fg
[magenta]%})%{
$fg
[yellow]%}-%{
$fg
[magenta]%}[%{
$reset_color
%}"
ZSH_THEME_GIT_PROMPT_SUFFIX
=
"%{
$fg
[magenta]%}]%{
$reset_color
%}"
ZSH_THEME_GIT_PROMPT_DIRTY
=
"%{
$fg
[red]%}"
ZSH_THEME_GIT_PROMPT_CLEAN
=
"%{
$fg
[green]%}"
custom_git_prompt_info
()
{
local
ref
if
[[
"
$(
command
git config
--get
oh-my-zsh.hide-status 2> /dev/null
)
"
!=
"1"
]]
then
ref
=
$(
command
git symbolic-ref HEAD 2> /dev/null
)
||
ref
=
$(
command
git rev-parse
--short
HEAD 2> /dev/null
)
||
return
0
echo
"
$ZSH_THEME_GIT_PROMPT_PREFIX
$(
parse_git_dirty
)
${
ref
#refs/heads/
}
$ZSH_THEME_GIT_PROMPT_SUFFIX
"
fi
}
RPROMPT
=
'$(custom_git_prompt_info)'
# Display vcs info
autoload
-Uz
vcs_info
zstyle
':vcs_info:*'
enable
git
zstyle
':vcs_info:*'
check-for-changes
true
# In normal formats and actionformats the following replacements are done:
# %s : The VCS in use (git, hg, svn, etc.).
# %b : Information about the current branch.
# %a : An identifier that describes the action. Only makes sense in actionformats.
# %i : The current revision number or identifier. For hg the hgrevformat style may be used to customize the output.
# %c : The string from the stagedstr style if there are staged changes in the repository.
# %u : The string from the unstagedstr style if there are unstaged changes in the repository.
# %R : The base directory of the repository.
# %r : The repository name. If %R is /foo/bar/repoXY, %r is repoXY.
# %S : A subdirectory within a repository. If $PWD is /foo/bar/repoXY/beer/tasty, %S is beer/tasty.
# %m : A "misc" replacement. It is at the discretion of the backend to decide what this replacement expands to.
zstyle
':vcs_info:*'
formats
\
"%{
$fg
[magenta]%}(%{
$fg
[white]%}%s%{
$fg
[magenta]%})%{
$fg
[yellow]%}-%{
$fg
[magenta]%}[%{
$fg
[green]%}%b%{
$fg
[magenta]%}]%{
$reset_color
%}"
zstyle
':vcs_info:*'
actionformats
\
"%{
$fg
[magenta]%}(%{
$fg
[white]%}%s%{
$fg
[magenta]%})%{
$fg
[yellow]%}-%{
$fg
[magenta]%}[%{
$fg
[green]%}%b%{
$fg
[yellow]%}:%{
$fg
[red]%}%a%{
$fg
[magenta]%}]%{
$reset_color
%}"
precmd
()
{
vcs_info
}
RPROMPT
=
'${vcs_info_msg_0_}'
# vim: ft=zsh fenc=utf-8
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment