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
c38d5873
Commit
c38d5873
authored
7 years ago
by
Ayaz Badouraly
Browse files
Options
Downloads
Patches
Plain Diff
Expanding full hostname as default behavior
parent
870a5128
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+3
-0
3 additions, 0 deletions
README.md
functions/prompt_utils.zsh
+16
-1
16 additions, 1 deletion
functions/prompt_utils.zsh
via.zsh-theme
+1
-0
1 addition, 0 deletions
via.zsh-theme
with
20 additions
and
1 deletion
README.md
+
3
−
0
View file @
c38d5873
...
...
@@ -54,6 +54,9 @@ ZSH_THEME="oh-my-via/via"
Time format defaults to
`%D{%H:%M}`
, but can be overwritten by setting the variable
`OHMYVIA_TIME_FORMAT`
in your
`~/.zshrc`
.
Hostname may be printed up to the first
`.`
or hidden with the variable
`OHMYVIA_CONTEXT_HOSTNAME`
.
VCS theme can be set through the variable
`OHMYVIA_VCS_THEME`
.
...
...
This diff is collapsed.
Click to expand it.
functions/prompt_utils.zsh
+
16
−
1
View file @
c38d5873
...
...
@@ -10,8 +10,23 @@
# See https://github.com/bhilburn/powerlevel9k/blob/1ff9da64d974265ce2f22bd1da4a47d0b8f7ca90/powerlevel9k.zsh-theme#L434
prompt_context
()
{
local
username
=
"%(!.
$OHMYVIA_CONTEXT_ROOT_COLOR
.
$OHMYVIA_CONTEXT_USER_COLOR
)%n%b%f"
# Return only username if $OHMYVIA_CONTEXT_HOSTNAME is empty.
if
[[
$OHMYVIA_CONTEXT_HOSTNAME
==
"empty"
]]
;
then
echo
"
${
username
}
"
return
fi
local
separator
=
"
$OHMYVIA_CONTEXT_SEPARATOR_COLOR
@%b%f"
local hostname
=
"
$OHMYVIA_CONTEXT_HOSTNAME_COLOR
%m%b%f"
# Handle hostnames containing `.` (defaults to full machine hostname prompt.)
local
colorless_hostname
=
"
$OHMYVIA_CONTEXT_HOSTNAME
"
if
[[
$OHMYVIA_CONTEXT_HOSTNAME
==
'full'
]]
;
then
colorless_hostname
=
"%M"
elif
[[
$OHMYVIA_CONTEXT_HOSTNAME
==
'partial'
]]
;
then
colorless_hostname
=
"%m"
fi
local hostname
=
"
$OHMYVIA_CONTEXT_HOSTNAME_COLOR
${
colorless_hostname
}
%b%f"
echo
"
${
username
}${
separator
}${
hostname
}
"
}
...
...
This diff is collapsed.
Click to expand it.
via.zsh-theme
+
1
−
0
View file @
c38d5873
...
...
@@ -24,6 +24,7 @@ source $OHMYVIA_INSTALLATION_PATH/functions/vcs_utils.zsh
## Properties
set_default OHMYVIA_CONTEXT_HOSTNAME
"full"
set_default OHMYVIA_CONTEXT_HOSTNAME_COLOR
"%B%F{white}"
set_default OHMYVIA_CONTEXT_SEPARATOR_COLOR
"%B%F{yellow}"
set_default OHMYVIA_CONTEXT_ROOT_COLOR
"%B%F{blue}"
...
...
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