mirror of
https://github.com/IlanCosman/tide.git
synced 2024-09-11 17:15:34 +03:00
Add go item (#174)
Co-authored-by: Dr. Stephan Heuer <dshr153@gmail.com>
This commit is contained in:
parent
54bf900104
commit
8b4201cbdf
@ -13,6 +13,7 @@
|
||||
- Run pwd after all other items, which allows it to precisely react to prompt length ([#131][])
|
||||
- Add `shlvl` item ([#156][] - @kidonng)
|
||||
- Display pipenv virtual environments better in `virtual_env` item.
|
||||
- Add `go` item ([#174][] - @dr-emacs)
|
||||
- Performance improvements
|
||||
|
||||
### Bug fixes
|
||||
|
3
functions/_tide_item_go.fish
Normal file
3
functions/_tide_item_go.fish
Normal file
@ -0,0 +1,3 @@
|
||||
function _tide_item_go
|
||||
test -e go.mod && _tide_print_item go $tide_go_icon' ' (go version | string match --regex "[\d.]+")
|
||||
end
|
@ -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 rustc virtual_env
|
||||
for item in chruby git go nvm php rustc virtual_env
|
||||
set -l cli_names $item
|
||||
switch $item
|
||||
case virtual_env
|
||||
|
@ -30,6 +30,9 @@ tide_git_color_stash $_tide_color_green
|
||||
tide_git_color_untracked $_tide_color_light_blue
|
||||
tide_git_color_upstream $_tide_color_green
|
||||
tide_git_icon
|
||||
tide_go_bg_color 444444
|
||||
tide_go_color 00AFAF
|
||||
tide_go_icon
|
||||
tide_jobs_bg_color 444444
|
||||
tide_jobs_color $_tide_color_dark_green
|
||||
tide_jobs_icon ''
|
||||
@ -62,7 +65,7 @@ tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
tide_right_prompt_frame_enabled true
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php vi_mode chruby
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php chruby go vi_mode
|
||||
tide_right_prompt_prefix ''
|
||||
tide_right_prompt_separator_diff_color ''
|
||||
tide_right_prompt_separator_same_color ''
|
||||
|
@ -20,6 +20,8 @@ tide_git_color_staged bryellow
|
||||
tide_git_color_stash brgreen
|
||||
tide_git_color_untracked brblue
|
||||
tide_git_color_upstream brgreen
|
||||
tide_go_bg_color black
|
||||
tide_go_color cyan
|
||||
tide_jobs_bg_color black
|
||||
tide_jobs_color green
|
||||
tide_nvm_bg_color black
|
||||
|
@ -30,6 +30,9 @@ tide_git_color_stash $_tide_color_green
|
||||
tide_git_color_untracked $_tide_color_light_blue
|
||||
tide_git_color_upstream $_tide_color_green
|
||||
tide_git_icon
|
||||
tide_go_bg_color normal
|
||||
tide_go_color 00AFAF
|
||||
tide_go_icon
|
||||
tide_jobs_bg_color normal
|
||||
tide_jobs_color $_tide_color_dark_green
|
||||
tide_jobs_icon ''
|
||||
@ -62,7 +65,7 @@ tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
tide_right_prompt_frame_enabled false
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php chruby
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php chruby go
|
||||
tide_right_prompt_prefix ' '
|
||||
tide_right_prompt_separator_diff_color ' '
|
||||
tide_right_prompt_separator_same_color ' '
|
||||
|
@ -20,6 +20,8 @@ tide_git_color_staged bryellow
|
||||
tide_git_color_stash brgreen
|
||||
tide_git_color_untracked brblue
|
||||
tide_git_color_upstream brgreen
|
||||
tide_go_bg_color normal
|
||||
tide_go_color cyan
|
||||
tide_jobs_bg_color normal
|
||||
tide_jobs_color green
|
||||
tide_nvm_bg_color normal
|
||||
|
@ -30,6 +30,9 @@ tide_git_color_stash 000000
|
||||
tide_git_color_untracked 000000
|
||||
tide_git_color_upstream 000000
|
||||
tide_git_icon
|
||||
tide_go_bg_color FF8700
|
||||
tide_go_color 2E3436
|
||||
tide_go_icon
|
||||
tide_jobs_bg_color 444444
|
||||
tide_jobs_color 4E9A06
|
||||
tide_jobs_icon ''
|
||||
@ -62,7 +65,7 @@ tide_pwd_icon_home
|
||||
tide_pwd_icon_unwritable ''
|
||||
tide_pwd_markers .bzr .citc .git .hg .node-version .python-version .ruby-version .shorten_folder_marker .svn .terraform Cargo.toml composer.json CVS go.mod package.json
|
||||
tide_right_prompt_frame_enabled true
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php vi_mode chruby
|
||||
tide_right_prompt_items status cmd_duration context jobs nvm virtual_env rustc php chruby go vi_mode
|
||||
tide_right_prompt_prefix ''
|
||||
tide_right_prompt_separator_diff_color ''
|
||||
tide_right_prompt_separator_same_color ''
|
||||
|
@ -20,6 +20,8 @@ tide_git_color_staged black
|
||||
tide_git_color_stash black
|
||||
tide_git_color_untracked black
|
||||
tide_git_color_upstream black
|
||||
tide_go_bg_color yellow
|
||||
tide_go_color black
|
||||
tide_jobs_bg_color brblack
|
||||
tide_jobs_color green
|
||||
tide_nvm_bg_color magenta
|
||||
|
19
tests/_tide_item_go.test.fish
Normal file
19
tests/_tide_item_go.test.fish
Normal file
@ -0,0 +1,19 @@
|
||||
# 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: 1.16.5
|
||||
|
||||
rm -r $goDir
|
Loading…
Reference in New Issue
Block a user