Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tide prompt item GO similiar to RUST support #174

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions functions/_tide_item_go.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function _tide_item_go
if test -e go.mod
set_color $tide_go_color
printf '%s' $tide_go_icon' ' (go version | string split ' ')[3]
end
end
2 changes: 1 addition & 1 deletion functions/_tide_remove_unusable_items.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function _tide_remove_unusable_items
# Remove tool-specific items for tools the machine doesn't have installed
for item in chruby git nvm php rust virtual_env
for item in chruby git go nvm php rust virtual_env
set -l cliName $item
switch $item
case virtual_env
Expand Down
5 changes: 4 additions & 1 deletion functions/tide/configure/configs/classic.fish
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php vi_mode chruby
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust go php vi_mode chruby
tide_right_prompt_pad_items true
tide_right_prompt_prefix ''
tide_right_prompt_suffix ''
Expand All @@ -73,6 +73,9 @@ tide_chruby_icon ''
tide_rust_bg_color 444444
tide_rust_color 00AFAF
tide_rust_icon ''
tide_go_bg_color 444444
tide_go_color 00EFEF
tide_go_icon 'ﳑ'
tide_status_failure_bg_color 444444
tide_status_failure_color D70000
tide_status_failure_icon '✘'
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/classic_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ tide_chruby_bg_color black
tide_chruby_color red
tide_rust_bg_color black
tide_rust_color cyan
tide_go_bg_color black
tide_go_color cyan
tide_status_failure_bg_color black
tide_status_failure_color red
tide_status_success_bg_color black
Expand Down
5 changes: 4 additions & 1 deletion functions/tide/configure/configs/lean.fish
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tide_right_prompt_frame_enabled false
tide_right_prompt_item_separator_diff_color ' '
tide_right_prompt_item_separator_same_color ' '
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php chruby
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust go php chruby
tide_right_prompt_pad_items false
tide_right_prompt_prefix ' '
tide_right_prompt_suffix ''
Expand All @@ -73,6 +73,9 @@ tide_chruby_icon ''
tide_rust_bg_color normal
tide_rust_color 00AFAF
tide_rust_icon ''
tide_go_bg_color normal
tide_go_color 00EFEF
tide_go_icon 'ﳑ'
tide_status_failure_bg_color normal
tide_status_failure_color D70000
tide_status_failure_icon '✘'
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/lean_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ tide_chruby_bg_color normal
tide_chruby_color red
tide_rust_bg_color normal
tide_rust_color cyan
tide_go_bg_color normal
tide_go_color cyan
tide_status_failure_bg_color normal
tide_status_failure_color red
tide_status_success_bg_color normal
Expand Down
5 changes: 4 additions & 1 deletion functions/tide/configure/configs/rainbow.fish
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tide_right_prompt_frame_enabled true
tide_right_prompt_item_separator_diff_color ''
tide_right_prompt_item_separator_same_color ''
tide_right_prompt_item_separator_same_color_color 949494
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust php vi_mode chruby
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rust go php vi_mode chruby
tide_right_prompt_pad_items true
tide_right_prompt_prefix ''
tide_right_prompt_suffix ''
Expand All @@ -73,6 +73,9 @@ tide_chruby_icon ''
tide_rust_bg_color FF8700
tide_rust_color 2E3436
tide_rust_icon ''
tide_go_bg_color FF8700
tide_go_color 2E3436
tide_go_icon 'ﳑ'
tide_status_failure_bg_color CC0000
tide_status_failure_color FFFF00
tide_status_failure_icon '✘'
Expand Down
2 changes: 2 additions & 0 deletions functions/tide/configure/configs/rainbow_16color.fish
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ tide_chruby_bg_color red
tide_chruby_color black
tide_rust_bg_color yellow
tide_rust_color black
tide_go_bg_color yellow
tide_go_color black
tide_status_failure_bg_color red
tide_status_failure_color bryellow
tide_status_success_bg_color black
Expand Down
18 changes: 18 additions & 0 deletions tests/_tide_item_go.test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# RUN: %fish %s

function _go
_tide_decolor (_tide_item_go)
end

set -l goDir ~/goTest
mkdir -p $goDir
cd $goDir

mock go version "echo go version go1.16.5 linux/amd64"
set -lx tide_go_icon ﳑ

_go # CHECK:

touch go.mod
_go # CHECK: ﳑ go1.16.5
rm -r $goDir