@heyitsiveen/dotfiles 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +115 -85
- package/dotfiles/macos/.config/fish/completions/fisher.fish +7 -0
- package/dotfiles/macos/.config/fish/completions/tide.fish +13 -0
- package/dotfiles/macos/.config/fish/conf.d/_tide_init.fish +44 -0
- package/dotfiles/macos/.config/fish/fish_plugins +2 -0
- package/dotfiles/macos/.config/fish/functions/_tide_1_line_prompt.fish +19 -0
- package/dotfiles/macos/.config/fish/functions/_tide_2_line_prompt.fish +31 -0
- package/dotfiles/macos/.config/fish/functions/_tide_cache_variables.fish +17 -0
- package/dotfiles/macos/.config/fish/functions/_tide_detect_os.fish +76 -0
- package/dotfiles/macos/.config/fish/functions/_tide_find_and_remove.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_fish_colorize.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_aws.fish +11 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_bun.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_character.fish +17 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_cmd_duration.fish +12 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_context.fish +14 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_crystal.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_direnv.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_distrobox.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_docker.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_elixir.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_gcloud.fish +8 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_git.fish +72 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_go.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_java.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_jobs.fish +7 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_kubectl.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_nix_shell.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_node.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_os.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_php.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_private_mode.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_pulumi.fish +19 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_python.fish +27 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_ruby.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_rustc.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_shlvl.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_status.fish +15 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_terraform.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_time.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_toolbox.fish +4 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_vi_mode.fish +16 -0
- package/dotfiles/macos/.config/fish/functions/_tide_item_zig.fish +6 -0
- package/dotfiles/macos/.config/fish/functions/_tide_parent_dirs.fish +10 -0
- package/dotfiles/macos/.config/fish/functions/_tide_print_item.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/_tide_pwd.fish +42 -0
- package/dotfiles/macos/.config/fish/functions/_tide_remove_unusable_items.fish +25 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_bug-report.fish +73 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_configure.fish +156 -0
- package/dotfiles/macos/.config/fish/functions/_tide_sub_reload.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/fish_mode_prompt.fish +1 -0
- package/dotfiles/macos/.config/fish/functions/fish_prompt.fish +170 -0
- package/dotfiles/macos/.config/fish/functions/fisher.fish +251 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/finish.fish +46 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/icons.fish +33 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_colors.fish +26 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection.fish +31 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/prompt_spacing.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/show_time.fish +33 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/style.fish +36 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/all/transient.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish +38 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish +26 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish +32 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish +51 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish +20 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish +40 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/classic_16color.fish +91 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/lean_16color.fish +91 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow.fish +118 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/configs/rainbow_16color.fish +95 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish +41 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish +8 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish +5 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish +3 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish +22 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish +42 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish +11 -0
- package/dotfiles/macos/.config/fish/functions/tide/configure/icons.fish +41 -0
- package/dotfiles/macos/.config/fish/functions/tide.fish +28 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function _tide_item_git
|
|
2
|
+
if git branch --show-current 2>/dev/null | string shorten -"$tide_git_truncation_strategy"m$tide_git_truncation_length | read -l location
|
|
3
|
+
git rev-parse --git-dir --is-inside-git-dir | read -fL gdir in_gdir
|
|
4
|
+
set location $_tide_location_color$location
|
|
5
|
+
else if test $pipestatus[1] != 0
|
|
6
|
+
return
|
|
7
|
+
else if git tag --points-at HEAD | string shorten -"$tide_git_truncation_strategy"m$tide_git_truncation_length | read location
|
|
8
|
+
git rev-parse --git-dir --is-inside-git-dir | read -fL gdir in_gdir
|
|
9
|
+
set location '#'$_tide_location_color$location
|
|
10
|
+
else
|
|
11
|
+
git rev-parse --git-dir --is-inside-git-dir --short HEAD | read -fL gdir in_gdir location
|
|
12
|
+
set location @$_tide_location_color$location
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Operation
|
|
16
|
+
if test -d $gdir/rebase-merge
|
|
17
|
+
# Turn ANY into ALL, via double negation
|
|
18
|
+
if not path is -v $gdir/rebase-merge/{msgnum,end}
|
|
19
|
+
read -f step <$gdir/rebase-merge/msgnum
|
|
20
|
+
read -f total_steps <$gdir/rebase-merge/end
|
|
21
|
+
end
|
|
22
|
+
test -f $gdir/rebase-merge/interactive && set -f operation rebase-i || set -f operation rebase-m
|
|
23
|
+
else if test -d $gdir/rebase-apply
|
|
24
|
+
if not path is -v $gdir/rebase-apply/{next,last}
|
|
25
|
+
read -f step <$gdir/rebase-apply/next
|
|
26
|
+
read -f total_steps <$gdir/rebase-apply/last
|
|
27
|
+
end
|
|
28
|
+
if test -f $gdir/rebase-apply/rebasing
|
|
29
|
+
set -f operation rebase
|
|
30
|
+
else if test -f $gdir/rebase-apply/applying
|
|
31
|
+
set -f operation am
|
|
32
|
+
else
|
|
33
|
+
set -f operation am/rebase
|
|
34
|
+
end
|
|
35
|
+
else if test -f $gdir/MERGE_HEAD
|
|
36
|
+
set -f operation merge
|
|
37
|
+
else if test -f $gdir/CHERRY_PICK_HEAD
|
|
38
|
+
set -f operation cherry-pick
|
|
39
|
+
else if test -f $gdir/REVERT_HEAD
|
|
40
|
+
set -f operation revert
|
|
41
|
+
else if test -f $gdir/BISECT_LOG
|
|
42
|
+
set -f operation bisect
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Git status/stash + Upstream behind/ahead
|
|
46
|
+
test $in_gdir = true && set -l _set_dir_opt -C $gdir/..
|
|
47
|
+
# Suppress errors in case we are in a bare repo or there is no upstream
|
|
48
|
+
set -l stat (git $_set_dir_opt --no-optional-locks status --porcelain 2>/dev/null)
|
|
49
|
+
string match -qr '(0|(?<stash>.*))\n(0|(?<conflicted>.*))\n(0|(?<staged>.*))
|
|
50
|
+
(0|(?<dirty>.*))\n(0|(?<untracked>.*))(\n(0|(?<behind>.*))\t(0|(?<ahead>.*)))?' \
|
|
51
|
+
"$(git $_set_dir_opt stash list 2>/dev/null | count
|
|
52
|
+
string match -r ^UU $stat | count
|
|
53
|
+
string match -r ^[ADMR] $stat | count
|
|
54
|
+
string match -r ^.[ADMR] $stat | count
|
|
55
|
+
string match -r '^\?\?' $stat | count
|
|
56
|
+
git rev-list --count --left-right @{upstream}...HEAD 2>/dev/null)"
|
|
57
|
+
|
|
58
|
+
if test -n "$operation$conflicted"
|
|
59
|
+
set -g tide_git_bg_color $tide_git_bg_color_urgent
|
|
60
|
+
else if test -n "$staged$dirty$untracked"
|
|
61
|
+
set -g tide_git_bg_color $tide_git_bg_color_unstable
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
_tide_print_item git $_tide_location_color$tide_git_icon' ' (set_color white; echo -ns $location
|
|
65
|
+
set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
|
|
66
|
+
set_color $tide_git_color_upstream; echo -ns ' ⇣'$behind ' ⇡'$ahead
|
|
67
|
+
set_color $tide_git_color_stash; echo -ns ' *'$stash
|
|
68
|
+
set_color $tide_git_color_conflicted; echo -ns ' ~'$conflicted
|
|
69
|
+
set_color $tide_git_color_staged; echo -ns ' +'$staged
|
|
70
|
+
set_color $tide_git_color_dirty; echo -ns ' !'$dirty
|
|
71
|
+
set_color $tide_git_color_untracked; echo -ns ' ?'$untracked)
|
|
72
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
function _tide_item_pulumi
|
|
2
|
+
if path filter $_tide_parent_dirs/Pulumi.yaml | read -l yaml_path
|
|
3
|
+
if command -q sha1sum
|
|
4
|
+
echo -n "$yaml_path" | sha1sum | string match -qr "(?<path_hash>.{40})"
|
|
5
|
+
else if command -q shasum
|
|
6
|
+
echo -n "$yaml_path" | shasum | string match -qr "(?<path_hash>.{40})"
|
|
7
|
+
else
|
|
8
|
+
return
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
string match -qr 'name: *(?<project_name>.*)' <$yaml_path
|
|
12
|
+
set -l workspace_file "$HOME/.pulumi/workspaces/$project_name-$path_hash-workspace.json"
|
|
13
|
+
|
|
14
|
+
if test -e $workspace_file
|
|
15
|
+
string match -qr '"stack": *"(?<stack>.*)"' <$workspace_file
|
|
16
|
+
_tide_print_item pulumi $tide_pulumi_icon' ' $stack
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function _tide_item_python
|
|
2
|
+
if test -n "$VIRTUAL_ENV"
|
|
3
|
+
if command -q python3
|
|
4
|
+
python3 --version | string match -qr "(?<v>[\d.]+)"
|
|
5
|
+
else
|
|
6
|
+
python --version | string match -qr "(?<v>[\d.]+)"
|
|
7
|
+
end
|
|
8
|
+
string match -qr "^.*/(?<dir>.*)/(?<base>.*)" $VIRTUAL_ENV
|
|
9
|
+
# pipenv $VIRTUAL_ENV looks like /home/ilan/.local/share/virtualenvs/pipenv_project-EwRYuc3l
|
|
10
|
+
# Detect whether we are using pipenv by looking for 'virtualenvs'. If so, remove the hash at the end.
|
|
11
|
+
if test "$dir" = virtualenvs
|
|
12
|
+
string match -qr "(?<base>.*)-.*" $base
|
|
13
|
+
_tide_print_item python $tide_python_icon' ' "$v ($base)"
|
|
14
|
+
else if contains -- "$base" virtualenv venv .venv env # avoid generic names
|
|
15
|
+
_tide_print_item python $tide_python_icon' ' "$v ($dir)"
|
|
16
|
+
else
|
|
17
|
+
_tide_print_item python $tide_python_icon' ' "$v ($base)"
|
|
18
|
+
end
|
|
19
|
+
else if path is .python-version Pipfile __init__.py pyproject.toml requirements.txt setup.py
|
|
20
|
+
if command -q python3
|
|
21
|
+
python3 --version | string match -qr "(?<v>[\d.]+)"
|
|
22
|
+
else
|
|
23
|
+
python --version | string match -qr "(?<v>[\d.]+)"
|
|
24
|
+
end
|
|
25
|
+
_tide_print_item python $tide_python_icon' ' $v
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function _tide_item_status
|
|
2
|
+
if string match -qv 0 $_tide_pipestatus # If there is a failure anywhere in the pipestatus
|
|
3
|
+
if test "$_tide_pipestatus" = 1 # If simple failure
|
|
4
|
+
contains character $_tide_left_items || tide_status_bg_color=$tide_status_bg_color_failure \
|
|
5
|
+
tide_status_color=$tide_status_color_failure _tide_print_item status $tide_status_icon_failure' ' 1
|
|
6
|
+
else
|
|
7
|
+
fish_status_to_signal $_tide_pipestatus | string replace SIG '' | string join '|' | read -l out
|
|
8
|
+
test $_tide_status = 0 && _tide_print_item status $tide_status_icon' ' $out ||
|
|
9
|
+
tide_status_bg_color=$tide_status_bg_color_failure tide_status_color=$tide_status_color_failure \
|
|
10
|
+
_tide_print_item status $tide_status_icon_failure' ' $out
|
|
11
|
+
end
|
|
12
|
+
else if not contains character $_tide_left_items
|
|
13
|
+
_tide_print_item status $tide_status_icon
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function _tide_item_vi_mode
|
|
2
|
+
test "$fish_key_bindings" != fish_default_key_bindings && switch $fish_bind_mode
|
|
3
|
+
case default
|
|
4
|
+
tide_vi_mode_bg_color=$tide_vi_mode_bg_color_default tide_vi_mode_color=$tide_vi_mode_color_default \
|
|
5
|
+
_tide_print_item vi_mode $tide_vi_mode_icon_default
|
|
6
|
+
case insert
|
|
7
|
+
tide_vi_mode_bg_color=$tide_vi_mode_bg_color_insert tide_vi_mode_color=$tide_vi_mode_color_insert \
|
|
8
|
+
_tide_print_item vi_mode $tide_vi_mode_icon_insert
|
|
9
|
+
case replace replace_one
|
|
10
|
+
tide_vi_mode_bg_color=$tide_vi_mode_bg_color_replace tide_vi_mode_color=$tide_vi_mode_color_replace \
|
|
11
|
+
_tide_print_item vi_mode $tide_vi_mode_icon_replace
|
|
12
|
+
case visual
|
|
13
|
+
tide_vi_mode_bg_color=$tide_vi_mode_bg_color_visual tide_vi_mode_color=$tide_vi_mode_color_visual \
|
|
14
|
+
_tide_print_item vi_mode $tide_vi_mode_icon_visual
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function _tide_print_item -a item
|
|
2
|
+
v=tide_"$item"_bg_color set -f item_bg_color $$v
|
|
3
|
+
|
|
4
|
+
if set -e add_prefix
|
|
5
|
+
set_color $item_bg_color -b normal
|
|
6
|
+
v=tide_"$_tide_side"_prompt_prefix echo -ns $$v
|
|
7
|
+
else if test "$item_bg_color" = "$prev_bg_color"
|
|
8
|
+
v=tide_"$_tide_side"_prompt_separator_same_color echo -ns $_tide_color_separator_same_color$$v
|
|
9
|
+
else if test $_tide_side = left
|
|
10
|
+
set_color $prev_bg_color -b $item_bg_color
|
|
11
|
+
echo -ns $tide_left_prompt_separator_diff_color
|
|
12
|
+
else
|
|
13
|
+
set_color $item_bg_color -b $prev_bg_color
|
|
14
|
+
echo -ns $tide_right_prompt_separator_diff_color
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
v=tide_"$item"_color set_color $$v -b $item_bg_color
|
|
18
|
+
|
|
19
|
+
echo -ns $_tide_pad $argv[2..] $_tide_pad
|
|
20
|
+
|
|
21
|
+
set -g prev_bg_color $item_bg_color
|
|
22
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
set_color -o $tide_pwd_color_anchors | read -l color_anchors
|
|
2
|
+
set_color $tide_pwd_color_truncated_dirs | read -l color_truncated
|
|
3
|
+
set -l reset_to_color_dirs (set_color normal -b $tide_pwd_bg_color; set_color $tide_pwd_color_dirs)
|
|
4
|
+
|
|
5
|
+
set -l unwritable_icon $tide_pwd_icon_unwritable' '
|
|
6
|
+
set -l home_icon $tide_pwd_icon_home' '
|
|
7
|
+
set -l pwd_icon $tide_pwd_icon' '
|
|
8
|
+
|
|
9
|
+
eval "function _tide_pwd
|
|
10
|
+
if set -l split_pwd (string replace -r '^$HOME' '~' -- \$PWD | string split /)
|
|
11
|
+
test -w . && set -f split_output \"$pwd_icon\$split_pwd[1]\" \$split_pwd[2..] ||
|
|
12
|
+
set -f split_output \"$unwritable_icon\$split_pwd[1]\" \$split_pwd[2..]
|
|
13
|
+
set split_output[-1] \"$color_anchors\$split_output[-1]$reset_to_color_dirs\"
|
|
14
|
+
else
|
|
15
|
+
set -f split_output \"$home_icon$color_anchors~\"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
string join / -- \$split_output | string length -V | read -g _tide_pwd_len
|
|
19
|
+
|
|
20
|
+
i=1 for dir_section in \$split_pwd[2..-2]
|
|
21
|
+
string join -- / \$split_pwd[..\$i] | string replace '~' $HOME | read -l parent_dir # Uses i before increment
|
|
22
|
+
|
|
23
|
+
math \$i+1 | read i
|
|
24
|
+
|
|
25
|
+
if path is \$parent_dir/\$dir_section/\$tide_pwd_markers
|
|
26
|
+
set split_output[\$i] \"$color_anchors\$dir_section$reset_to_color_dirs\"
|
|
27
|
+
else if test \$_tide_pwd_len -gt \$dist_btwn_sides
|
|
28
|
+
string match -qr \"(?<trunc>\..|.)\" \$dir_section
|
|
29
|
+
|
|
30
|
+
set -l glob \$parent_dir/\$trunc*/
|
|
31
|
+
set -e glob[(contains -i \$parent_dir/\$dir_section/ \$glob)] # This is faster than inverse string match
|
|
32
|
+
|
|
33
|
+
while string match -qr \"^\$parent_dir/\$(string escape --style=regex \$trunc)\" \$glob &&
|
|
34
|
+
string match -qr \"(?<trunc>\$(string escape --style=regex \$trunc).)\" \$dir_section
|
|
35
|
+
end
|
|
36
|
+
test -n \"\$trunc\" && set split_output[\$i] \"$color_truncated\$trunc$reset_to_color_dirs\" &&
|
|
37
|
+
string join / \$split_output | string length -V | read _tide_pwd_len
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
string join -- / \"$reset_to_color_dirs\$split_output[1]\" \$split_output[2..]
|
|
42
|
+
end"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function _tide_remove_unusable_items
|
|
2
|
+
# Remove tool-specific items for tools the machine doesn't have installed
|
|
3
|
+
set -l removed_items
|
|
4
|
+
for item in aws bun crystal direnv distrobox docker elixir gcloud git go java kubectl nix_shell node php pulumi python ruby rustc terraform toolbox zig
|
|
5
|
+
contains $item $tide_left_prompt_items $tide_right_prompt_items || continue
|
|
6
|
+
|
|
7
|
+
set -l cli_names $item
|
|
8
|
+
switch $item
|
|
9
|
+
case distrobox # there is no 'distrobox' command inside the container
|
|
10
|
+
set cli_names distrobox-export # 'distrobox-export' and 'distrobox-host-exec' are available
|
|
11
|
+
case nix_shell
|
|
12
|
+
set cli_names nix nix-shell
|
|
13
|
+
case python
|
|
14
|
+
set cli_names python python3
|
|
15
|
+
end
|
|
16
|
+
type --query $cli_names || set -a removed_items $item
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
set -U _tide_left_items (for item in $tide_left_prompt_items
|
|
20
|
+
contains $item $removed_items || echo $item
|
|
21
|
+
end)
|
|
22
|
+
set -U _tide_right_items (for item in $tide_right_prompt_items
|
|
23
|
+
contains $item $removed_items || echo $item
|
|
24
|
+
end)
|
|
25
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function _tide_sub_bug-report
|
|
2
|
+
argparse c/clean v/verbose check -- $argv
|
|
3
|
+
|
|
4
|
+
set -l fish_path (status fish-path)
|
|
5
|
+
|
|
6
|
+
if set -q _flag_clean
|
|
7
|
+
HOME=(mktemp -d) $fish_path --init-command "curl --silent \
|
|
8
|
+
https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish |
|
|
9
|
+
source && fisher install ilancosman/tide@v6"
|
|
10
|
+
else if set -q _flag_verbose
|
|
11
|
+
set --long | string match -r "^_?tide.*" | # Get only tide variables
|
|
12
|
+
string match -r --invert "^_tide_prompt_var.*" # Remove _tide_prompt_var
|
|
13
|
+
else
|
|
14
|
+
$fish_path --version | string match -qr "fish, version (?<fish_version>.*)"
|
|
15
|
+
_tide_check_version Fish fish-shell/fish-shell "(?<v>[\d.]+)" $fish_version || return
|
|
16
|
+
|
|
17
|
+
tide --version | string match -qr "tide, version (?<tide_version>.*)"
|
|
18
|
+
_tide_check_version Tide IlanCosman/tide "v(?<v>[\d.]+)" $tide_version || return
|
|
19
|
+
|
|
20
|
+
if command --query git
|
|
21
|
+
test (path sort (git --version) "git version 2.22.0")[1] = "git version 2.22.0"
|
|
22
|
+
_tide_check_condition \
|
|
23
|
+
"Your git version is too old." \
|
|
24
|
+
"Tide requires at least version 2.22." \
|
|
25
|
+
"Please update before submitting a bug report." || return
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Check that omf is not installed
|
|
29
|
+
not functions --query omf
|
|
30
|
+
_tide_check_condition \
|
|
31
|
+
"Tide does not work with oh-my-fish installed." \
|
|
32
|
+
"Please uninstall it before submitting a bug report." || return
|
|
33
|
+
|
|
34
|
+
if not set -q _flag_check
|
|
35
|
+
$fish_path -ic "time $fish_path -c exit" 2>|
|
|
36
|
+
string match -rg "Executed in(.*)fish" |
|
|
37
|
+
string trim | read -l fish_startup_time
|
|
38
|
+
|
|
39
|
+
read -l --prompt-str "What operating system are you using? (e.g Ubuntu 20.04): " os
|
|
40
|
+
read -l --prompt-str "What terminal emulator are you using? (e.g Kitty): " terminal_emulator
|
|
41
|
+
|
|
42
|
+
printf '%b\n' "\nPlease copy the following information into the issue:\n" \
|
|
43
|
+
"fish version: $fish_version" \
|
|
44
|
+
"tide version: $tide_version" \
|
|
45
|
+
"term: $TERM" \
|
|
46
|
+
"os: $os" \
|
|
47
|
+
"terminal emulator: $terminal_emulator" \
|
|
48
|
+
"fish startup: $fish_startup_time" \
|
|
49
|
+
"fisher plugins: $_fisher_plugins"
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
function _tide_check_version -a program_name repo_name regex_to_get_v installed_version
|
|
55
|
+
curl -sL https://github.com/$repo_name/releases/latest |
|
|
56
|
+
string match -qr "https://github.com/$repo_name/releases/tag/$regex_to_get_v"
|
|
57
|
+
|
|
58
|
+
string match -qr "^$v" "$installed_version" # Allow git versions, e.g 3.3.1-701-gceade1629
|
|
59
|
+
_tide_check_condition \
|
|
60
|
+
"Your $program_name version is out of date." \
|
|
61
|
+
"The latest is $v. You have $installed_version." \
|
|
62
|
+
"Please update before submitting a bug report."
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
function _tide_check_condition
|
|
66
|
+
if test "$status" != 0
|
|
67
|
+
set_color red
|
|
68
|
+
printf '%s\n' $argv
|
|
69
|
+
set_color normal
|
|
70
|
+
return 1
|
|
71
|
+
end
|
|
72
|
+
return 0
|
|
73
|
+
end
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
set -g _tide_color_dark_blue 0087AF
|
|
2
|
+
set -g _tide_color_dark_green 5FAF00
|
|
3
|
+
set -g _tide_color_gold D7AF00
|
|
4
|
+
set -g _tide_color_green 5FD700
|
|
5
|
+
set -g _tide_color_light_blue 00AFFF
|
|
6
|
+
|
|
7
|
+
# Create an empty fake function for each item
|
|
8
|
+
for func in _fake(functions --all | string match --entire _tide_item)
|
|
9
|
+
function $func
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
for file in (status dirname)/tide/configure/{choices, functions}/**.fish
|
|
14
|
+
source $file
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
function _tide_sub_configure
|
|
18
|
+
set -l choices (path basename (status dirname)/tide/configure/choices/**.fish | path change-extension '')
|
|
19
|
+
argparse auto $choices= -- $argv
|
|
20
|
+
|
|
21
|
+
for var in (set -l --names | string match -e _flag)
|
|
22
|
+
set -x $var $$var
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
if set -q _flag_auto
|
|
26
|
+
set -fx _flag_finish 'Overwrite your current tide config'
|
|
27
|
+
else if test $COLUMNS -lt 55 -o $LINES -lt 21
|
|
28
|
+
echo 'Terminal size too small; must be at least 55 x 21'
|
|
29
|
+
return 1
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
_tide_detect_os | read -g --line os_branding_icon os_branding_color os_branding_bg_color
|
|
33
|
+
|
|
34
|
+
set -g fake_columns $COLUMNS
|
|
35
|
+
test $fake_columns -gt 90 && set fake_columns 90
|
|
36
|
+
set -g fake_lines $LINES
|
|
37
|
+
|
|
38
|
+
set -g _tide_selected_option
|
|
39
|
+
_next_choice all/style
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
function _next_choice -a nextChoice
|
|
43
|
+
set -q _tide_selected_option || return 0
|
|
44
|
+
set -l cmd (string split '/' $nextChoice)[2]
|
|
45
|
+
$cmd
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
function _tide_title -a text
|
|
49
|
+
set -q _flag_auto && return
|
|
50
|
+
|
|
51
|
+
command -q clear && clear
|
|
52
|
+
set_color -o
|
|
53
|
+
string pad --width (math --scale=0 "$fake_columns/2" + (string length $text)/2) $text
|
|
54
|
+
set_color normal
|
|
55
|
+
|
|
56
|
+
set -g _tide_configure_first_option_after_title
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
function _tide_option -a symbol text
|
|
60
|
+
set -ga _tide_symbol_list $symbol
|
|
61
|
+
set -ga _tide_option_list $text
|
|
62
|
+
|
|
63
|
+
if not set -q _flag_auto
|
|
64
|
+
set -g _tide_configure_first_prompt_after_option
|
|
65
|
+
|
|
66
|
+
set_color -o
|
|
67
|
+
set -e _tide_configure_first_option_after_title || echo
|
|
68
|
+
echo "($symbol) $text"
|
|
69
|
+
set_color normal
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
function _tide_menu -a func
|
|
74
|
+
if set -q _flag_auto
|
|
75
|
+
set -l flag_var_name _flag_$func
|
|
76
|
+
set -g _tide_selected_option $$flag_var_name
|
|
77
|
+
|
|
78
|
+
if test -z "$_tide_selected_option"
|
|
79
|
+
echo "Missing input for choice '$func'"
|
|
80
|
+
_tide_exit_configure
|
|
81
|
+
else if not contains $_tide_selected_option $_tide_option_list
|
|
82
|
+
echo "Invalid input '$_tide_selected_option' for choice '$func'"
|
|
83
|
+
_tide_exit_configure
|
|
84
|
+
else
|
|
85
|
+
set -e _tide_symbol_list
|
|
86
|
+
set -e _tide_option_list
|
|
87
|
+
end
|
|
88
|
+
return
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
argparse no-restart -- $argv # Add no-restart option for first menu
|
|
92
|
+
|
|
93
|
+
echo
|
|
94
|
+
if not set -q _flag_no_restart
|
|
95
|
+
set -f r r
|
|
96
|
+
echo '(r) Restart from the beginning'
|
|
97
|
+
end
|
|
98
|
+
echo '(q) Quit and do nothing'\n
|
|
99
|
+
|
|
100
|
+
while read --nchars 1 --prompt-str \
|
|
101
|
+
"$(set_color -o)Choice [$(string join '/' $_tide_symbol_list $r q)] $(set_color normal)" input
|
|
102
|
+
switch $input
|
|
103
|
+
case r
|
|
104
|
+
set -q _flag_no_restart && continue
|
|
105
|
+
set -e _tide_symbol_list
|
|
106
|
+
set -e _tide_option_list
|
|
107
|
+
_next_choice all/style
|
|
108
|
+
break
|
|
109
|
+
case q
|
|
110
|
+
_tide_exit_configure
|
|
111
|
+
set -e _tide_symbol_list
|
|
112
|
+
set -e _tide_option_list
|
|
113
|
+
command -q clear && clear
|
|
114
|
+
break
|
|
115
|
+
case $_tide_symbol_list
|
|
116
|
+
set -g _tide_selected_option $_tide_option_list[(contains -i $input $_tide_symbol_list)]
|
|
117
|
+
test "$func" != finish &&
|
|
118
|
+
set -a _tide_configure_current_options --$func=(string escape $_tide_selected_option)
|
|
119
|
+
set -e _tide_symbol_list
|
|
120
|
+
set -e _tide_option_list
|
|
121
|
+
break
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
function _tide_display_prompt
|
|
127
|
+
set -q _flag_auto && return
|
|
128
|
+
|
|
129
|
+
_fake_tide_cache_variables
|
|
130
|
+
set -l prompt (_fake_tide_prompt)
|
|
131
|
+
|
|
132
|
+
set -l bottom_left_prompt_string_length (string length --visible $prompt[-1])
|
|
133
|
+
set -l right_prompt_string (string pad --width (math $fake_columns-$bottom_left_prompt_string_length) $prompt[1])
|
|
134
|
+
set -l prompt[-1] "$prompt[-1]$right_prompt_string"
|
|
135
|
+
|
|
136
|
+
if set -q _configure_transient
|
|
137
|
+
if contains newline $fake_tide_left_prompt_items
|
|
138
|
+
string unescape $prompt[3..]
|
|
139
|
+
else
|
|
140
|
+
_fake_tide_item_character
|
|
141
|
+
echo
|
|
142
|
+
end
|
|
143
|
+
else
|
|
144
|
+
if not set -q _tide_configure_first_prompt_after_option
|
|
145
|
+
test "$fake_tide_prompt_add_newline_before" = true && echo
|
|
146
|
+
end
|
|
147
|
+
string unescape $prompt[2..]
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
set -e _tide_configure_first_prompt_after_option
|
|
151
|
+
set_color normal
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
function _tide_exit_configure
|
|
155
|
+
set -e _tide_selected_option # Skip through all switch and _next_choice
|
|
156
|
+
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Disable default vi prompt
|