Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
e9726249
Commit
e9726249
authored
Aug 20, 2018
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trapd00r: simplify logic and optimize for loop
This version splits the `$PWD` by the slashes and prints the path directory by directory, printing the separators as before.
parent
b4c8b60b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
18 deletions
+16
-18
trapd00r.zsh-theme
themes/trapd00r.zsh-theme
+16
-18
No files found.
themes/trapd00r.zsh-theme
View file @
e9726249
...
@@ -50,31 +50,29 @@ zsh_path() {
...
@@ -50,31 +50,29 @@ zsh_path() {
17
'%F{202}'
18
'%F{166}'
17
'%F{202}'
18
'%F{166}'
)
)
local
c
i
=
1
local dir
i
=
1
for
c
(
${
(s
::
)PWD
}
)
;
do
for
dir
(
${
(s
:/:
)PWD
}
)
;
do
if
[[
$c
=
"/"
]]
;
then
if
[[
$i
-eq
1
]]
;
then
if
[[
$i
-eq
1
]]
;
then
if
[[
$colors
-ge
256
]]
;
then
if
[[
$colors
-ge
256
]]
;
then
print
-Pn
"%F{065}%B /%b"
print
-Pn
"%F{065}%B /%b"
else
print
-Pn
"
\e
[31;1m /"
fi
else
else
if
[[
$colors
-ge
256
]]
;
then
print
-Pn
"
\e
[31;1m /"
print
-Pn
"
${
yellow
[
$i
]
:-
%f
}
» "
else
print
-Pn
"%F{yellow} > "
fi
fi
fi
((
i++
))
else
else
if
[[
$colors
-ge
256
]]
;
then
if
[[
$colors
-ge
256
]]
;
then
print
-Pn
"
%F{065}
$c
"
print
-Pn
"
${
yellow
[
$i
]
:-
%f
}
»
"
else
else
print
-Pn
"%F{
blue}
$c
"
print
-Pn
"%F{
yellow} >
"
fi
fi
fi
fi
((
i++
))
if
[[
$colors
-ge
256
]]
;
then
print
-Pn
"%F{065}
$dir
"
else
print
-Pn
"%F{blue}
$dir
"
fi
done
done
print
-Pn
"%f"
print
-Pn
"%f"
}
}
...
...
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