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
3c89d4ed
Commit
3c89d4ed
authored
8 years ago
by
Ayaz Badouraly
Browse files
Options
Downloads
Patches
Plain Diff
Using POSIX-compliant definition of functions
parent
ad479d17
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
functions/utils.zsh
+2
-2
2 additions, 2 deletions
functions/utils.zsh
functions/vcs_themes.zsh
+5
-5
5 additions, 5 deletions
functions/vcs_themes.zsh
functions/vcs_utils.zsh
+3
-3
3 additions, 3 deletions
functions/vcs_utils.zsh
with
10 additions
and
10 deletions
functions/utils.zsh
+
2
−
2
View file @
3c89d4ed
...
...
@@ -11,7 +11,7 @@
#
# @param $1 : name of the variable to be filled
# @param $2 : default value set if $1 is not already defined
function
set_default
()
{
set_default
()
{
# /!\ compute differently with color variables
# TODO make the regex case-insensitive
...
...
@@ -28,7 +28,7 @@ function set_default() {
#
# @param $1 : name of the variable to be filled
# @param $2 : default value set if $1 is not already a visual effect or a color code
function
set_default_color
()
{
set_default_color
()
{
# See http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Visual-effects
if
[[
!
${
(P)1
}
=
~
'%'
]]
;
then
...
...
This diff is collapsed.
Click to expand it.
functions/vcs_themes.zsh
+
5
−
5
View file @
3c89d4ed
...
...
@@ -18,7 +18,7 @@
# %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.
function
+vi-theme-default
()
{
+vi-theme-default
()
{
local
vcs_prompt_prefix
=
"%F{magenta}(%F{white}%s%F{magenta})%f"
local
vcs_prompt_hyphen
=
"%F{yellow}-%f"
local
vcs_prompt_normal
=
"%F{magenta}[%m%c%u%b%F{magenta}]%f"
...
...
@@ -28,7 +28,7 @@ function +vi-theme-default() {
OHMYVIA_VCS_PROMPT_ACTION
=
${
OHMYVIA_VCS_PROMPT_ACTION
:-
"
$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action
"
}
}
function
+vi-theme-alphabet
()
{
+vi-theme-alphabet
()
{
local
vcs_prompt_prefix
=
"%F{magenta}(%F{white}%s%F{magenta})%f"
local
vcs_prompt_hyphen
=
"%F{yellow}-%f"
local
vcs_prompt_normal
=
"%F{magenta}[%m%c%u%b%F{magenta}]%f"
...
...
@@ -38,7 +38,7 @@ function +vi-theme-alphabet() {
OHMYVIA_VCS_PROMPT_ACTION
=
"
$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action
"
}
function
+vi-theme-djou
()
{
+vi-theme-djou
()
{
local
vcs_prompt_prefix
=
"%F{white}%s%f"
local
vcs_prompt_hyphen
=
" %F{yellow}-%f "
local
vcs_prompt_normal
=
"%m%c%u%b%f"
...
...
@@ -48,7 +48,7 @@ function +vi-theme-djou() {
OHMYVIA_VCS_PROMPT_ACTION
=
"
$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action
"
}
function
+vi-theme-kiwi
()
{
+vi-theme-kiwi
()
{
local
vcs_prompt_prefix
=
"%F{magenta}(%F{white}%s%F{magenta})%f"
local
vcs_prompt_hyphen
=
"%F{yellow}-%f"
local
vcs_prompt_normal
=
"%F{magenta}[%m%c%u%b%F{magenta}]%f"
...
...
@@ -58,7 +58,7 @@ function +vi-theme-kiwi() {
OHMYVIA_VCS_PROMPT_ACTION
=
"
$vcs_prompt_prefix$vcs_prompt_hyphen$vcs_prompt_action
"
}
function
+vi-theme-jon
()
{
+vi-theme-jon
()
{
local
vcs_prompt_prefix
=
""
local
vcs_prompt_hyphen
=
""
local
vcs_prompt_normal
=
"%F{magenta}[%m%c%u%b%F{magenta}]%f"
...
...
This diff is collapsed.
Click to expand it.
functions/vcs_utils.zsh
+
3
−
3
View file @
3c89d4ed
...
...
@@ -7,14 +7,14 @@
#
# Thanks to http://eseth.org/2010/git-in-zsh.html
function
+vi-git-stash
()
{
+vi-git-stash
()
{
if
[[
-s
${
hook_com
[base]
}
/.git/refs/stash
]]
;
then
hook_com[misc]+
=
$OHMYVIA_VCS_COLOR_STASH
fi
}
# Thanks to https://github.com/sunaku/home/
function
+vi-git-untracked
()
{
+vi-git-untracked
()
{
if
[[
$(
git rev-parse
--is-inside-work-tree
2> /dev/null
)
==
'true'
]]
&&
\
git status
--porcelain
| fgrep
'??'
&> /dev/null
;
then
# This will show the marker if there are any untracked files in repo.
...
...
@@ -27,7 +27,7 @@ function +vi-git-untracked() {
# Erase hook_com[misc] ( ie. %m ) to avoid dealing with backends info outputs
# Add $vcs_clean_color to setup default %b coloring in vcs prompt
function
+vi-misc-init
()
{
+vi-misc-init
()
{
hook_com[misc]
=
$OHMYVIA_VCS_COLOR_CLEAN
}
...
...
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