Skip to content

Commit

Permalink
Add Zig item
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFunctionalGuy committed Oct 6, 2023
1 parent 1af8bf7 commit d3a0265
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 6 deletions.
6 changes: 6 additions & 0 deletions functions/_tide_item_zig.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function _tide_item_zig
if path is $_tide_parent_dirs/build.zig
zig version | string match -qr "(?<v>[\d.]+(-dev)?)"
_tide_print_item zig $tide_zig_icon' ' $v
end
end
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/classic.fish
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ tide_pwd_bg_color 444444
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
tide_pwd_color_truncated_dirs 8787AF
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_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 build.zig
tide_python_bg_color 444444
tide_python_color 00AFAF
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix 
tide_right_prompt_separator_diff_color 
tide_right_prompt_separator_same_color 
Expand Down Expand Up @@ -111,3 +111,5 @@ tide_vi_mode_color_default 949494
tide_vi_mode_color_insert 87AFAF
tide_vi_mode_color_replace 87AF87
tide_vi_mode_color_visual FF8700
tide_zig_bg_color 444444
tide_zig_color F7A41D
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 @@ -85,3 +85,5 @@ tide_vi_mode_color_default white
tide_vi_mode_color_insert cyan
tide_vi_mode_color_replace green
tide_vi_mode_color_visual yellow
tide_zig_bg_color black
tide_zig_color yellow
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/lean.fish
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ tide_pwd_bg_color normal
tide_pwd_color_anchors $_tide_color_light_blue
tide_pwd_color_dirs $_tide_color_dark_blue
tide_pwd_color_truncated_dirs 8787AF
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_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 build.zig
tide_python_bg_color normal
tide_python_color 00AFAF
tide_right_prompt_frame_enabled false
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix ' '
tide_right_prompt_separator_diff_color ' '
tide_right_prompt_separator_same_color ' '
Expand Down Expand Up @@ -111,3 +111,5 @@ tide_vi_mode_color_default 949494
tide_vi_mode_color_insert 87AFAF
tide_vi_mode_color_replace 87AF87
tide_vi_mode_color_visual FF8700
tide_zig_bg_color normal
tide_zig_color F7A41D
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 @@ -85,3 +85,5 @@ tide_vi_mode_color_default white
tide_vi_mode_color_insert cyan
tide_vi_mode_color_replace green
tide_vi_mode_color_visual yellow
tide_zig_bg_color normal
tide_zig_color yellow
6 changes: 4 additions & 2 deletions functions/tide/configure/configs/rainbow.fish
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ tide_pwd_bg_color 3465A4
tide_pwd_color_anchors E4E4E4
tide_pwd_color_dirs E4E4E4
tide_pwd_color_truncated_dirs BCBCBC
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_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 build.zig
tide_python_bg_color 444444
tide_python_color 00AFAF
tide_right_prompt_frame_enabled true
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir
tide_right_prompt_items status cmd_duration context jobs direnv node python rustc java php pulumi ruby go gcloud kubectl distrobox toolbox terraform aws nix_shell crystal elixir zig
tide_right_prompt_prefix 
tide_right_prompt_separator_diff_color 
tide_right_prompt_separator_same_color 
Expand Down Expand Up @@ -111,3 +111,5 @@ tide_vi_mode_color_default 000000
tide_vi_mode_color_insert 000000
tide_vi_mode_color_replace 000000
tide_vi_mode_color_visual 000000
tide_zig_bg_color F7A41D
tide_zig_color 000000
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 @@ -89,3 +89,5 @@ tide_vi_mode_icon_default D
tide_vi_mode_icon_insert I
tide_vi_mode_icon_replace R
tide_vi_mode_icon_visual V
tide_zig_bg_color yellow
tide_zig_color black
1 change: 1 addition & 0 deletions functions/tide/configure/icons.fish
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ tide_vi_mode_icon_default D
tide_vi_mode_icon_insert I
tide_vi_mode_icon_replace R
tide_vi_mode_icon_visual V
tide_zig_icon 
22 changes: 22 additions & 0 deletions tests/_tide_item_zig.test.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# RUN: %fish %s
_tide_parent_dirs

function _zig
_tide_decolor (_tide_item_zig)
end

set -l zigDir (mktemp -d)
cd $zigDir

mock zig version "echo 0.11.0"
set -lx tide_zig_icon 

_zig # CHECK:

touch build.zig
_zig # CHECK:  0.11.0

mock zig version "echo 0.12.0-dev.789+e6590fea1"
_zig # CHECK:  0.12.0-dev

command rm -r $zigDir

0 comments on commit d3a0265

Please sign in to comment.