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
86c67eed
Commit
86c67eed
authored
8 years ago
by
Ayaz Badouraly
Browse files
Options
Downloads
Patches
Plain Diff
Using zsh built-in support for changing the color
parent
b20a23a3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
via.zsh-theme
+23
-23
23 additions, 23 deletions
via.zsh-theme
with
23 additions
and
23 deletions
via.zsh-theme
+
23
−
23
View file @
86c67eed
...
...
@@ -2,23 +2,23 @@
# Fork from the historical VIA Centrale Réseaux ZSH Theme
local
time_format
=
${
OHMYVIA_TIME_FORMAT
:-
"%D{%H:%M}"
}
local
clock
=
"%
{
$fg_bold
[
cyan
]%
}
$time_format
%
{
$reset_color
%}
"
local
clock
=
"%
B%F{
cyan}
$time_format
%
f%b
"
# Check the UID
if
[[
$UID
-ne
0
]]
;
then
# normal user
local
user
=
"%
{
$fg_bold
[
red
]%
}%n%
{
$reset_color
%}
"
local
eol
=
"%
{
%(?.
$fg_bold
[yellow].
$fg_bold
[red])%}%%%{
$reset_color
%}
"
local
user
=
"%
B%F{
red}%n%
f%b
"
local
eol
=
"%
B
%(?.
%F{yellow}.%F{red})%%%f%b
"
else
# root
local
user
=
"%
{
$fg_bold
[
blue
]%
}%n%
{
$reset_color
%}
"
local
eol
=
"%
{
%(?.
$fg_bold
[yellow].
$fg_bold
[red])%}#%{
$reset_color
%}
"
local
user
=
"%
B%F{
blue}%n%
f%b
"
local
eol
=
"%
B
%(?.
%F{yellow}.%F{red})#%f%b
"
fi
local
user_host
=
"
${
user
}
%
{
$fg_bold
[
yellow
]%
}@%{
$fg_bold
[
white
]%
}%m%
{
$reset_color
%}
"
local
user_host
=
"
${
user
}
%
B%F{
yellow}@%
F
{white}%m%
f%b
"
local
current_dir
=
"%
{
$fg_bold
[
green
]%
}%~%
{
$reset_color
%}
"
local
current_dir
=
"%
B%F{
green}%~%
f%b
"
PROMPT
=
'${clock} ${user_host} ${current_dir}${eol} '
...
...
@@ -28,16 +28,16 @@ autoload -Uz vcs_info
zstyle
':vcs_info:*'
max-exports 1
# vcs_info only sets vcs_info_msg_0_
zstyle
':vcs_info:*'
enable
git
zstyle
':vcs_info:*'
check-for-changes
true
zstyle
':vcs_info:*'
check-for-changes
true
# enable %c and %u sequences usage
local
vcs_unstaged_color
=
${
OHMYVIA_VCS_UNSTAGED_COLOR
:-
"
$fg
[
red
]
"
}
local
vcs_staged_color
=
${
OHMYVIA_VCS_STAGED_COLOR
:-
"
$fg
[
yellow
]
"
}
local
vcs_stash_color
=
${
OHMYVIA_VCS_STASH_COLOR
:-
"
$fg
[
blue
]
"
}
local
vcs_untracked_color
=
${
OHMYVIA_VCS_UNTRACKED_COLOR
:-
"
$fg
[
cyan
]
"
}
local
vcs_clean_color
=
${
OHMYVIA_VCS_CLEAN_COLOR
:-
"
$fg
[
green
]
"
}
local
vcs_unstaged_color
=
${
OHMYVIA_VCS_UNSTAGED_COLOR
:-
"
%F{
red
}
"
}
local
vcs_staged_color
=
${
OHMYVIA_VCS_STAGED_COLOR
:-
"
%F{
yellow
}
"
}
local
vcs_stash_color
=
${
OHMYVIA_VCS_STASH_COLOR
:-
"
%F{
blue
}
"
}
local
vcs_untracked_color
=
${
OHMYVIA_VCS_UNTRACKED_COLOR
:-
"
%F{
cyan
}
"
}
local
vcs_clean_color
=
${
OHMYVIA_VCS_CLEAN_COLOR
:-
"
%F{
green
}
"
}
zstyle
':vcs_info:*'
unstagedstr
"%{
$vcs_unstaged_color
%}"
zstyle
':vcs_info:*'
stagedstr
"%{
$vcs_staged_color
%}"
zstyle
':vcs_info:*'
unstagedstr
$vcs_unstaged_color
zstyle
':vcs_info:*'
stagedstr
$vcs_staged_color
# Thanks to https://github.com/sunaku/home/
function
+vi-git-untracked
(){
...
...
@@ -47,14 +47,14 @@ function +vi-git-untracked(){
# If instead you want to show the marker only if there are untracked
# files in $PWD, use:
#[[ -n $(git ls-files --others --exclude-standard) ]] ; then
hook_com[misc]+
=
"%{
$vcs_untracked_color
%}"
hook_com[misc]+
=
$vcs_untracked_color
fi
}
# Thanks to http://eseth.org/2010/git-in-zsh.html
function
+vi-git-stash
()
{
if
[[
-s
${
hook_com
[base]
}
/.git/refs/stash
]]
;
then
hook_com[misc]+
=
"%{
$vcs_stash_color
%}"
hook_com[misc]+
=
$vcs_stash_color
fi
}
...
...
@@ -71,10 +71,10 @@ zstyle ':vcs_info:git*+set-message:*' hooks git-untracked git-stash
# %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.
local
vcs_formats_prefix
=
"
%{
$fg
[
magenta
]%
}(%{
$fg
[
white
]%
}%s%{
$fg
[
magenta
]%
})%
{
$reset_color
%}
"
local
vcs_formats_hyphen
=
"%{
$fg
[
yellow
]%
}-%
{
$reset_color
%}
"
local
vcs_formats_normal
=
"%{
$fg
[
magenta
]%}[%{
$vcs_clean_color
%
}%
m%c%u%b%{
$fg
[
magenta
]%
}]%
{
$reset_color
%}
"
local
vcs_formats_action
=
"%{
$fg
[
magenta
]%}[%{
$vcs_clean_color
%
}%
m%c%u%b%{
$fg
[
yellow
]%
}:%{
$fg
[
red
]%
}%a%{
$fg
[
magenta
]%
}]%
{
$reset_color
%}
"
local
vcs_formats_prefix
=
"
%F{
magenta}(%
F
{white}%s%
F
{magenta})%
f
"
local
vcs_formats_hyphen
=
"%
F
{yellow}-%
f
"
local
vcs_formats_normal
=
"%
F
{magenta
}[
$vcs_clean_color
%m%c%u%b%
F
{magenta}]%
f
"
local
vcs_formats_action
=
"%
F
{magenta
}[
$vcs_clean_color
%m%c%u%b%
F
{yellow}:%
F
{red}%a%
F
{magenta}]%
f
"
zstyle
':vcs_info:*'
formats
"
$vcs_formats_prefix$vcs_formats_hyphen$vcs_formats_normal
"
zstyle
':vcs_info:*'
actionformats
"
$vcs_formats_prefix$vcs_formats_hyphen$vcs_formats_action
"
...
...
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