Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
midgard
Dotfilets
Commits
0c1a5877
Unverified
Commit
0c1a5877
authored
Jun 13, 2019
by
Midgard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[zsh theme] Clean up code
parent
7a5304fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
midgard.zsh-theme
midgard.zsh-theme
+7
-5
No files found.
midgard.zsh-theme
View file @
0c1a5877
...
...
@@ -2,24 +2,26 @@
function
my_pwd
{
# ~ for home; keep only the last two directories
echo
$(
echo
"
$PWD
"
|
sed
-r
'
echo
"
$PWD
"
|
sed
-r
'
s,^'
"
$HOME
"
',~,; t reset; :reset
s|^~/git/my-cool-project/([^/])[^/]+/([^/]+)/|\1/\2/|; t end
s|^.+/([^/]*/[^/]*)$|\1|
:end'
)
:end'
}
function
my_retval
{
RETVAL
=
$?
if
[[
$RETVAL
-eq
0
]]
;
then
echo
"%{
$fg
[
yellow
]
%}"
echo
"%{
%F{
yellow
}
%}"
else
echo
"%{
$fg
[
red
]
%}
$RETVAL
"
echo
"%{
%F{
red
}
%}
$RETVAL
"
fi
}
PROMPT
=
'$(my_retval)$(my_pwd)$(git_prompt_info)$(git_prompt_status) %{$reset_color%} '
function
precmd
{
PS1
=
"
$(
my_retval
)$(
my_pwd
)$(
git_prompt_info
)$(
git_prompt_status
)
%{%f%} "
}
ZSH_THEME_GIT_PROMPT_PREFIX
=
" %{
$fg
[green]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX
=
""
...
...
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