Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
O
oh-my-fish
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
oh-my-fish
Commits
9376094d
Commit
9376094d
authored
Aug 06, 2014
by
Joseph Tannhuber
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfixes and simplifications after revision
from bpinto. Thank you very much.
parent
b8426119
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
15 deletions
+33
-15
themes/budspencer/fish_prompt.fish
themes/budspencer/fish_prompt.fish
+8
-9
themes/budspencer/fish_right_prompt.fish
themes/budspencer/fish_right_prompt.fish
+25
-6
No files found.
themes/budspencer/fish_prompt.fish
View file @
9376094d
...
@@ -13,29 +13,29 @@
...
@@ -13,29 +13,29 @@
###############################################################################
###############################################################################
# define colors
# define colors
# values are: black dark_gray light_gray white yellow orange red magenta violet blue cyan green
set -g budspencer_colors 000000 083743 445659 fdf6e3 b58900 cb4b16 dc121f af005f 6c71c4 268bd2 2aa198 859900
set -g budspencer_colors 000000 083743 445659 fdf6e3 b58900 cb4b16 dc121f af005f 6c71c4 268bd2 2aa198 859900
# cursor colors
# cursor color changes according to vi-mode
# define values for: normal_mode insert_mode visual_mode
set -g budspencer_cursors "\033]12;#$budspencer_colors[10]\007" "\033]12;#$budspencer_colors[5]\007" "\033]12;#$budspencer_colors[8]\007"
set -g budspencer_cursors "\033]12;#$budspencer_colors[10]\007" "\033]12;#$budspencer_colors[5]\007" "\033]12;#$budspencer_colors[8]\007"
# some terminals cannot change the cursor color
set -l unsupported_terminals "fbterm" "st" "linux" "screen"
set -l unsupported_terminals "fbterm" "st" "linux" "screen"
for term in $unsupported_terminals
if contains $TERM $unsupported_terminals
if test $term = $TERM
set -e budspencer_cursors
set -g budspencer_cursors "" "" ""
end
end
end
###############################################################################
###############################################################################
# Utils
# Utils
###############################################################################
###############################################################################
set -g __budspencer_display_rprompt 1
function __budspencer_git_branch_name -d "Return the current branch name"
function __budspencer_git_branch_name -d "Return the current branch name"
set -l branch (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
set -l branch (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
if test (count $branch) -eq 0
if test (count $branch) -eq 0
set -l position (git describe --contains --all HEAD ^/dev/null)
set -l position (git describe --contains --all HEAD ^/dev/null)
if test (count $position) -eq 0
if test (count $position) -eq 0
set -l commit (git rev-parse HEAD ^/dev/null | sed
-r 's|(^.{7}
).*|\1|')
set -l commit (git rev-parse HEAD ^/dev/null | sed
's|\(^.......\
).*|\1|')
echo -n (set_color -b $budspencer_colors[11])""(set_color $budspencer_colors[1])" ➦ "$commit" "(set_color $budspencer_colors[11])
echo -n (set_color -b $budspencer_colors[11])""(set_color $budspencer_colors[1])" ➦ "$commit" "(set_color $budspencer_colors[11])
else
else
echo -n (set_color -b $budspencer_colors[9])""(set_color $budspencer_colors[1])" "$position" "(set_color $budspencer_colors[9])
echo -n (set_color -b $budspencer_colors[9])""(set_color $budspencer_colors[1])" "$position" "(set_color $budspencer_colors[9])
...
@@ -111,7 +111,6 @@ end
...
@@ -111,7 +111,6 @@ end
function fish_prompt -d "Write out the left prompt of the budspencer theme"
function fish_prompt -d "Write out the left prompt of the budspencer theme"
set -g last_status $status
set -g last_status $status
set -l basedir_name (basename (prompt_pwd))
#############################################################################
#############################################################################
# Segments
# Segments
...
...
themes/budspencer/fish_right_prompt.fish
View file @
9376094d
###############################################################################
# Init
###############################################################################
set -g CMD_DURATION 0
###############################################################################
###############################################################################
# Utils
# Utils
###############################################################################
###############################################################################
...
@@ -14,7 +19,7 @@ function __budspencer_git_status -d "Check git status"
...
@@ -14,7 +19,7 @@ function __budspencer_git_status -d "Check git status"
set -l unmerged 0
set -l unmerged 0
set -l untracked 0
set -l untracked 0
set -l git_status (command git status --porcelain ^/dev/null)
set -l git_status (command git status --porcelain ^/dev/null)
for i in (seq
1
(count $git_status))
for i in (seq (count $git_status))
echo $git_status[$i] | egrep "^[ACDMT][\ MT]\ |^[ACMT]D\ " > /dev/null; and set added (math $added+1)
echo $git_status[$i] | egrep "^[ACDMT][\ MT]\ |^[ACMT]D\ " > /dev/null; and set added (math $added+1)
echo $git_status[$i] | egrep "^[\ ACMRT]D\ " > /dev/null; and set deleted (math $deleted+1)
echo $git_status[$i] | egrep "^[\ ACMRT]D\ " > /dev/null; and set deleted (math $deleted+1)
echo $git_status[$i] | egrep "^.[MT]\ " > /dev/null; and set modified (math $modified+1)
echo $git_status[$i] | egrep "^.[MT]\ " > /dev/null; and set modified (math $modified+1)
...
@@ -46,7 +51,7 @@ if set -q -x $PWDSTYLE
...
@@ -46,7 +51,7 @@ if set -q -x $PWDSTYLE
end
end
set pwd_style $PWDSTYLE[1]
set pwd_style $PWDSTYLE[1]
function fish_pwd_toggle_cm -d "Toggles style of pwd segment, press space bar in NORMAL or VISUAL mode"
function fish_pwd_toggle_cm -d "Toggles style of pwd segment, press space bar in NORMAL or VISUAL mode"
for i in (seq
1
(count $PWDSTYLE))
for i in (seq (count $PWDSTYLE))
if test $PWDSTYLE[$i] = $pwd_style
if test $PWDSTYLE[$i] = $pwd_style
set pwd_style $PWDSTYLE[(math $i%(count $PWDSTYLE)+1)]
set pwd_style $PWDSTYLE[(math $i%(count $PWDSTYLE)+1)]
commandline -f repaint
commandline -f repaint
...
@@ -58,12 +63,26 @@ bind -M default ' ' fish_pwd_toggle_cm
...
@@ -58,12 +63,26 @@ bind -M default ' ' fish_pwd_toggle_cm
bind -M visual ' ' fish_pwd_toggle_cm
bind -M visual ' ' fish_pwd_toggle_cm
function fish_cmd_duration_cm -d "Displays the elapsed time of last command"
function fish_cmd_duration_cm -d "Displays the elapsed time of last command"
if test (count $CMD_DURATION) -gt 0
set -l seconds ""
set -l duration (echo $CMD_DURATION | tr -d '[[:space:]]' | sed 's|\.[[:digit:]]*||')
set -l minutes ""
set -l hours ""
set -l days ""
set -l cmd_duration (math $CMD_DURATION/1000)
if test $cmd_duration -gt 0
set seconds (math $cmd_duration%68400%3600%60)"s"
if test $cmd_duration -ge 60
set minutes (math $cmd_duration%68400%3600/60)"m"
if test $cmd_duration -ge 3600
set hours (math $cmd_duration%68400/3600)"h"
if test $cmd_duration -ge 68400
set days (math $cmd_duration/68400)"d"
end
end
end
if test $last_status -ne 0
if test $last_status -ne 0
echo -n (set_color $budspencer_colors[2])""(set_color -b $budspencer_colors[2] $budspencer_colors[7])" "$d
uration
echo -n (set_color $budspencer_colors[2])""(set_color -b $budspencer_colors[2] $budspencer_colors[7])" "$d
ays$hours$minutes$seconds
else
else
echo -n (set_color $budspencer_colors[2])""(set_color -b $budspencer_colors[2] $budspencer_colors[12])" "$d
uration
echo -n (set_color $budspencer_colors[2])""(set_color -b $budspencer_colors[2] $budspencer_colors[12])" "$d
ays$hours$minutes$seconds
end
end
end
end
end
end
...
...
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