mirror of
https://github.com/oh-my-fish/oh-my-fish
synced 2024-11-03 15:40:32 +00:00
Added lambda theme which includes rbenv helpers
Characteristics - Working directory - Git branch and dirty state (if inside a git repo) - Rbenv Ruby Version - Rbenv Ruby Gemset
This commit is contained in:
parent
ab144c3765
commit
259caecfa6
12
themes/lambda/README.md
Normal file
12
themes/lambda/README.md
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
## Lambda
|
||||||
|
|
||||||
|
A theme inspired by [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh/blob/master/themes/lambda.zsh-theme)'s [lambda](http://zshthem.es/screenshots/lambda.png) theme.
|
||||||
|
|
||||||
|
![](http://f.cl.ly/items/0s2B1n3F0I31340E273G/Screen%20Shot%202015-02-05%20at%2010.50.06%20am.png)
|
||||||
|
|
||||||
|
#### Characteristics
|
||||||
|
|
||||||
|
* Working directory
|
||||||
|
* Git branch and dirty state (if inside a git repo)
|
||||||
|
* Rbenv Ruby Version
|
||||||
|
* Rbenv Ruby Gemset
|
40
themes/lambda/fish_prompt.fish
Normal file
40
themes/lambda/fish_prompt.fish
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# name: lambda
|
||||||
|
# ---------------
|
||||||
|
# Based on oh-my-zsh lambda theme
|
||||||
|
#
|
||||||
|
# Display the following bits on the left:
|
||||||
|
# - Working directory
|
||||||
|
# - Git branch and dirty state (if inside a git repo)
|
||||||
|
#
|
||||||
|
# Display the following bits on the right:
|
||||||
|
# - Rbenv Ruby Version
|
||||||
|
# - Rbenv Ruby Gemset# - Current directory name
|
||||||
|
|
||||||
|
function _git_branch_name
|
||||||
|
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
||||||
|
end
|
||||||
|
|
||||||
|
function _is_git_dirty
|
||||||
|
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_prompt
|
||||||
|
set -l blue (set_color blue)
|
||||||
|
set -l green (set_color green)
|
||||||
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
|
set -l arrow "λ"
|
||||||
|
set -l cwd $blue(basename (prompt_pwd))
|
||||||
|
|
||||||
|
if [ (_git_branch_name) ]
|
||||||
|
set git_info $green(_git_branch_name)
|
||||||
|
set git_info ":$git_info"
|
||||||
|
|
||||||
|
if [ (_is_git_dirty) ]
|
||||||
|
set -l dirty "*"
|
||||||
|
set git_info "$git_info$dirty"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -n -s $cwd $git_info $normal ' ' $arrow ' '
|
||||||
|
end
|
21
themes/lambda/fish_right_prompt.fish
Normal file
21
themes/lambda/fish_right_prompt.fish
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
function _ruby_version
|
||||||
|
echo (command rbenv version-name | sed 's/\n//')
|
||||||
|
end
|
||||||
|
|
||||||
|
function _ruby_gemset
|
||||||
|
echo (command rbenv gemset active ^/dev/null | sed -e 's| global||')
|
||||||
|
end
|
||||||
|
|
||||||
|
function fish_right_prompt
|
||||||
|
set -l red (set_color red)
|
||||||
|
set -l normal (set_color normal)
|
||||||
|
|
||||||
|
set ruby_info $red(_ruby_version)
|
||||||
|
|
||||||
|
if [ (_ruby_gemset) ]
|
||||||
|
set -l ruby_gemset $red(_ruby_gemset)
|
||||||
|
set ruby_info "$ruby_info@$ruby_gemset"
|
||||||
|
end
|
||||||
|
|
||||||
|
echo -n -s $ruby_info $normal
|
||||||
|
end
|
BIN
themes/lambda/screenshot.png
Normal file
BIN
themes/lambda/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Loading…
Reference in New Issue
Block a user