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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
trapd00r.zsh-theme
themes/trapd00r.zsh-theme
+5
-7
No files found.
themes/trapd00r.zsh-theme
View file @
e9726249
...
@@ -50,9 +50,8 @@ zsh_path() {
...
@@ -50,9 +50,8 @@ 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"
...
@@ -68,12 +67,11 @@ zsh_path() {
...
@@ -68,12 +67,11 @@ zsh_path() {
fi
fi
((
i++
))
((
i++
))
else
if
[[
$colors
-ge
256
]]
;
then
if
[[
$colors
-ge
256
]]
;
then
print
-Pn
"%F{065}
$c
"
print
-Pn
"%F{065}
$dir
"
else
else
print
-Pn
"%F{blue}
$c
"
print
-Pn
"%F{blue}
$dir
"
fi
fi
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