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
3c152395
Commit
3c152395
authored
Jun 01, 2014
by
James Hillyerd
Committed by
Bruno Pinto
Jun 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make more fish like
- Cache hostname & prompt char - Use > instead of %
parent
ad626cb7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
themes/yimmy/README.md
themes/yimmy/README.md
+3
-3
themes/yimmy/fish_prompt.fish
themes/yimmy/fish_prompt.fish
+15
-8
No files found.
themes/yimmy/README.md
View file @
3c152395
## yimmy
## yimmy
theme
A simple two-line theme best displayed on a terminal configured with Solarized
Dark colors.
user@host ~/c/w/dir (branch *)
%
>
Characteristics:
-
Standard fish prompt characters: > for user, # for root
-
Uses the fish prompt_pwd, so paths will be abbreviated
-
Uses built-in __fish_git_prompt functionality
-
Indicates Git work-in-progress (gwip/gunwip) if detected
-
Tradition bourne prompt characters: $ for user, # for root
-
Prompt character is colored red if previous command had a non-zero exit
status
themes/yimmy/fish_prompt.fish
View file @
3c152395
...
...
@@ -2,6 +2,19 @@ function fish_prompt
# Cache exit status
set -l last_status $status
# Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end
if not set -q __fish_prompt_char
switch (id -u)
case 0
set -g __fish_prompt_char '#'
case '*'
set -g __fish_prompt_char '>'
end
end
# Setup colors
set -l normal (set_color normal)
set -l red (set_color red)
...
...
@@ -23,14 +36,8 @@ function fish_prompt
set pcolor $red
end
# Traditional prompt chars
set -l pchar '$'
if test (id -u) = '0'
set pchar = '#'
end
# Line 1
echo -n $red'┌'$cyan$USER$white'@'$cyan
(hostname -s)' '
$gray(prompt_pwd)$normal
echo -n $red'┌'$cyan$USER$white'@'$cyan
$__fish_prompt_hostname
$gray(prompt_pwd)$normal
__fish_git_prompt
# Check for gwip; does last commit log contain --wip--?
if begin git log -n 1 ^/dev/null | grep -qc "\-\-wip\-\-"; end
...
...
@@ -39,5 +46,5 @@ function fish_prompt
echo
# Line 2
echo -n $red'└'$pcolor$
pchar' '
$normal
echo -n $red'└'$pcolor$
__fish_prompt_char
$normal
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