Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Ohmyzsh
Commits
15825709
Commit
15825709
authored
Aug 17, 2010
by
Josh Price
Committed by
Robby Russell
Aug 19, 2010
Browse files
Made the user_machine_size calculation generic. Pwned the function name.
parent
eb14ee1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
themes/josh.zsh-theme
View file @
15825709
...
...
@@ -5,7 +5,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$grey%}) %{$fg[yellow]%}✗%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$grey%})"
function
pat
_prompt {
function
josh
_prompt {
(( spare_width = ${COLUMNS} ))
prompt=" "
...
...
@@ -14,7 +14,7 @@ function pat_prompt {
path_size=${#PWD}
branch_size=${#branch}
ruby_size=${#ruby_version}
machine_size=
11
user_
machine_size=
${#${(%):-%n@%m-}}
if [[ ${#branch} -eq 0 ]]
then (( ruby_size = ruby_size + 1 ))
...
...
@@ -25,7 +25,7 @@ function pat_prompt {
fi
fi
(( spare_width = ${spare_width} - (${machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
(( spare_width = ${spare_width} - (${
user_
machine_size} + ${path_size} + ${branch_size} + ${ruby_size}) ))
while [ ${#prompt} -lt $spare_width ]; do
prompt=" $prompt"
...
...
@@ -39,5 +39,5 @@ function pat_prompt {
setopt prompt_subst
PROMPT='
%n@%m $(
pat
_prompt)
%n@%m $(
josh
_prompt)
%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%} '
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment