adding kubernetes info to prompt
This commit is contained in:
@@ -66,4 +66,4 @@ set fish_greeting ''
|
||||
set -g fish_user_paths "/usr/local/sbin" $fish_user_paths
|
||||
|
||||
# add kitty support
|
||||
kitty + complete setup fish | source
|
||||
# kitty + complete setup fish | source
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
function az_web --description 'Use az web'
|
||||
az aks browse --name aks-$argv --resource-group $argv
|
||||
end
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ function _rb_prompt
|
||||
echo (rbenv version | awk '{print $1}')
|
||||
end
|
||||
|
||||
function _kb_context
|
||||
echo (kubectl config current-context | awk '{print $1}')
|
||||
end
|
||||
|
||||
function fish_prompt
|
||||
set -l cyan (set_color -o cyan)
|
||||
set -l magenta (set_color -o magenta)
|
||||
@@ -22,18 +26,22 @@ function fish_prompt
|
||||
# set -l arrow "$red↪ $normal"
|
||||
set -l cwd $cyan(pwd|sed "s=$HOME=~=")
|
||||
|
||||
set -l ruby_version $magenta(_rb_prompt)
|
||||
set -l ruby_version "$ruby_version$normal in "
|
||||
if [ (_kb_context) ]
|
||||
set -l kb_context $yellow(_kb_context)
|
||||
set kube_context "|$kb_context"
|
||||
end
|
||||
|
||||
set -l ruby_version $magenta(_rb_prompt)
|
||||
set -l ruby_version "[$ruby_version$normal$kube_context$normal] in "
|
||||
|
||||
if [ (_git_branch_name) ]
|
||||
set -l git_branch $red(_git_branch_name)
|
||||
set git_info "$normal on $blue$git_branch$blue"
|
||||
set -l git_branch $red(_git_branch_name)
|
||||
set git_info "$normal on $blue$git_branch$blue"
|
||||
|
||||
if [ (_is_git_dirty) ]
|
||||
set -l dirty "$yellow ✗"
|
||||
set git_info "$git_info$dirty"
|
||||
end
|
||||
if [ (_is_git_dirty) ]
|
||||
set -l dirty "$yellow ✗"
|
||||
set git_info "$git_info$dirty"
|
||||
end
|
||||
end
|
||||
|
||||
echo -s $ruby_version $cwd $git_info $normal \n $arrow " "
|
||||
|
||||
3
fish/functions/kc.fish
Normal file
3
fish/functions/kc.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function kc --description 'switch context to dev, int or prod'
|
||||
kubectl config use-context aks-$argv
|
||||
end
|
||||
@@ -172,7 +172,7 @@ font_size 15.0
|
||||
#: special value default means to use the operating system's default
|
||||
#: URL handler.
|
||||
|
||||
# copy_on_select no
|
||||
copy_on_select yes
|
||||
|
||||
#: Copy to clipboard or a private buffer on select. With this set to
|
||||
#: clipboard, simply selecting text with the mouse will cause the text
|
||||
|
||||
Reference in New Issue
Block a user