diff options
author | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
---|---|---|
committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2024-04-05 11:57:45 -0400 |
commit | b88d77fb2d0d5028a6f5670695dee6bec129501f (patch) | |
tree | 2536b0461d297e647cf07157641c9b1223339adf /home-config | |
parent | 776a7ca55d2d2c3f396de91db1c6c3c5065012cd (diff) |
ahhh sloppy fish, still needs fixing, esp with the vars
Diffstat (limited to 'home-config')
106 files changed, 3405 insertions, 2 deletions
diff --git a/home-config/bashrc b/home-config/bashrc index 0c61ee6..0fbbb57 100644 --- a/home-config/bashrc +++ b/home-config/bashrc | |||
@@ -51,5 +51,5 @@ export XDG_DATA_DIRS=$XDG_DATA_DIRS:/var/lib/flatpak/exports/share:/home/ryan/.l | |||
51 | #gpgconf --launch gpg-agent | 51 | #gpgconf --launch gpg-agent |
52 | export GPG_TTY=$(tty) | 52 | export GPG_TTY=$(tty) |
53 | 53 | ||
54 | # Setup zoxide for cd command provider | 54 | # Replace process with fish |
55 | eval "$(zoxide init --cmd cd bash)" | 55 | exec fish |
diff --git a/home-config/fish/completions/fisher.fish b/home-config/fish/completions/fisher.fish new file mode 100644 index 0000000..6d23ce4 --- /dev/null +++ b/home-config/fish/completions/fisher.fish | |||
@@ -0,0 +1,7 @@ | |||
1 | complete --command fisher --exclusive --long help --description "Print help" | ||
2 | complete --command fisher --exclusive --long version --description "Print version" | ||
3 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments install --description "Install plugins" | ||
4 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments update --description "Update installed plugins" | ||
5 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments remove --description "Remove installed plugins" | ||
6 | complete --command fisher --exclusive --condition __fish_use_subcommand --arguments list --description "List installed plugins matching regex" | ||
7 | complete --command fisher --exclusive --condition "__fish_seen_subcommand_from update remove" --arguments "(fisher list)" | ||
diff --git a/home-config/fish/completions/fzf_configure_bindings.fish b/home-config/fish/completions/fzf_configure_bindings.fish new file mode 100644 index 0000000..b38ef92 --- /dev/null +++ b/home-config/fish/completions/fzf_configure_bindings.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | complete fzf_configure_bindings --no-files | ||
2 | complete fzf_configure_bindings --long help --short h --description "Print help" --condition "not __fish_seen_argument --help -h" | ||
3 | complete fzf_configure_bindings --long directory --description "Change the key binding for Search Directory" --condition "not __fish_seen_argument --directory" | ||
4 | complete fzf_configure_bindings --long git_log --description "Change the key binding for Search Git Log" --condition "not __fish_seen_argument --git_log" | ||
5 | complete fzf_configure_bindings --long git_status --description "Change the key binding for Search Git Status" --condition "not __fish_seen_argument --git_status" | ||
6 | complete fzf_configure_bindings --long history --description "Change the key binding for Search History" --condition "not __fish_seen_argument --history" | ||
7 | complete fzf_configure_bindings --long processes --description "Change the key binding for Search Processes" --condition "not __fish_seen_argument --processes" | ||
8 | complete fzf_configure_bindings --long variables --description "Change the key binding for Search Variables" --condition "not __fish_seen_argument --variables" | ||
diff --git a/home-config/fish/completions/tide.fish b/home-config/fish/completions/tide.fish new file mode 100644 index 0000000..1ba1960 --- /dev/null +++ b/home-config/fish/completions/tide.fish | |||
@@ -0,0 +1,13 @@ | |||
1 | complete tide --no-files | ||
2 | |||
3 | set -l subcommands bug-report configure reload | ||
4 | |||
5 | complete tide -x -n __fish_use_subcommand -a bug-report -d "Print info for use in bug reports" | ||
6 | complete tide -x -n __fish_use_subcommand -a configure -d "Run the configuration wizard" | ||
7 | complete tide -x -n __fish_use_subcommand -a reload -d "Reload tide configuration" | ||
8 | |||
9 | complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s h -l help -d "Print help message" | ||
10 | complete tide -x -n "not __fish_seen_subcommand_from $subcommands" -s v -l version -d "Print tide version" | ||
11 | |||
12 | complete tide -x -n '__fish_seen_subcommand_from bug-report' -l clean -d "Run clean Fish instance and install Tide" | ||
13 | complete tide -x -n '__fish_seen_subcommand_from bug-report' -l verbose -d "Print full Tide configuration" | ||
diff --git a/home-config/fish/conf.d/_tide_init.fish b/home-config/fish/conf.d/_tide_init.fish new file mode 100644 index 0000000..b448002 --- /dev/null +++ b/home-config/fish/conf.d/_tide_init.fish | |||
@@ -0,0 +1,44 @@ | |||
1 | function _tide_init_install --on-event _tide_init_install | ||
2 | set -U VIRTUAL_ENV_DISABLE_PROMPT true | ||
3 | |||
4 | source (functions --details _tide_sub_configure) | ||
5 | _load_config lean | ||
6 | _tide_finish | ||
7 | |||
8 | if status is-interactive | ||
9 | tide bug-report --check || sleep 4 | ||
10 | |||
11 | if contains ilancosman/tide (string lower $_fisher_plugins) | ||
12 | set_color bryellow | ||
13 | echo "ilancosman/tide is a development branch. Please install from a release tag:" | ||
14 | _tide_fish_colorize "fisher install ilancosman/tide@v6" | ||
15 | sleep 3 | ||
16 | end | ||
17 | |||
18 | switch (read --prompt-str="Configure tide prompt? [Y/n] " | string lower) | ||
19 | case y ye yes '' | ||
20 | tide configure | ||
21 | case '*' | ||
22 | echo -s \n 'Run ' (_tide_fish_colorize "tide configure") ' to customize your prompt.' | ||
23 | end | ||
24 | end | ||
25 | end | ||
26 | |||
27 | function _tide_init_update --on-event _tide_init_update | ||
28 | # Warn users who install from main branch | ||
29 | if contains ilancosman/tide (string lower $_fisher_plugins) | ||
30 | set_color bryellow | ||
31 | echo "ilancosman/tide is a development branch. Please install from a release tag:" | ||
32 | _tide_fish_colorize "fisher install ilancosman/tide@v6" | ||
33 | sleep 3 | ||
34 | end | ||
35 | |||
36 | # Set (disable) the new jobs variable | ||
37 | set -q tide_jobs_number_threshold || set -U tide_jobs_number_threshold 1000 | ||
38 | end | ||
39 | |||
40 | function _tide_init_uninstall --on-event _tide_init_uninstall | ||
41 | set -e VIRTUAL_ENV_DISABLE_PROMPT | ||
42 | set -e (set -U --names | string match --entire -r '^_?tide') | ||
43 | functions --erase (functions --all | string match --entire -r '^_?tide') | ||
44 | end | ||
diff --git a/home-config/fish/conf.d/fzf.fish b/home-config/fish/conf.d/fzf.fish new file mode 100644 index 0000000..8156c11 --- /dev/null +++ b/home-config/fish/conf.d/fzf.fish | |||
@@ -0,0 +1,28 @@ | |||
1 | # fzf.fish is only meant to be used in interactive mode. If not in interactive mode and not in CI, skip the config to speed up shell startup | ||
2 | if not status is-interactive && test "$CI" != true | ||
3 | exit | ||
4 | end | ||
5 | |||
6 | # Because of scoping rules, to capture the shell variables exactly as they are, we must read | ||
7 | # them before even executing _fzf_search_variables. We use psub to store the | ||
8 | # variables' info in temporary files and pass in the filenames as arguments. | ||
9 | # This variable is global so that it can be referenced by fzf_configure_bindings and in tests | ||
10 | set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' | ||
11 | |||
12 | |||
13 | # Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings | ||
14 | fzf_configure_bindings | ||
15 | |||
16 | # Doesn't erase autoloaded _fzf_* functions because they are not easily accessible once key bindings are erased | ||
17 | function _fzf_uninstall --on-event fzf_uninstall | ||
18 | _fzf_uninstall_bindings | ||
19 | |||
20 | set --erase _fzf_search_vars_command | ||
21 | functions --erase _fzf_uninstall _fzf_migration_message _fzf_uninstall_bindings fzf_configure_bindings | ||
22 | complete --erase fzf_configure_bindings | ||
23 | |||
24 | set_color cyan | ||
25 | echo "fzf.fish uninstalled." | ||
26 | echo "You may need to manually remove fzf_configure_bindings from your config.fish if you were using custom key bindings." | ||
27 | set_color normal | ||
28 | end | ||
diff --git a/home-config/fish/config.fish b/home-config/fish/config.fish new file mode 100644 index 0000000..f300cfe --- /dev/null +++ b/home-config/fish/config.fish | |||
@@ -0,0 +1,15 @@ | |||
1 | if status is-interactive | ||
2 | # Commands to run in interactive sessions can go here | ||
3 | alias quit exit | ||
4 | alias cat "bat --paging=never" | ||
5 | alias ds "sudo -E guix system -L ~/.config/guix/modules reconfigure ~/.config/guix/$(prompt_hostname).scm" | ||
6 | alias dh "guix home -L ~/.config/guix/modules reconfigure ~/.config/guix/home-config/home-configuration.scm && home-manager switch" | ||
7 | alias gc "git -C ~/.config/guix add . && git -C ~/.config/guix commit && git -C ~/.config/guix push all" | ||
8 | alias cg "git -C ~/.config/guix pull" | ||
9 | alias cgh "git -C ~/.config/guix pull stationeryh main" | ||
10 | set -gx EDITOR nvim | ||
11 | set -gax XDG_DATA_DIRS ~/.nix-profile/share | ||
12 | fish_add_path ~/.local/bin | ||
13 | fish_add_path ~/.nix-profile/bin | ||
14 | |||
15 | end | ||
diff --git a/home-config/fish/fish_plugins b/home-config/fish/fish_plugins new file mode 100644 index 0000000..09ffc2e --- /dev/null +++ b/home-config/fish/fish_plugins | |||
@@ -0,0 +1,3 @@ | |||
1 | jorgebucaran/fisher | ||
2 | ilancosman/tide@v6 | ||
3 | patrickf1/fzf.fish | ||
diff --git a/home-config/fish/fish_variables b/home-config/fish/fish_variables new file mode 100644 index 0000000..2218832 --- /dev/null +++ b/home-config/fish/fish_variables | |||
@@ -0,0 +1,198 @@ | |||
1 | # This file contains fish universal variable definitions. | ||
2 | # VERSION: 3.0 | ||
3 | SETUVAR VIRTUAL_ENV_DISABLE_PROMPT:true | ||
4 | SETUVAR __fish_initialized:3400 | ||
5 | SETUVAR _fisher_ilancosman_2F_tide_40_v6_files:\x7e/\x2econfig/fish/functions/_tide_1_line_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_2_line_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_cache_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_detect_os\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_find_and_remove\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_fish_colorize\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_aws\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_character\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_cmd_duration\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_context\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_crystal\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_direnv\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_distrobox\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_docker\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_elixir\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_gcloud\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_git\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_go\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_java\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_jobs\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_kubectl\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_nix_shell\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_node\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_os\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_php\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_private_mode\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_pulumi\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_python\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_ruby\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_rustc\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_shlvl\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_terraform\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_time\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_toolbox\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_vi_mode\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_item_zig\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_parent_dirs\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_print_item\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_pwd\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_remove_unusable_items\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_sub_bug\x2dreport\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_sub_configure\x2efish\x1e\x7e/\x2econfig/fish/functions/_tide_sub_reload\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_mode_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/fish_prompt\x2efish\x1e\x7e/\x2econfig/fish/functions/tide\x1e\x7e/\x2econfig/fish/functions/tide\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/_tide_init\x2efish\x1e\x7e/\x2econfig/fish/completions/tide\x2efish | ||
6 | SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish | ||
7 | SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish | ||
8 | SETUVAR _fisher_plugins:jorgebucaran/fisher\x1eilancosman/tide\x40v6\x1epatrickf1/fzf\x2efish | ||
9 | SETUVAR _fisher_upgraded_to_4_4:\x1d | ||
10 | SETUVAR _tide_left_items:pwd\x1egit\x1enewline\x1echaracter | ||
11 | SETUVAR _tide_prompt_22821:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a24\x3a33\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m | ||
12 | SETUVAR _tide_prompt_945:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x40PWD\x40\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b1\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\x1b\x5b37m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0mmain\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x20\x2a1\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x214\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f1\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b0\x1e\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\u276f\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2014\x3a34\x3a04\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m | ||
13 | SETUVAR _tide_right_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1enode\x1epython\x1erustc\x1ego\x1enix_shell\x1etime | ||
14 | SETUVAR fish_color_autosuggestion:brblack | ||
15 | SETUVAR fish_color_cancel:\x2dr | ||
16 | SETUVAR fish_color_command:blue | ||
17 | SETUVAR fish_color_comment:red | ||
18 | SETUVAR fish_color_cwd:green | ||
19 | SETUVAR fish_color_cwd_root:red | ||
20 | SETUVAR fish_color_end:green | ||
21 | SETUVAR fish_color_error:brred | ||
22 | SETUVAR fish_color_escape:brcyan | ||
23 | SETUVAR fish_color_history_current:\x2d\x2dbold | ||
24 | SETUVAR fish_color_host:normal | ||
25 | SETUVAR fish_color_host_remote:yellow | ||
26 | SETUVAR fish_color_normal:normal | ||
27 | SETUVAR fish_color_operator:brcyan | ||
28 | SETUVAR fish_color_param:cyan | ||
29 | SETUVAR fish_color_quote:yellow | ||
30 | SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold | ||
31 | SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack | ||
32 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack | ||
33 | SETUVAR fish_color_status:red | ||
34 | SETUVAR fish_color_user:brgreen | ||
35 | SETUVAR fish_color_valid_path:\x2d\x2dunderline | ||
36 | SETUVAR fish_greeting:\x1d | ||
37 | SETUVAR fish_key_bindings:fish_default_key_bindings | ||
38 | SETUVAR fish_pager_color_completion:normal | ||
39 | SETUVAR fish_pager_color_description:yellow\x1e\x2di | ||
40 | SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline | ||
41 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan | ||
42 | SETUVAR fish_pager_color_selected_background:\x2dr | ||
43 | SETUVAR tide_aws_bg_color:303030 | ||
44 | SETUVAR tide_aws_color:FF9900 | ||
45 | SETUVAR tide_aws_icon:\uf270 | ||
46 | SETUVAR tide_character_color:5FD700 | ||
47 | SETUVAR tide_character_color_failure:FF0000 | ||
48 | SETUVAR tide_character_icon:\u276f | ||
49 | SETUVAR tide_character_vi_icon_default:\u276e | ||
50 | SETUVAR tide_character_vi_icon_replace:\u25b6 | ||
51 | SETUVAR tide_character_vi_icon_visual:V | ||
52 | SETUVAR tide_cmd_duration_bg_color:303030 | ||
53 | SETUVAR tide_cmd_duration_color:87875F | ||
54 | SETUVAR tide_cmd_duration_decimals:0 | ||
55 | SETUVAR tide_cmd_duration_icon:\x1d | ||
56 | SETUVAR tide_cmd_duration_threshold:3000 | ||
57 | SETUVAR tide_context_always_display:false | ||
58 | SETUVAR tide_context_bg_color:303030 | ||
59 | SETUVAR tide_context_color_default:D7AF87 | ||
60 | SETUVAR tide_context_color_root:D7AF00 | ||
61 | SETUVAR tide_context_color_ssh:D7AF87 | ||
62 | SETUVAR tide_context_hostname_parts:1 | ||
63 | SETUVAR tide_crystal_bg_color:303030 | ||
64 | SETUVAR tide_crystal_color:FFFFFF | ||
65 | SETUVAR tide_crystal_icon:\ue62f | ||
66 | SETUVAR tide_direnv_bg_color:303030 | ||
67 | SETUVAR tide_direnv_bg_color_denied:303030 | ||
68 | SETUVAR tide_direnv_color:D7AF00 | ||
69 | SETUVAR tide_direnv_color_denied:FF0000 | ||
70 | SETUVAR tide_direnv_icon:\u25bc | ||
71 | SETUVAR tide_distrobox_bg_color:303030 | ||
72 | SETUVAR tide_distrobox_color:FF00FF | ||
73 | SETUVAR tide_distrobox_icon:\U000f01a7 | ||
74 | SETUVAR tide_docker_bg_color:303030 | ||
75 | SETUVAR tide_docker_color:2496ED | ||
76 | SETUVAR tide_docker_default_contexts:default\x1ecolima | ||
77 | SETUVAR tide_docker_icon:\uf308 | ||
78 | SETUVAR tide_elixir_bg_color:303030 | ||
79 | SETUVAR tide_elixir_color:4E2A8E | ||
80 | SETUVAR tide_elixir_icon:\ue62d | ||
81 | SETUVAR tide_gcloud_bg_color:303030 | ||
82 | SETUVAR tide_gcloud_color:4285F4 | ||
83 | SETUVAR tide_gcloud_icon:\U000f02ad | ||
84 | SETUVAR tide_git_bg_color:303030 | ||
85 | SETUVAR tide_git_bg_color_unstable:303030 | ||
86 | SETUVAR tide_git_bg_color_urgent:303030 | ||
87 | SETUVAR tide_git_color_branch:5FD700 | ||
88 | SETUVAR tide_git_color_conflicted:FF0000 | ||
89 | SETUVAR tide_git_color_dirty:D7AF00 | ||
90 | SETUVAR tide_git_color_operation:FF0000 | ||
91 | SETUVAR tide_git_color_staged:D7AF00 | ||
92 | SETUVAR tide_git_color_stash:5FD700 | ||
93 | SETUVAR tide_git_color_untracked:00AFFF | ||
94 | SETUVAR tide_git_color_upstream:5FD700 | ||
95 | SETUVAR tide_git_icon:\x1d | ||
96 | SETUVAR tide_git_truncation_length:24 | ||
97 | SETUVAR tide_git_truncation_strategy:\x1d | ||
98 | SETUVAR tide_go_bg_color:303030 | ||
99 | SETUVAR tide_go_color:00ACD7 | ||
100 | SETUVAR tide_go_icon:\ue627 | ||
101 | SETUVAR tide_java_bg_color:303030 | ||
102 | SETUVAR tide_java_color:ED8B00 | ||
103 | SETUVAR tide_java_icon:\ue256 | ||
104 | SETUVAR tide_jobs_bg_color:303030 | ||
105 | SETUVAR tide_jobs_color:5FAF00 | ||
106 | SETUVAR tide_jobs_icon:\uf013 | ||
107 | SETUVAR tide_jobs_number_threshold:1000 | ||
108 | SETUVAR tide_kubectl_bg_color:303030 | ||
109 | SETUVAR tide_kubectl_color:326CE5 | ||
110 | SETUVAR tide_kubectl_icon:\U000f10fe | ||
111 | SETUVAR tide_left_prompt_frame_enabled:true | ||
112 | SETUVAR tide_left_prompt_items:pwd\x1egit\x1enewline\x1echaracter | ||
113 | SETUVAR tide_left_prompt_prefix: | ||
114 | SETUVAR tide_left_prompt_separator_diff_color:\ue0b0 | ||
115 | SETUVAR tide_left_prompt_separator_same_color:\ue0b1 | ||
116 | SETUVAR tide_left_prompt_suffix:\ue0b0 | ||
117 | SETUVAR tide_nix_shell_bg_color:303030 | ||
118 | SETUVAR tide_nix_shell_color:7EBAE4 | ||
119 | SETUVAR tide_nix_shell_icon:\uf313 | ||
120 | SETUVAR tide_node_bg_color:303030 | ||
121 | SETUVAR tide_node_color:44883E | ||
122 | SETUVAR tide_node_icon:\ue24f | ||
123 | SETUVAR tide_os_bg_color:303030 | ||
124 | SETUVAR tide_os_color:EEEEEE | ||
125 | SETUVAR tide_os_icon:\uf17c | ||
126 | SETUVAR tide_php_bg_color:303030 | ||
127 | SETUVAR tide_php_color:617CBE | ||
128 | SETUVAR tide_php_icon:\ue608 | ||
129 | SETUVAR tide_private_mode_bg_color:303030 | ||
130 | SETUVAR tide_private_mode_color:FFFFFF | ||
131 | SETUVAR tide_private_mode_icon:\U000f05f9 | ||
132 | SETUVAR tide_prompt_add_newline_before:false | ||
133 | SETUVAR tide_prompt_color_frame_and_connection:6C6C6C | ||
134 | SETUVAR tide_prompt_color_separator_same_color:949494 | ||
135 | SETUVAR tide_prompt_icon_connection:\x20 | ||
136 | SETUVAR tide_prompt_min_cols:34 | ||
137 | SETUVAR tide_prompt_pad_items:true | ||
138 | SETUVAR tide_prompt_transient_enabled:true | ||
139 | SETUVAR tide_pulumi_bg_color:303030 | ||
140 | SETUVAR tide_pulumi_color:F7BF2A | ||
141 | SETUVAR tide_pulumi_icon:\uf1b2 | ||
142 | SETUVAR tide_pwd_bg_color:303030 | ||
143 | SETUVAR tide_pwd_color_anchors:00AFFF | ||
144 | SETUVAR tide_pwd_color_dirs:0087AF | ||
145 | SETUVAR tide_pwd_color_truncated_dirs:8787AF | ||
146 | SETUVAR tide_pwd_icon:\x1d | ||
147 | SETUVAR tide_pwd_icon_home:\x1d | ||
148 | SETUVAR tide_pwd_icon_unwritable:\uf023 | ||
149 | SETUVAR tide_pwd_markers:\x2ebzr\x1e\x2ecitc\x1e\x2egit\x1e\x2ehg\x1e\x2enode\x2dversion\x1e\x2epython\x2dversion\x1e\x2eruby\x2dversion\x1e\x2eshorten_folder_marker\x1e\x2esvn\x1e\x2eterraform\x1eCargo\x2etoml\x1ecomposer\x2ejson\x1eCVS\x1ego\x2emod\x1epackage\x2ejson\x1ebuild\x2ezig | ||
150 | SETUVAR tide_python_bg_color:303030 | ||
151 | SETUVAR tide_python_color:00AFAF | ||
152 | SETUVAR tide_python_icon:\U000f0320 | ||
153 | SETUVAR tide_right_prompt_frame_enabled:false | ||
154 | SETUVAR tide_right_prompt_items:status\x1ecmd_duration\x1econtext\x1ejobs\x1edirenv\x1enode\x1epython\x1erustc\x1ejava\x1ephp\x1epulumi\x1eruby\x1ego\x1egcloud\x1ekubectl\x1edistrobox\x1etoolbox\x1eterraform\x1eaws\x1enix_shell\x1ecrystal\x1eelixir\x1ezig\x1etime | ||
155 | SETUVAR tide_right_prompt_prefix:\ue0b2 | ||
156 | SETUVAR tide_right_prompt_separator_diff_color:\ue0b2 | ||
157 | SETUVAR tide_right_prompt_separator_same_color:\ue0b3 | ||
158 | SETUVAR tide_right_prompt_suffix: | ||
159 | SETUVAR tide_ruby_bg_color:303030 | ||
160 | SETUVAR tide_ruby_color:B31209 | ||
161 | SETUVAR tide_ruby_icon:\ue23e | ||
162 | SETUVAR tide_rustc_bg_color:303030 | ||
163 | SETUVAR tide_rustc_color:F74C00 | ||
164 | SETUVAR tide_rustc_icon:\ue7a8 | ||
165 | SETUVAR tide_shlvl_bg_color:303030 | ||
166 | SETUVAR tide_shlvl_color:d78700 | ||
167 | SETUVAR tide_shlvl_icon:\uf120 | ||
168 | SETUVAR tide_shlvl_threshold:1 | ||
169 | SETUVAR tide_status_bg_color:303030 | ||
170 | SETUVAR tide_status_bg_color_failure:303030 | ||
171 | SETUVAR tide_status_color:5FAF00 | ||
172 | SETUVAR tide_status_color_failure:D70000 | ||
173 | SETUVAR tide_status_icon:\u2714 | ||
174 | SETUVAR tide_status_icon_failure:\u2718 | ||
175 | SETUVAR tide_terraform_bg_color:303030 | ||
176 | SETUVAR tide_terraform_color:844FBA | ||
177 | SETUVAR tide_terraform_icon:\U000f1062 | ||
178 | SETUVAR tide_time_bg_color:303030 | ||
179 | SETUVAR tide_time_color:5F8787 | ||
180 | SETUVAR tide_time_format:\x25T | ||
181 | SETUVAR tide_toolbox_bg_color:303030 | ||
182 | SETUVAR tide_toolbox_color:613583 | ||
183 | SETUVAR tide_toolbox_icon:\ue24f | ||
184 | SETUVAR tide_vi_mode_bg_color_default:303030 | ||
185 | SETUVAR tide_vi_mode_bg_color_insert:303030 | ||
186 | SETUVAR tide_vi_mode_bg_color_replace:303030 | ||
187 | SETUVAR tide_vi_mode_bg_color_visual:303030 | ||
188 | SETUVAR tide_vi_mode_color_default:949494 | ||
189 | SETUVAR tide_vi_mode_color_insert:87AFAF | ||
190 | SETUVAR tide_vi_mode_color_replace:87AF87 | ||
191 | SETUVAR tide_vi_mode_color_visual:FF8700 | ||
192 | SETUVAR tide_vi_mode_icon_default:D | ||
193 | SETUVAR tide_vi_mode_icon_insert:I | ||
194 | SETUVAR tide_vi_mode_icon_replace:R | ||
195 | SETUVAR tide_vi_mode_icon_visual:V | ||
196 | SETUVAR tide_zig_bg_color:303030 | ||
197 | SETUVAR tide_zig_color:F7A41D | ||
198 | SETUVAR tide_zig_icon:\ue6a9 | ||
diff --git a/home-config/fish/functions/_fzf_configure_bindings_help.fish b/home-config/fish/functions/_fzf_configure_bindings_help.fish new file mode 100644 index 0000000..ecfe68e --- /dev/null +++ b/home-config/fish/functions/_fzf_configure_bindings_help.fish | |||
@@ -0,0 +1,43 @@ | |||
1 | function _fzf_configure_bindings_help --description "Prints the help message for fzf_configure_bindings." | ||
2 | echo "\ | ||
3 | USAGE: | ||
4 | fzf_configure_bindings [--COMMAND=[KEY_SEQUENCE]...] | ||
5 | |||
6 | DESCRIPTION | ||
7 | fzf_configure_bindings installs key bindings for fzf.fish's commands and erases any bindings it | ||
8 | previously installed. It installs bindings for both default and insert modes. fzf.fish executes | ||
9 | it without options on fish startup to install the out-of-the-box key bindings. | ||
10 | |||
11 | By default, commands are bound to a mnemonic key sequence, shown below. Each command's binding | ||
12 | can be configured using a namesake corresponding option: | ||
13 | COMMAND | DEFAULT KEY SEQUENCE | CORRESPONDING OPTION | ||
14 | Search Directory | Ctrl+Alt+F (F for file) | --directory | ||
15 | Search Git Log | Ctrl+Alt+L (L for log) | --git_log | ||
16 | Search Git Status | Ctrl+Alt+S (S for status) | --git_status | ||
17 | Search History | Ctrl+R (R for reverse) | --history | ||
18 | Search Processes | Ctrl+Alt+P (P for process) | --processes | ||
19 | Search Variables | Ctrl+V (V for variable) | --variables | ||
20 | Override a command's binding by specifying its corresponding option with the desired key | ||
21 | sequence. Disable a command's binding by specifying its corresponding option with no value. | ||
22 | |||
23 | Because fzf_configure_bindings erases bindings it previously installed, it can be cleanly | ||
24 | executed multiple times. Once the desired fzf_configure_bindings command has been found, add it | ||
25 | to your config.fish in order to persist the customized bindings. | ||
26 | |||
27 | In terms of validation, fzf_configure_bindings fails if passed unknown options. It expects an | ||
28 | equals sign between an option's name and value. However, it does not validate key sequences. | ||
29 | |||
30 | Pass -h or --help to print this help message and exit. | ||
31 | |||
32 | EXAMPLES | ||
33 | Default bindings but bind Search Directory to Ctrl+F and Search Variables to Ctrl+Alt+V | ||
34 | \$ fzf_configure_bindings --directory=\cf --variables=\e\cv | ||
35 | Default bindings but disable Search History | ||
36 | \$ fzf_configure_bindings --history= | ||
37 | An agglomeration of different options | ||
38 | \$ fzf_configure_bindings --git_status=\cg --history=\ch --variables= --processes= | ||
39 | |||
40 | SEE Also | ||
41 | To learn more about fish key bindings, see bind(1) and fish_key_reader(1). | ||
42 | " | ||
43 | end | ||
diff --git a/home-config/fish/functions/_fzf_extract_var_info.fish b/home-config/fish/functions/_fzf_extract_var_info.fish new file mode 100644 index 0000000..dd4e952 --- /dev/null +++ b/home-config/fish/functions/_fzf_extract_var_info.fish | |||
@@ -0,0 +1,15 @@ | |||
1 | # helper function for _fzf_search_variables | ||
2 | function _fzf_extract_var_info --argument-names variable_name set_show_output --description "Extract and reformat lines pertaining to \$variable_name from \$set_show_output." | ||
3 | # Extract only the lines about the variable, all of which begin with either | ||
4 | # $variable_name: ...or... $variable_name[ | ||
5 | string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output | | ||
6 | |||
7 | # Strip the variable name prefix, including ": " for scope info lines | ||
8 | string replace --regex "^\\\$$variable_name(?:: )?" '' | | ||
9 | |||
10 | # Distill the lines of values, replacing... | ||
11 | # [1]: |value| | ||
12 | # ...with... | ||
13 | # [1] value | ||
14 | string replace --regex ": \|(.*)\|" ' $1' | ||
15 | end | ||
diff --git a/home-config/fish/functions/_fzf_preview_changed_file.fish b/home-config/fish/functions/_fzf_preview_changed_file.fish new file mode 100644 index 0000000..78dd561 --- /dev/null +++ b/home-config/fish/functions/_fzf_preview_changed_file.fish | |||
@@ -0,0 +1,49 @@ | |||
1 | # helper for _fzf_search_git_status | ||
2 | # arg should be a line from git status --short, e.g. | ||
3 | # MM functions/_fzf_preview_changed_file.fish | ||
4 | # D README.md | ||
5 | # R LICENSE -> "New License" | ||
6 | function _fzf_preview_changed_file --argument-names path_status --description "Show the git diff of the given file." | ||
7 | # remove quotes because they'll be interpreted literally by git diff | ||
8 | # no need to requote when referencing $path because fish does not perform word splitting | ||
9 | # https://fishshell.com/docs/current/fish_for_bash_users.html | ||
10 | set -f path (string unescape (string sub --start 4 $path_status)) | ||
11 | # first letter of short format shows index, second letter shows working tree | ||
12 | # https://git-scm.com/docs/git-status/2.35.0#_short_format | ||
13 | set -f index_status (string sub --length 1 $path_status) | ||
14 | set -f working_tree_status (string sub --start 2 --length 1 $path_status) | ||
15 | |||
16 | set -f diff_opts --color=always | ||
17 | |||
18 | if test $index_status = '?' | ||
19 | _fzf_report_diff_type Untracked | ||
20 | _fzf_preview_file $path | ||
21 | else if contains {$index_status}$working_tree_status DD AU UD UA DU AA UU | ||
22 | # Unmerged statuses taken directly from git status help's short format table | ||
23 | # Unmerged statuses are mutually exclusive with other statuses, so if we see | ||
24 | # these, then safe to assume the path is unmerged | ||
25 | _fzf_report_diff_type Unmerged | ||
26 | git diff $diff_opts -- $path | ||
27 | else | ||
28 | if test $index_status != ' ' | ||
29 | _fzf_report_diff_type Staged | ||
30 | |||
31 | # renames are only detected in the index, never working tree, so only need to test for it here | ||
32 | # https://stackoverflow.com/questions/73954214 | ||
33 | if test $index_status = R | ||
34 | # diff the post-rename path with the original path, otherwise the diff will show the entire file as being added | ||
35 | set -f orig_and_new_path (string split --max 1 -- ' -> ' $path) | ||
36 | git diff --staged $diff_opts -- $orig_and_new_path[1] $orig_and_new_path[2] | ||
37 | # path currently has the form of "original -> current", so we need to correct it before it's used below | ||
38 | set path $orig_and_new_path[2] | ||
39 | else | ||
40 | git diff --staged $diff_opts -- $path | ||
41 | end | ||
42 | end | ||
43 | |||
44 | if test $working_tree_status != ' ' | ||
45 | _fzf_report_diff_type Unstaged | ||
46 | git diff $diff_opts -- $path | ||
47 | end | ||
48 | end | ||
49 | end | ||
diff --git a/home-config/fish/functions/_fzf_preview_file.fish b/home-config/fish/functions/_fzf_preview_file.fish new file mode 100644 index 0000000..c926475 --- /dev/null +++ b/home-config/fish/functions/_fzf_preview_file.fish | |||
@@ -0,0 +1,43 @@ | |||
1 | # helper function for _fzf_search_directory and _fzf_search_git_status | ||
2 | function _fzf_preview_file --description "Print a preview for the given file based on its file type." | ||
3 | # because there's no way to guarantee that _fzf_search_directory passes the path to _fzf_preview_file | ||
4 | # as one argument, we collect all the arguments into one single variable and treat that as the path | ||
5 | set -f file_path $argv | ||
6 | |||
7 | if test -L "$file_path" # symlink | ||
8 | # notify user and recurse on the target of the symlink, which can be any of these file types | ||
9 | set -l target_path (realpath "$file_path") | ||
10 | |||
11 | set_color yellow | ||
12 | echo "'$file_path' is a symlink to '$target_path'." | ||
13 | set_color normal | ||
14 | |||
15 | _fzf_preview_file "$target_path" | ||
16 | else if test -f "$file_path" # regular file | ||
17 | if set --query fzf_preview_file_cmd | ||
18 | # need to escape quotes to make sure eval receives file_path as a single arg | ||
19 | eval "$fzf_preview_file_cmd '$file_path'" | ||
20 | else | ||
21 | bat --style=numbers --color=always "$file_path" | ||
22 | end | ||
23 | else if test -d "$file_path" # directory | ||
24 | if set --query fzf_preview_dir_cmd | ||
25 | # see above | ||
26 | eval "$fzf_preview_dir_cmd '$file_path'" | ||
27 | else | ||
28 | # -A list hidden files as well, except for . and .. | ||
29 | # -F helps classify files by appending symbols after the file name | ||
30 | command ls -A -F "$file_path" | ||
31 | end | ||
32 | else if test -c "$file_path" | ||
33 | _fzf_report_file_type "$file_path" "character device file" | ||
34 | else if test -b "$file_path" | ||
35 | _fzf_report_file_type "$file_path" "block device file" | ||
36 | else if test -S "$file_path" | ||
37 | _fzf_report_file_type "$file_path" socket | ||
38 | else if test -p "$file_path" | ||
39 | _fzf_report_file_type "$file_path" "named pipe" | ||
40 | else | ||
41 | echo "$file_path doesn't exist." >&2 | ||
42 | end | ||
43 | end | ||
diff --git a/home-config/fish/functions/_fzf_report_diff_type.fish b/home-config/fish/functions/_fzf_report_diff_type.fish new file mode 100644 index 0000000..cc26fb3 --- /dev/null +++ b/home-config/fish/functions/_fzf_report_diff_type.fish | |||
@@ -0,0 +1,18 @@ | |||
1 | # helper for _fzf_preview_changed_file | ||
2 | # prints out something like | ||
3 | # ╭────────╮ | ||
4 | # │ Staged │ | ||
5 | # ╰────────╯ | ||
6 | function _fzf_report_diff_type --argument-names diff_type --description "Print a distinct colored header meant to preface a git patch." | ||
7 | # number of "-" to draw is the length of the string to box + 2 for padding | ||
8 | set -f repeat_count (math 2 + (string length $diff_type)) | ||
9 | set -f line (string repeat --count $repeat_count ─) | ||
10 | set -f top_border ╭$line╮ | ||
11 | set -f btm_border ╰$line╯ | ||
12 | |||
13 | set_color yellow | ||
14 | echo $top_border | ||
15 | echo "│ $diff_type │" | ||
16 | echo $btm_border | ||
17 | set_color normal | ||
18 | end | ||
diff --git a/home-config/fish/functions/_fzf_report_file_type.fish b/home-config/fish/functions/_fzf_report_file_type.fish new file mode 100644 index 0000000..49e02e1 --- /dev/null +++ b/home-config/fish/functions/_fzf_report_file_type.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | # helper function for _fzf_preview_file | ||
2 | function _fzf_report_file_type --argument-names file_path file_type --description "Explain the file type for a file." | ||
3 | set_color red | ||
4 | echo "Cannot preview '$file_path': it is a $file_type." | ||
5 | set_color normal | ||
6 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_directory.fish b/home-config/fish/functions/_fzf_search_directory.fish new file mode 100644 index 0000000..4541eec --- /dev/null +++ b/home-config/fish/functions/_fzf_search_directory.fish | |||
@@ -0,0 +1,33 @@ | |||
1 | function _fzf_search_directory --description "Search the current directory. Replace the current token with the selected file paths." | ||
2 | # Directly use fd binary to avoid output buffering delay caused by a fd alias, if any. | ||
3 | # Debian-based distros install fd as fdfind and the fd package is something else, so | ||
4 | # check for fdfind first. Fall back to "fd" for a clear error message. | ||
5 | set -f fd_cmd (command -v fdfind || command -v fd || echo "fd") | ||
6 | set -f --append fd_cmd --color=always $fzf_fd_opts | ||
7 | |||
8 | set -f fzf_arguments --multi --ansi $fzf_directory_opts | ||
9 | set -f token (commandline --current-token) | ||
10 | # expand any variables or leading tilde (~) in the token | ||
11 | set -f expanded_token (eval echo -- $token) | ||
12 | # unescape token because it's already quoted so backslashes will mess up the path | ||
13 | set -f unescaped_exp_token (string unescape -- $expanded_token) | ||
14 | |||
15 | # If the current token is a directory and has a trailing slash, | ||
16 | # then use it as fd's base directory. | ||
17 | if string match --quiet -- "*/" $unescaped_exp_token && test -d "$unescaped_exp_token" | ||
18 | set --append fd_cmd --base-directory=$unescaped_exp_token | ||
19 | # use the directory name as fzf's prompt to indicate the search is limited to that directory | ||
20 | set --prepend fzf_arguments --prompt="Directory $unescaped_exp_token> " --preview="_fzf_preview_file $expanded_token{}" | ||
21 | set -f file_paths_selected $unescaped_exp_token($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) | ||
22 | else | ||
23 | set --prepend fzf_arguments --prompt="Directory> " --query="$unescaped_exp_token" --preview='_fzf_preview_file {}' | ||
24 | set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) | ||
25 | end | ||
26 | |||
27 | |||
28 | if test $status -eq 0 | ||
29 | commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ') | ||
30 | end | ||
31 | |||
32 | commandline --function repaint | ||
33 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_git_log.fish b/home-config/fish/functions/_fzf_search_git_log.fish new file mode 100644 index 0000000..aa54724 --- /dev/null +++ b/home-config/fish/functions/_fzf_search_git_log.fish | |||
@@ -0,0 +1,36 @@ | |||
1 | function _fzf_search_git_log --description "Search the output of git log and preview commits. Replace the current token with the selected commit hash." | ||
2 | if not git rev-parse --git-dir >/dev/null 2>&1 | ||
3 | echo '_fzf_search_git_log: Not in a git repository.' >&2 | ||
4 | else | ||
5 | if not set --query fzf_git_log_format | ||
6 | # %h gives you the abbreviated commit hash, which is useful for saving screen space, but we will have to expand it later below | ||
7 | set -f fzf_git_log_format '%C(bold blue)%h%C(reset) - %C(cyan)%ad%C(reset) %C(yellow)%d%C(reset) %C(normal)%s%C(reset) %C(dim normal)[%an]%C(reset)' | ||
8 | end | ||
9 | |||
10 | set -f preview_cmd 'git show --color=always --stat --patch {1}' | ||
11 | if set --query fzf_diff_highlighter | ||
12 | set preview_cmd "$preview_cmd | $fzf_diff_highlighter" | ||
13 | end | ||
14 | |||
15 | set -f selected_log_lines ( | ||
16 | git log --no-show-signature --color=always --format=format:$fzf_git_log_format --date=short | \ | ||
17 | _fzf_wrapper --ansi \ | ||
18 | --multi \ | ||
19 | --scheme=history \ | ||
20 | --prompt="Git Log> " \ | ||
21 | --preview=$preview_cmd \ | ||
22 | --query=(commandline --current-token) \ | ||
23 | $fzf_git_log_opts | ||
24 | ) | ||
25 | if test $status -eq 0 | ||
26 | for line in $selected_log_lines | ||
27 | set -f abbreviated_commit_hash (string split --field 1 " " $line) | ||
28 | set -f full_commit_hash (git rev-parse $abbreviated_commit_hash) | ||
29 | set -f --append commit_hashes $full_commit_hash | ||
30 | end | ||
31 | commandline --current-token --replace (string join ' ' $commit_hashes) | ||
32 | end | ||
33 | end | ||
34 | |||
35 | commandline --function repaint | ||
36 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_git_status.fish b/home-config/fish/functions/_fzf_search_git_status.fish new file mode 100644 index 0000000..358f88c --- /dev/null +++ b/home-config/fish/functions/_fzf_search_git_status.fish | |||
@@ -0,0 +1,41 @@ | |||
1 | function _fzf_search_git_status --description "Search the output of git status. Replace the current token with the selected file paths." | ||
2 | if not git rev-parse --git-dir >/dev/null 2>&1 | ||
3 | echo '_fzf_search_git_status: Not in a git repository.' >&2 | ||
4 | else | ||
5 | set -f preview_cmd '_fzf_preview_changed_file {}' | ||
6 | if set --query fzf_diff_highlighter | ||
7 | set preview_cmd "$preview_cmd | $fzf_diff_highlighter" | ||
8 | end | ||
9 | |||
10 | set -f selected_paths ( | ||
11 | # Pass configuration color.status=always to force status to use colors even though output is sent to a pipe | ||
12 | git -c color.status=always status --short | | ||
13 | _fzf_wrapper --ansi \ | ||
14 | --multi \ | ||
15 | --prompt="Git Status> " \ | ||
16 | --query=(commandline --current-token) \ | ||
17 | --preview=$preview_cmd \ | ||
18 | --nth="2.." \ | ||
19 | $fzf_git_status_opts | ||
20 | ) | ||
21 | if test $status -eq 0 | ||
22 | # git status --short automatically escapes the paths of most files for us so not going to bother trying to handle | ||
23 | # the few edges cases of weird file names that should be extremely rare (e.g. "this;needs;escaping") | ||
24 | set -f cleaned_paths | ||
25 | |||
26 | for path in $selected_paths | ||
27 | if test (string sub --length 1 $path) = R | ||
28 | # path has been renamed and looks like "R LICENSE -> LICENSE.md" | ||
29 | # extract the path to use from after the arrow | ||
30 | set --append cleaned_paths (string split -- "-> " $path)[-1] | ||
31 | else | ||
32 | set --append cleaned_paths (string sub --start=4 $path) | ||
33 | end | ||
34 | end | ||
35 | |||
36 | commandline --current-token --replace -- (string join ' ' $cleaned_paths) | ||
37 | end | ||
38 | end | ||
39 | |||
40 | commandline --function repaint | ||
41 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_history.fish b/home-config/fish/functions/_fzf_search_history.fish new file mode 100644 index 0000000..cafbce9 --- /dev/null +++ b/home-config/fish/functions/_fzf_search_history.fish | |||
@@ -0,0 +1,39 @@ | |||
1 | function _fzf_search_history --description "Search command history. Replace the command line with the selected command." | ||
2 | # history merge incorporates history changes from other fish sessions | ||
3 | # it errors out if called in private mode | ||
4 | if test -z "$fish_private_mode" | ||
5 | builtin history merge | ||
6 | end | ||
7 | |||
8 | if not set --query fzf_history_time_format | ||
9 | # Reference https://devhints.io/strftime to understand strftime format symbols | ||
10 | set -f fzf_history_time_format "%m-%d %H:%M:%S" | ||
11 | end | ||
12 | |||
13 | # Delinate time from command in history entries using the vertical box drawing char (U+2502). | ||
14 | # Then, to get raw command from history entries, delete everything up to it. The ? on regex is | ||
15 | # necessary to make regex non-greedy so it won't match into commands containing the char. | ||
16 | set -f time_prefix_regex '^.*? │ ' | ||
17 | # Delinate commands throughout pipeline using null rather than newlines because commands can be multi-line | ||
18 | set -f commands_selected ( | ||
19 | builtin history --null --show-time="$fzf_history_time_format │ " | | ||
20 | _fzf_wrapper --read0 \ | ||
21 | --print0 \ | ||
22 | --multi \ | ||
23 | --scheme=history \ | ||
24 | --prompt="History> " \ | ||
25 | --query=(commandline) \ | ||
26 | --preview="string replace --regex '$time_prefix_regex' '' -- {} | fish_indent --ansi" \ | ||
27 | --preview-window="bottom:3:wrap" \ | ||
28 | $fzf_history_opts | | ||
29 | string split0 | | ||
30 | # remove timestamps from commands selected | ||
31 | string replace --regex $time_prefix_regex '' | ||
32 | ) | ||
33 | |||
34 | if test $status -eq 0 | ||
35 | commandline --replace -- $commands_selected | ||
36 | end | ||
37 | |||
38 | commandline --function repaint | ||
39 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_processes.fish b/home-config/fish/functions/_fzf_search_processes.fish new file mode 100644 index 0000000..133a880 --- /dev/null +++ b/home-config/fish/functions/_fzf_search_processes.fish | |||
@@ -0,0 +1,32 @@ | |||
1 | function _fzf_search_processes --description "Search all running processes. Replace the current token with the pid of the selected process." | ||
2 | # Directly use ps command because it is often aliased to a different command entirely | ||
3 | # or with options that dirty the search results and preview output | ||
4 | set -f ps_cmd (command -v ps || echo "ps") | ||
5 | # use all caps to be consistent with ps default format | ||
6 | # snake_case because ps doesn't seem to allow spaces in the field names | ||
7 | set -f ps_preview_fmt (string join ',' 'pid' 'ppid=PARENT' 'user' '%cpu' 'rss=RSS_IN_KB' 'start=START_TIME' 'command') | ||
8 | set -f processes_selected ( | ||
9 | $ps_cmd -A -opid,command | \ | ||
10 | _fzf_wrapper --multi \ | ||
11 | --prompt="Processes> " \ | ||
12 | --query (commandline --current-token) \ | ||
13 | --ansi \ | ||
14 | # first line outputted by ps is a header, so we need to mark it as so | ||
15 | --header-lines=1 \ | ||
16 | # ps uses exit code 1 if the process was not found, in which case show an message explaining so | ||
17 | --preview="$ps_cmd -o '$ps_preview_fmt' -p {1} || echo 'Cannot preview {1} because it exited.'" \ | ||
18 | --preview-window="bottom:4:wrap" \ | ||
19 | $fzf_processes_opts | ||
20 | ) | ||
21 | |||
22 | if test $status -eq 0 | ||
23 | for process in $processes_selected | ||
24 | set -f --append pids_selected (string split --no-empty --field=1 -- " " $process) | ||
25 | end | ||
26 | |||
27 | # string join to replace the newlines outputted by string split with spaces | ||
28 | commandline --current-token --replace -- (string join ' ' $pids_selected) | ||
29 | end | ||
30 | |||
31 | commandline --function repaint | ||
32 | end | ||
diff --git a/home-config/fish/functions/_fzf_search_variables.fish b/home-config/fish/functions/_fzf_search_variables.fish new file mode 100644 index 0000000..52a7c70 --- /dev/null +++ b/home-config/fish/functions/_fzf_search_variables.fish | |||
@@ -0,0 +1,47 @@ | |||
1 | # This function expects the following two arguments: | ||
2 | # argument 1 = output of (set --show | psub), i.e. a file with the scope info and values of all variables | ||
3 | # argument 2 = output of (set --names | psub), i.e. a file with all variable names | ||
4 | function _fzf_search_variables --argument-names set_show_output set_names_output --description "Search and preview shell variables. Replace the current token with the selected variable." | ||
5 | if test -z "$set_names_output" | ||
6 | printf '%s\n' '_fzf_search_variables requires 2 arguments.' >&2 | ||
7 | |||
8 | commandline --function repaint | ||
9 | return 22 # 22 means invalid argument in POSIX | ||
10 | end | ||
11 | |||
12 | # Exclude the history variable from being piped into fzf because | ||
13 | # 1. it's not included in $set_names_output | ||
14 | # 2. it tends to be a very large value => increases computation time | ||
15 | # 3._fzf_search_history is a much better way to examine history anyway | ||
16 | set -f all_variable_names (string match --invert history <$set_names_output) | ||
17 | |||
18 | set -f current_token (commandline --current-token) | ||
19 | # Use the current token to pre-populate fzf's query. If the current token begins | ||
20 | # with a $, remove it from the query so that it will better match the variable names | ||
21 | set -f cleaned_curr_token (string replace -- '$' '' $current_token) | ||
22 | |||
23 | set -f variable_names_selected ( | ||
24 | printf '%s\n' $all_variable_names | | ||
25 | _fzf_wrapper --preview "_fzf_extract_var_info {} $set_show_output" \ | ||
26 | --prompt="Variables> " \ | ||
27 | --preview-window="wrap" \ | ||
28 | --multi \ | ||
29 | --query=$cleaned_curr_token \ | ||
30 | $fzf_variables_opts | ||
31 | ) | ||
32 | |||
33 | if test $status -eq 0 | ||
34 | # If the current token begins with a $, do not overwrite the $ when | ||
35 | # replacing the current token with the selected variable. | ||
36 | # Uses brace expansion to prepend $ to each variable name. | ||
37 | commandline --current-token --replace ( | ||
38 | if string match --quiet -- '$*' $current_token | ||
39 | string join " " \${$variable_names_selected} | ||
40 | else | ||
41 | string join " " $variable_names_selected | ||
42 | end | ||
43 | ) | ||
44 | end | ||
45 | |||
46 | commandline --function repaint | ||
47 | end | ||
diff --git a/home-config/fish/functions/_fzf_wrapper.fish b/home-config/fish/functions/_fzf_wrapper.fish new file mode 100644 index 0000000..45556ce --- /dev/null +++ b/home-config/fish/functions/_fzf_wrapper.fish | |||
@@ -0,0 +1,20 @@ | |||
1 | function _fzf_wrapper --description "Prepares some environment variables before executing fzf." | ||
2 | # Make sure fzf uses fish to execute preview commands, some of which | ||
3 | # are autoloaded fish functions so don't exist in other shells. | ||
4 | # Use --function so that it doesn't clobber SHELL outside this function. | ||
5 | set -f --export SHELL (command --search fish) | ||
6 | |||
7 | # If FZF_DEFAULT_OPTS is not set, then set some sane defaults. | ||
8 | # See https://github.com/junegunn/fzf#environment-variables | ||
9 | if not set --query FZF_DEFAULT_OPTS | ||
10 | # cycle allows jumping between the first and last results, making scrolling faster | ||
11 | # layout=reverse lists results top to bottom, mimicking the familiar layouts of git log, history, and env | ||
12 | # border shows where the fzf window begins and ends | ||
13 | # height=90% leaves space to see the current command and some scrollback, maintaining context of work | ||
14 | # preview-window=wrap wraps long lines in the preview window, making reading easier | ||
15 | # marker=* makes the multi-select marker more distinguishable from the pointer (since both default to >) | ||
16 | set --export FZF_DEFAULT_OPTS '--cycle --layout=reverse --border --height=90% --preview-window=wrap --marker="*"' | ||
17 | end | ||
18 | |||
19 | fzf $argv | ||
20 | end | ||
diff --git a/home-config/fish/functions/_tide_1_line_prompt.fish b/home-config/fish/functions/_tide_1_line_prompt.fish new file mode 100644 index 0000000..5772223 --- /dev/null +++ b/home-config/fish/functions/_tide_1_line_prompt.fish | |||
@@ -0,0 +1,19 @@ | |||
1 | function _tide_1_line_prompt | ||
2 | set -g add_prefix | ||
3 | _tide_side=left for item in $_tide_left_items | ||
4 | _tide_item_$item | ||
5 | end | ||
6 | set_color $prev_bg_color -b normal | ||
7 | echo $tide_left_prompt_suffix | ||
8 | |||
9 | set -g add_prefix | ||
10 | _tide_side=right for item in $_tide_right_items | ||
11 | _tide_item_$item | ||
12 | end | ||
13 | set_color $prev_bg_color -b normal | ||
14 | echo $tide_right_prompt_suffix | ||
15 | end | ||
16 | |||
17 | function _tide_item_pwd | ||
18 | _tide_print_item pwd @PWD@ | ||
19 | end | ||
diff --git a/home-config/fish/functions/_tide_2_line_prompt.fish b/home-config/fish/functions/_tide_2_line_prompt.fish new file mode 100644 index 0000000..e9017af --- /dev/null +++ b/home-config/fish/functions/_tide_2_line_prompt.fish | |||
@@ -0,0 +1,31 @@ | |||
1 | function _tide_2_line_prompt | ||
2 | set -g add_prefix | ||
3 | _tide_side=left for item in $_tide_left_items | ||
4 | _tide_item_$item | ||
5 | end | ||
6 | if not set -e add_prefix | ||
7 | set_color $prev_bg_color -b normal | ||
8 | echo $tide_left_prompt_suffix | ||
9 | end | ||
10 | |||
11 | echo | ||
12 | |||
13 | set -g add_prefix | ||
14 | _tide_side=right for item in $_tide_right_items | ||
15 | _tide_item_$item | ||
16 | end | ||
17 | if not set -e add_prefix | ||
18 | set_color $prev_bg_color -b normal | ||
19 | echo $tide_right_prompt_suffix | ||
20 | end | ||
21 | end | ||
22 | |||
23 | function _tide_item_pwd | ||
24 | _tide_print_item pwd @PWD@ | ||
25 | end | ||
26 | |||
27 | function _tide_item_newline | ||
28 | set_color $prev_bg_color -b normal | ||
29 | v=tide_"$_tide_side"_prompt_suffix echo $$v | ||
30 | set -g add_prefix | ||
31 | end | ||
diff --git a/home-config/fish/functions/_tide_cache_variables.fish b/home-config/fish/functions/_tide_cache_variables.fish new file mode 100644 index 0000000..31e3850 --- /dev/null +++ b/home-config/fish/functions/_tide_cache_variables.fish | |||
@@ -0,0 +1,17 @@ | |||
1 | function _tide_cache_variables | ||
2 | # Same-color-separator color | ||
3 | set_color $tide_prompt_color_separator_same_color | read -gx _tide_color_separator_same_color | ||
4 | |||
5 | # git | ||
6 | contains git $_tide_left_items $_tide_right_items && set_color $tide_git_color_branch | read -gx _tide_location_color | ||
7 | |||
8 | # private_mode | ||
9 | if contains private_mode $_tide_left_items $_tide_right_items && test -n "$fish_private_mode" | ||
10 | set -gx _tide_private_mode | ||
11 | else | ||
12 | set -e _tide_private_mode | ||
13 | end | ||
14 | |||
15 | # item padding | ||
16 | test "$tide_prompt_pad_items" = true && set -gx _tide_pad ' ' || set -e _tide_pad | ||
17 | end | ||
diff --git a/home-config/fish/functions/_tide_detect_os.fish b/home-config/fish/functions/_tide_detect_os.fish new file mode 100644 index 0000000..cf38388 --- /dev/null +++ b/home-config/fish/functions/_tide_detect_os.fish | |||
@@ -0,0 +1,77 @@ | |||
1 | # Outputs icon, color, bg_color | ||
2 | function _tide_detect_os | ||
3 | set -lx defaultColor 080808 CED7CF | ||
4 | switch (uname | string lower) | ||
5 | case darwin | ||
6 | printf %s\n D6D6D6 333333 # from apple.com header | ||
7 | case freebsd openbsd dragonfly | ||
8 | printf %s\n FFFFFF AB2B28 # https://freebsdfoundation.org/about-us/about-the-foundation/project/ | ||
9 | case 'cygwin*' 'mingw*_nt*' 'msys_nt*' | ||
10 | printf %s\n FFFFFF 00CCFF # https://answers.microsoft.com/en-us/windows/forum/all/what-is-the-official-windows-8-blue-rgb-or-hex/fd57144b-f69b-42d8-8c21-6ca911646e44 | ||
11 | case linux | ||
12 | if test (uname -o) = Android | ||
13 | echo ﲎ # This character is evil and messes up code display, so it's put on its own line | ||
14 | # https://developer.android.com/distribute/marketing-tools/brand-guidelines | ||
15 | printf %s\n 3DDC84 3C3F41 # fg is from above link, bg is from Android Studio default dark theme | ||
16 | else | ||
17 | _tide_detect_os_linux_cases /etc/os-release ID || | ||
18 | _tide_detect_os_linux_cases /etc/os-release ID_LIKE || | ||
19 | _tide_detect_os_linux_cases /etc/lsb-release DISTRIB_ID || | ||
20 | printf %s\n $defaultColor | ||
21 | end | ||
22 | case '*' | ||
23 | echo -ns '?' | ||
24 | end | ||
25 | end | ||
26 | |||
27 | function _tide_detect_os_linux_cases -a file key | ||
28 | test -e $file || return | ||
29 | set -l split_file (string split '=' <$file) | ||
30 | set -l key_index (contains --index $key $split_file) || return | ||
31 | set -l value (string trim --chars='"' $split_file[(math $key_index + 1)]) | ||
32 | |||
33 | # Anything which would have pure white background has been changed to D4D4D4 | ||
34 | # It was just too bright otherwise | ||
35 | switch (string lower $value) | ||
36 | case alpine | ||
37 | printf %s\n FFFFFF 0D597F # from alpine logo | ||
38 | case arch | ||
39 | printf %s\n 1793D1 4D4D4D # from arch wiki header | ||
40 | case centos | ||
41 | printf %s\n 000000 D4D4D4 # https://wiki.centos.org/ArtWork/Brand/Logo, monochromatic | ||
42 | case debian | ||
43 | printf %s\n C70036 D4D4D4 # from debian logo https://www.debian.org/logos/openlogo-nd-100.png | ||
44 | case devuan | ||
45 | printf %s\n $defaultColor # logo is monochromatic | ||
46 | case elementary | ||
47 | printf %s\n 000000 D4D4D4 # https://elementary.io/brand, encouraged to be monochromatic | ||
48 | case fedora | ||
49 | printf %s\n FFFFFF 294172 # from logo https://fedoraproject.org/w/uploads/2/2d/Logo_fedoralogo.png | ||
50 | case gentoo | ||
51 | printf %s\n FFFFFF 54487A # https://wiki.gentoo.org/wiki/Project:Artwork/Colors | ||
52 | case mageia | ||
53 | printf %s\n FFFFFF 262F45 # https://wiki.mageia.org/en/Artwork_guidelines | ||
54 | case manjaro | ||
55 | printf %s\n FFFFFF 35BF5C # from https://gitlab.manjaro.org/artwork/branding/logo/-/blob/master/logo.svg | ||
56 | case mint linuxmint | ||
57 | printf %s\n FFFFFF 69B53F # extracted from https://linuxmint.com/web/img/favicon.ico | ||
58 | case nixos | ||
59 | printf %s\n FFFFFF 5277C3 # https://github.com/NixOS/nixos-artwork/tree/master/logo | ||
60 | case opensuse-leap opensuse-tumbleweed opensuse-microos | ||
61 | printf %s\n 73BA25 173f4f # https://en.opensuse.org/openSUSE:Artwork_brand | ||
62 | case raspbian | ||
63 | printf %s\n FFFFFF A22846 # https://static.raspberrypi.org/files/Raspberry_Pi_Visual_Guidelines_2020.pdf | ||
64 | case rhel | ||
65 | printf %s\n EE0000 000000 # https://www.redhat.com/en/about/brand/standards/color | ||
66 | case sabayon | ||
67 | printf %s\n $defaultColor # Can't find colors, and they are rebranding anyway | ||
68 | case slackware | ||
69 | printf %s\n $defaultColor # Doesn't really have a logo, and the colors are too close to PWD blue anyway | ||
70 | case ubuntu | ||
71 | printf %s\n E95420 D4D4D4 # https://design.ubuntu.com/brand/ | ||
72 | case void | ||
73 | printf %s\n FFFFFF 478061 # from https://alpha.de.repo.voidlinux.org/logos/void.svg | ||
74 | case '*' | ||
75 | return 1 | ||
76 | end | ||
77 | end | ||
diff --git a/home-config/fish/functions/_tide_find_and_remove.fish b/home-config/fish/functions/_tide_find_and_remove.fish new file mode 100644 index 0000000..29f2180 --- /dev/null +++ b/home-config/fish/functions/_tide_find_and_remove.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_find_and_remove -a name list --no-scope-shadowing | ||
2 | contains --index $name $$list | read -l index && set -e "$list"[$index] | ||
3 | end | ||
diff --git a/home-config/fish/functions/_tide_fish_colorize.fish b/home-config/fish/functions/_tide_fish_colorize.fish new file mode 100644 index 0000000..f79b188 --- /dev/null +++ b/home-config/fish/functions/_tide_fish_colorize.fish | |||
@@ -0,0 +1,7 @@ | |||
1 | function _tide_fish_colorize | ||
2 | if command -q fish_indent | ||
3 | echo -ns "$argv" | fish_indent --ansi | ||
4 | else | ||
5 | echo -ns "$argv" | ||
6 | end | ||
7 | end | ||
diff --git a/home-config/fish/functions/_tide_item_aws.fish b/home-config/fish/functions/_tide_item_aws.fish new file mode 100644 index 0000000..7cb6338 --- /dev/null +++ b/home-config/fish/functions/_tide_item_aws.fish | |||
@@ -0,0 +1,11 @@ | |||
1 | function _tide_item_aws | ||
2 | # AWS_PROFILE overrides AWS_DEFAULT_PROFILE, AWS_REGION overrides AWS_DEFAULT_REGION | ||
3 | set -q AWS_PROFILE && set -l AWS_DEFAULT_PROFILE $AWS_PROFILE | ||
4 | set -q AWS_REGION && set -l AWS_DEFAULT_REGION $AWS_REGION | ||
5 | |||
6 | if test -n "$AWS_DEFAULT_PROFILE" && test -n "$AWS_DEFAULT_REGION" | ||
7 | _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE/$AWS_DEFAULT_REGION" | ||
8 | else if test -n "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION" | ||
9 | _tide_print_item aws $tide_aws_icon' ' "$AWS_DEFAULT_PROFILE$AWS_DEFAULT_REGION" | ||
10 | end | ||
11 | end | ||
diff --git a/home-config/fish/functions/_tide_item_character.fish b/home-config/fish/functions/_tide_item_character.fish new file mode 100644 index 0000000..10bb324 --- /dev/null +++ b/home-config/fish/functions/_tide_item_character.fish | |||
@@ -0,0 +1,17 @@ | |||
1 | function _tide_item_character | ||
2 | test $_tide_status = 0 && set_color $tide_character_color || set_color $tide_character_color_failure | ||
3 | |||
4 | set -q add_prefix || echo -ns ' ' | ||
5 | |||
6 | test "$fish_key_bindings" = fish_default_key_bindings && echo -ns $tide_character_icon || | ||
7 | switch $fish_bind_mode | ||
8 | case insert | ||
9 | echo -ns $tide_character_icon | ||
10 | case default | ||
11 | echo -ns $tide_character_vi_icon_default | ||
12 | case replace replace_one | ||
13 | echo -ns $tide_character_vi_icon_replace | ||
14 | case visual | ||
15 | echo -ns $tide_character_vi_icon_visual | ||
16 | end | ||
17 | end | ||
diff --git a/home-config/fish/functions/_tide_item_cmd_duration.fish b/home-config/fish/functions/_tide_item_cmd_duration.fish new file mode 100644 index 0000000..bc48bac --- /dev/null +++ b/home-config/fish/functions/_tide_item_cmd_duration.fish | |||
@@ -0,0 +1,12 @@ | |||
1 | function _tide_item_cmd_duration | ||
2 | test $CMD_DURATION -gt $tide_cmd_duration_threshold && t=( | ||
3 | math -s0 "$CMD_DURATION/3600000" # Hours | ||
4 | math -s0 "$CMD_DURATION/60000"%60 # Minutes | ||
5 | math -s$tide_cmd_duration_decimals "$CMD_DURATION/1000"%60) if test $t[1] != 0 | ||
6 | _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[1]h $t[2]m $t[3]s" | ||
7 | else if test $t[2] != 0 | ||
8 | _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[2]m $t[3]s" | ||
9 | else | ||
10 | _tide_print_item cmd_duration $tide_cmd_duration_icon' ' "$t[3]s" | ||
11 | end | ||
12 | end | ||
diff --git a/home-config/fish/functions/_tide_item_context.fish b/home-config/fish/functions/_tide_item_context.fish new file mode 100644 index 0000000..cbdf420 --- /dev/null +++ b/home-config/fish/functions/_tide_item_context.fish | |||
@@ -0,0 +1,14 @@ | |||
1 | function _tide_item_context | ||
2 | if set -q SSH_TTY | ||
3 | set -fx tide_context_color $tide_context_color_ssh | ||
4 | else if test "$EUID" = 0 | ||
5 | set -fx tide_context_color $tide_context_color_root | ||
6 | else if test "$tide_context_always_display" = true | ||
7 | set -fx tide_context_color $tide_context_color_default | ||
8 | else | ||
9 | return | ||
10 | end | ||
11 | |||
12 | string match -qr "^(?<h>(\.?[^\.]*){0,$tide_context_hostname_parts})" @$hostname | ||
13 | _tide_print_item context $USER$h | ||
14 | end | ||
diff --git a/home-config/fish/functions/_tide_item_crystal.fish b/home-config/fish/functions/_tide_item_crystal.fish new file mode 100644 index 0000000..620dde4 --- /dev/null +++ b/home-config/fish/functions/_tide_item_crystal.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_crystal | ||
2 | if path is $_tide_parent_dirs/shard.yml | ||
3 | crystal --version | string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item crystal $tide_crystal_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_direnv.fish b/home-config/fish/functions/_tide_item_direnv.fish new file mode 100644 index 0000000..f3c892b --- /dev/null +++ b/home-config/fish/functions/_tide_item_direnv.fish | |||
@@ -0,0 +1,7 @@ | |||
1 | function _tide_item_direnv | ||
2 | set -q DIRENV_DIR || return | ||
3 | direnv status | string match -q 'Found RC allowed false' && | ||
4 | set -lx tide_direnv_color $tide_direnv_color_denied && | ||
5 | set -lx tide_direnv_bg_color $tide_direnv_bg_color_denied | ||
6 | _tide_print_item direnv $tide_direnv_icon | ||
7 | end | ||
diff --git a/home-config/fish/functions/_tide_item_distrobox.fish b/home-config/fish/functions/_tide_item_distrobox.fish new file mode 100644 index 0000000..5e06a8b --- /dev/null +++ b/home-config/fish/functions/_tide_item_distrobox.fish | |||
@@ -0,0 +1,4 @@ | |||
1 | function _tide_item_distrobox | ||
2 | test -e /etc/profile.d/distrobox_profile.sh && test -e /run/.containerenv && | ||
3 | _tide_print_item distrobox $tide_distrobox_icon' ' (string match -rg 'name="(.*)"' </run/.containerenv) | ||
4 | end | ||
diff --git a/home-config/fish/functions/_tide_item_docker.fish b/home-config/fish/functions/_tide_item_docker.fish new file mode 100644 index 0000000..4eec0bf --- /dev/null +++ b/home-config/fish/functions/_tide_item_docker.fish | |||
@@ -0,0 +1,5 @@ | |||
1 | function _tide_item_docker | ||
2 | docker context inspect --format '{{.Name}}' | read -l context | ||
3 | contains -- "$context" $tide_docker_default_contexts || | ||
4 | _tide_print_item docker $tide_docker_icon' ' $context | ||
5 | end | ||
diff --git a/home-config/fish/functions/_tide_item_elixir.fish b/home-config/fish/functions/_tide_item_elixir.fish new file mode 100644 index 0000000..fa9d36a --- /dev/null +++ b/home-config/fish/functions/_tide_item_elixir.fish | |||
@@ -0,0 +1,4 @@ | |||
1 | function _tide_item_elixir | ||
2 | path is $_tide_parent_dirs/mix.exs && | ||
3 | _tide_print_item elixir $tide_elixir_icon' ' (elixir --short-version) | ||
4 | end | ||
diff --git a/home-config/fish/functions/_tide_item_gcloud.fish b/home-config/fish/functions/_tide_item_gcloud.fish new file mode 100644 index 0000000..609783a --- /dev/null +++ b/home-config/fish/functions/_tide_item_gcloud.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | function _tide_item_gcloud | ||
2 | set -q CLOUDSDK_CONFIG || set -l CLOUDSDK_CONFIG ~/.config/gcloud | ||
3 | path is $CLOUDSDK_CONFIG/active_config && | ||
4 | read -l config <$CLOUDSDK_CONFIG/active_config && | ||
5 | path is $CLOUDSDK_CONFIG/configurations/config_$config && | ||
6 | string match -qr '^\s*project\s*=\s*(?<project>.*)' <$CLOUDSDK_CONFIG/configurations/config_$config && | ||
7 | _tide_print_item gcloud $tide_gcloud_icon' ' $project | ||
8 | end | ||
diff --git a/home-config/fish/functions/_tide_item_git.fish b/home-config/fish/functions/_tide_item_git.fish new file mode 100644 index 0000000..3154acc --- /dev/null +++ b/home-config/fish/functions/_tide_item_git.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_item_go.fish b/home-config/fish/functions/_tide_item_go.fish new file mode 100644 index 0000000..b9aacae --- /dev/null +++ b/home-config/fish/functions/_tide_item_go.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_go | ||
2 | if path is $_tide_parent_dirs/go.mod | ||
3 | go version | string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item go $tide_go_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_java.fish b/home-config/fish/functions/_tide_item_java.fish new file mode 100644 index 0000000..804ec05 --- /dev/null +++ b/home-config/fish/functions/_tide_item_java.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_java | ||
2 | if path is $_tide_parent_dirs/pom.xml | ||
3 | java -version &| string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item java $tide_java_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_jobs.fish b/home-config/fish/functions/_tide_item_jobs.fish new file mode 100644 index 0000000..2a02118 --- /dev/null +++ b/home-config/fish/functions/_tide_item_jobs.fish | |||
@@ -0,0 +1,7 @@ | |||
1 | function _tide_item_jobs | ||
2 | set -q _tide_jobs && if test $_tide_jobs -ge $tide_jobs_number_threshold | ||
3 | _tide_print_item jobs $tide_jobs_icon' ' $_tide_jobs | ||
4 | else | ||
5 | _tide_print_item jobs $tide_jobs_icon | ||
6 | end | ||
7 | end | ||
diff --git a/home-config/fish/functions/_tide_item_kubectl.fish b/home-config/fish/functions/_tide_item_kubectl.fish new file mode 100644 index 0000000..ab044b3 --- /dev/null +++ b/home-config/fish/functions/_tide_item_kubectl.fish | |||
@@ -0,0 +1,4 @@ | |||
1 | function _tide_item_kubectl | ||
2 | kubectl config view --minify --output 'jsonpath={.current-context}/{..namespace}' 2>/dev/null | read -l context && | ||
3 | _tide_print_item kubectl $tide_kubectl_icon' ' (string replace -r '/(|default)$' '' $context) | ||
4 | end | ||
diff --git a/home-config/fish/functions/_tide_item_nix_shell.fish b/home-config/fish/functions/_tide_item_nix_shell.fish new file mode 100644 index 0000000..647f606 --- /dev/null +++ b/home-config/fish/functions/_tide_item_nix_shell.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_item_nix_shell | ||
2 | set -q IN_NIX_SHELL && _tide_print_item nix_shell $tide_nix_shell_icon' ' $IN_NIX_SHELL | ||
3 | end | ||
diff --git a/home-config/fish/functions/_tide_item_node.fish b/home-config/fish/functions/_tide_item_node.fish new file mode 100644 index 0000000..fc57832 --- /dev/null +++ b/home-config/fish/functions/_tide_item_node.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_node | ||
2 | if path is $_tide_parent_dirs/package.json | ||
3 | node --version | string match -qr "v(?<v>.*)" | ||
4 | _tide_print_item node $tide_node_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_os.fish b/home-config/fish/functions/_tide_item_os.fish new file mode 100644 index 0000000..8a6208c --- /dev/null +++ b/home-config/fish/functions/_tide_item_os.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_item_os | ||
2 | _tide_print_item os $tide_os_icon | ||
3 | end | ||
diff --git a/home-config/fish/functions/_tide_item_php.fish b/home-config/fish/functions/_tide_item_php.fish new file mode 100644 index 0000000..c8d28d9 --- /dev/null +++ b/home-config/fish/functions/_tide_item_php.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_php | ||
2 | if path is $_tide_parent_dirs/composer.json | ||
3 | php --version | string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item php $tide_php_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_private_mode.fish b/home-config/fish/functions/_tide_item_private_mode.fish new file mode 100644 index 0000000..4eb4684 --- /dev/null +++ b/home-config/fish/functions/_tide_item_private_mode.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_item_private_mode | ||
2 | set -q _tide_private_mode && _tide_print_item private_mode $tide_private_mode_icon | ||
3 | end | ||
diff --git a/home-config/fish/functions/_tide_item_pulumi.fish b/home-config/fish/functions/_tide_item_pulumi.fish new file mode 100644 index 0000000..6302a7e --- /dev/null +++ b/home-config/fish/functions/_tide_item_pulumi.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_item_python.fish b/home-config/fish/functions/_tide_item_python.fish new file mode 100644 index 0000000..57f7075 --- /dev/null +++ b/home-config/fish/functions/_tide_item_python.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_item_ruby.fish b/home-config/fish/functions/_tide_item_ruby.fish new file mode 100644 index 0000000..bde84eb --- /dev/null +++ b/home-config/fish/functions/_tide_item_ruby.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_ruby | ||
2 | if path is $_tide_parent_dirs/{*.gemspec,Gemfile,Rakefile,.ruby-version} | ||
3 | ruby --version | string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item ruby $tide_ruby_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_rustc.fish b/home-config/fish/functions/_tide_item_rustc.fish new file mode 100644 index 0000000..b46cd99 --- /dev/null +++ b/home-config/fish/functions/_tide_item_rustc.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_rustc | ||
2 | if path is $_tide_parent_dirs/Cargo.toml | ||
3 | rustc --version | string match -qr "(?<v>[\d.]+)" | ||
4 | _tide_print_item rustc $tide_rustc_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_item_shlvl.fish b/home-config/fish/functions/_tide_item_shlvl.fish new file mode 100644 index 0000000..95dd5ff --- /dev/null +++ b/home-config/fish/functions/_tide_item_shlvl.fish | |||
@@ -0,0 +1,4 @@ | |||
1 | function _tide_item_shlvl | ||
2 | # Non-interactive shells do not increment SHLVL, so we don't need to subtract 1 | ||
3 | test $SHLVL -gt $tide_shlvl_threshold && _tide_print_item shlvl $tide_shlvl_icon' ' $SHLVL | ||
4 | end | ||
diff --git a/home-config/fish/functions/_tide_item_status.fish b/home-config/fish/functions/_tide_item_status.fish new file mode 100644 index 0000000..3a040fd --- /dev/null +++ b/home-config/fish/functions/_tide_item_status.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_item_terraform.fish b/home-config/fish/functions/_tide_item_terraform.fish new file mode 100644 index 0000000..c079ce3 --- /dev/null +++ b/home-config/fish/functions/_tide_item_terraform.fish | |||
@@ -0,0 +1,5 @@ | |||
1 | function _tide_item_terraform | ||
2 | path is $_tide_parent_dirs/.terraform && | ||
3 | terraform workspace show | string match -v default | read -l w && | ||
4 | _tide_print_item terraform $tide_terraform_icon' ' $w | ||
5 | end | ||
diff --git a/home-config/fish/functions/_tide_item_time.fish b/home-config/fish/functions/_tide_item_time.fish new file mode 100644 index 0000000..b8522bc --- /dev/null +++ b/home-config/fish/functions/_tide_item_time.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_item_time | ||
2 | _tide_print_item time (date +$tide_time_format) | ||
3 | end | ||
diff --git a/home-config/fish/functions/_tide_item_toolbox.fish b/home-config/fish/functions/_tide_item_toolbox.fish new file mode 100644 index 0000000..0b33f29 --- /dev/null +++ b/home-config/fish/functions/_tide_item_toolbox.fish | |||
@@ -0,0 +1,4 @@ | |||
1 | function _tide_item_toolbox | ||
2 | test -e /run/.toolboxenv && | ||
3 | _tide_print_item toolbox $tide_toolbox_icon' ' (string match -rg 'name="(.*)"' </run/.containerenv) | ||
4 | end | ||
diff --git a/home-config/fish/functions/_tide_item_vi_mode.fish b/home-config/fish/functions/_tide_item_vi_mode.fish new file mode 100644 index 0000000..582855d --- /dev/null +++ b/home-config/fish/functions/_tide_item_vi_mode.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_item_zig.fish b/home-config/fish/functions/_tide_item_zig.fish new file mode 100644 index 0000000..2ac2741 --- /dev/null +++ b/home-config/fish/functions/_tide_item_zig.fish | |||
@@ -0,0 +1,6 @@ | |||
1 | function _tide_item_zig | ||
2 | if path is $_tide_parent_dirs/build.zig | ||
3 | zig version | string match -qr "(?<v>[\d.]+(-dev)?)" | ||
4 | _tide_print_item zig $tide_zig_icon' ' $v | ||
5 | end | ||
6 | end | ||
diff --git a/home-config/fish/functions/_tide_parent_dirs.fish b/home-config/fish/functions/_tide_parent_dirs.fish new file mode 100644 index 0000000..9f31b04 --- /dev/null +++ b/home-config/fish/functions/_tide_parent_dirs.fish | |||
@@ -0,0 +1,7 @@ | |||
1 | function _tide_parent_dirs --on-variable PWD | ||
2 | set -g _tide_parent_dirs (string escape ( | ||
3 | for dir in (string split / -- $PWD) | ||
4 | set -la parts $dir | ||
5 | string join / -- $parts | ||
6 | end)) | ||
7 | end | ||
diff --git a/home-config/fish/functions/_tide_print_item.fish b/home-config/fish/functions/_tide_print_item.fish new file mode 100644 index 0000000..db5c98b --- /dev/null +++ b/home-config/fish/functions/_tide_print_item.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_pwd.fish b/home-config/fish/functions/_tide_pwd.fish new file mode 100644 index 0000000..5447dd4 --- /dev/null +++ b/home-config/fish/functions/_tide_pwd.fish | |||
@@ -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" | ||
diff --git a/home-config/fish/functions/_tide_remove_unusable_items.fish b/home-config/fish/functions/_tide_remove_unusable_items.fish new file mode 100644 index 0000000..deb4c10 --- /dev/null +++ b/home-config/fish/functions/_tide_remove_unusable_items.fish | |||
@@ -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 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 | ||
diff --git a/home-config/fish/functions/_tide_sub_bug-report.fish b/home-config/fish/functions/_tide_sub_bug-report.fish new file mode 100644 index 0000000..a8065c8 --- /dev/null +++ b/home-config/fish/functions/_tide_sub_bug-report.fish | |||
@@ -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 | set -l fish_version ($fish_path --version | string match -r "fish, version (\d\.\d\.\d)")[2] | ||
15 | _tide_check_version Fish fish-shell/fish-shell "(\d\.\d\.\d)" $fish_version || return | ||
16 | |||
17 | set -l tide_version (tide --version | string match -r "tide, version (\d\.\d\.\d)")[2] | ||
18 | _tide_check_version Tide IlanCosman/tide "v(\d\.\d\.\d)" $tide_version || return | ||
19 | |||
20 | if command --query git | ||
21 | test (git --version | string match -r "git version ([\d\.]*)" | string replace --all . '')[2] -gt 2220 | ||
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 | set -l fish_startup_time ($fish_path -ic "time $fish_path -c exit" 2>| | ||
36 | string match -r "Executed in(.*)fish" | string trim)[2] | ||
37 | |||
38 | read --local --prompt-str "What operating system are you using? (e.g Ubuntu 20.04): " os | ||
39 | read --local --prompt-str "What terminal emulator are you using? (e.g Kitty): " terminal_emulator | ||
40 | |||
41 | printf '%b\n' "\nPlease copy the following information into the issue:\n" \ | ||
42 | "fish version: $fish_version" \ | ||
43 | "tide version: $tide_version" \ | ||
44 | "term: $TERM" \ | ||
45 | "os: $os" \ | ||
46 | "terminal emulator: $terminal_emulator" \ | ||
47 | "fish startup: $fish_startup_time" \ | ||
48 | "fisher plugins: $_fisher_plugins" | ||
49 | end | ||
50 | end | ||
51 | end | ||
52 | |||
53 | function _tide_check_version -a program_name repo_name regex_to_get_version current_version | ||
54 | curl --silent https://github.com/$repo_name/releases/latest | | ||
55 | string match -r ".*$repo_name/releases/tag/$regex_to_get_version.*" | | ||
56 | read --local --line __ latestVersion | ||
57 | |||
58 | string match --quiet -r "^$latestVersion" "$current_version" | ||
59 | _tide_check_condition \ | ||
60 | "Your $program_name version is out of date." \ | ||
61 | "The latest is $latestVersion. You have $current_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 | ||
diff --git a/home-config/fish/functions/_tide_sub_configure.fish b/home-config/fish/functions/_tide_sub_configure.fish new file mode 100644 index 0000000..22faf3a --- /dev/null +++ b/home-config/fish/functions/_tide_sub_configure.fish | |||
@@ -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 | ||
diff --git a/home-config/fish/functions/_tide_sub_reload.fish b/home-config/fish/functions/_tide_sub_reload.fish new file mode 100644 index 0000000..5a45fbd --- /dev/null +++ b/home-config/fish/functions/_tide_sub_reload.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _tide_sub_reload | ||
2 | source (functions --details fish_prompt) | ||
3 | end | ||
diff --git a/home-config/fish/functions/fish_mode_prompt.fish b/home-config/fish/functions/fish_mode_prompt.fish new file mode 100644 index 0000000..f37cf7d --- /dev/null +++ b/home-config/fish/functions/fish_mode_prompt.fish | |||
@@ -0,0 +1 @@ | |||
# Disable default vi prompt | |||
diff --git a/home-config/fish/functions/fish_prompt.fish b/home-config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..3b58b7b --- /dev/null +++ b/home-config/fish/functions/fish_prompt.fish | |||
@@ -0,0 +1,171 @@ | |||
1 | function fish_prompt | ||
2 | end # In case this file gets loaded non-interactively, e.g by conda | ||
3 | status is-interactive || exit | ||
4 | |||
5 | _tide_remove_unusable_items | ||
6 | _tide_cache_variables | ||
7 | _tide_parent_dirs | ||
8 | source (functions --details _tide_pwd) | ||
9 | |||
10 | set -l prompt_var _tide_prompt_$fish_pid | ||
11 | set -U $prompt_var # Set var here so if we erase $prompt_var, bg job won't set a uvar | ||
12 | |||
13 | set_color normal | read -l color_normal | ||
14 | status fish-path | read -l fish_path | ||
15 | |||
16 | # _tide_repaint prevents us from creating a second background job | ||
17 | function _tide_refresh_prompt --on-variable $prompt_var --on-variable COLUMNS | ||
18 | set -g _tide_repaint | ||
19 | commandline -f repaint | ||
20 | end | ||
21 | |||
22 | if contains newline $_tide_left_items # two line prompt initialization | ||
23 | test "$tide_prompt_add_newline_before" = true && set -l add_newline '\n' | ||
24 | |||
25 | set_color $tide_prompt_color_frame_and_connection -b normal | read -l prompt_and_frame_color | ||
26 | |||
27 | set -l column_offset 5 | ||
28 | test "$tide_left_prompt_frame_enabled" = true && | ||
29 | set -l top_left_frame "$prompt_and_frame_color╭─" && | ||
30 | set -l bot_left_frame "$prompt_and_frame_color╰─" && | ||
31 | set column_offset (math $column_offset-2) | ||
32 | test "$tide_right_prompt_frame_enabled" = true && | ||
33 | set -l top_right_frame "$prompt_and_frame_color─╮" && | ||
34 | set -l bot_right_frame "$prompt_and_frame_color─╯" && | ||
35 | set column_offset (math $column_offset-2) | ||
36 | |||
37 | if test "$tide_prompt_transient_enabled" = true | ||
38 | eval " | ||
39 | function fish_prompt | ||
40 | _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint | ||
41 | jobs -q && jobs -p | count | read -lx _tide_jobs | ||
42 | $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus | ||
43 | set _tide_parent_dirs \$_tide_parent_dirs | ||
44 | PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" & | ||
45 | builtin disown | ||
46 | |||
47 | command kill \$_tide_last_pid 2>/dev/null | ||
48 | set -g _tide_last_pid \$last_pid | ||
49 | end | ||
50 | |||
51 | if not set -q _tide_transient | ||
52 | math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][3]\")+$column_offset | read -lx dist_btwn_sides | ||
53 | |||
54 | echo -n $add_newline'$top_left_frame'(string replace @PWD@ (_tide_pwd) \"\$$prompt_var[1][1]\")'$prompt_and_frame_color' | ||
55 | string repeat -Nm(math max 0, \$dist_btwn_sides-\$_tide_pwd_len) '$tide_prompt_icon_connection' | ||
56 | |||
57 | echo \"\$$prompt_var[1][3]$top_right_frame\" | ||
58 | end | ||
59 | echo -n \e\[0J\"$bot_left_frame\$$prompt_var[1][2]$color_normal \" | ||
60 | end | ||
61 | |||
62 | function fish_right_prompt | ||
63 | set -e _tide_transient || string unescape \"\$$prompt_var[1][4]$bot_right_frame$color_normal\" | ||
64 | end" | ||
65 | else | ||
66 | eval " | ||
67 | function fish_prompt | ||
68 | _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint | ||
69 | jobs -q && jobs -p | count | read -lx _tide_jobs | ||
70 | $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus | ||
71 | set _tide_parent_dirs \$_tide_parent_dirs | ||
72 | PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_2_line_prompt)\" & | ||
73 | builtin disown | ||
74 | |||
75 | command kill \$_tide_last_pid 2>/dev/null | ||
76 | set -g _tide_last_pid \$last_pid | ||
77 | end | ||
78 | |||
79 | math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][3]\")+$column_offset | read -lx dist_btwn_sides | ||
80 | |||
81 | echo -ns $add_newline'$top_left_frame'(string replace @PWD@ (_tide_pwd) \"\$$prompt_var[1][1]\")'$prompt_and_frame_color' | ||
82 | string repeat -Nm(math max 0, \$dist_btwn_sides-\$_tide_pwd_len) '$tide_prompt_icon_connection' | ||
83 | echo -ns \"\$$prompt_var[1][3]$top_right_frame\"\n\"$bot_left_frame\$$prompt_var[1][2]$color_normal \" | ||
84 | end | ||
85 | |||
86 | function fish_right_prompt | ||
87 | string unescape \"\$$prompt_var[1][4]$bot_right_frame$color_normal\" | ||
88 | end" | ||
89 | end | ||
90 | else # one line prompt initialization | ||
91 | test "$tide_prompt_add_newline_before" = true && set -l add_newline '\0' | ||
92 | |||
93 | math 5 -$tide_prompt_min_cols | read -l column_offset | ||
94 | test $column_offset -ge 0 && set column_offset "+$column_offset" | ||
95 | |||
96 | if test "$tide_prompt_transient_enabled" = true | ||
97 | eval " | ||
98 | function fish_prompt | ||
99 | set -lx _tide_status \$status | ||
100 | _tide_pipestatus=\$pipestatus if not set -e _tide_repaint | ||
101 | jobs -q && jobs -p | count | read -lx _tide_jobs | ||
102 | $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus | ||
103 | set _tide_parent_dirs \$_tide_parent_dirs | ||
104 | PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" & | ||
105 | builtin disown | ||
106 | |||
107 | command kill \$_tide_last_pid 2>/dev/null | ||
108 | set -g _tide_last_pid \$last_pid | ||
109 | end | ||
110 | |||
111 | if set -q _tide_transient | ||
112 | echo -n \e\[0J | ||
113 | add_prefix= _tide_item_character | ||
114 | echo -n '$color_normal ' | ||
115 | else | ||
116 | math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][2]\")$column_offset | read -lx dist_btwn_sides | ||
117 | string replace @PWD@ (_tide_pwd) $add_newline \$$prompt_var[1][1]'$color_normal ' | ||
118 | end | ||
119 | end | ||
120 | |||
121 | function fish_right_prompt | ||
122 | set -e _tide_transient || string unescape \"\$$prompt_var[1][2]$color_normal\" | ||
123 | end" | ||
124 | else | ||
125 | eval " | ||
126 | function fish_prompt | ||
127 | _tide_status=\$status _tide_pipestatus=\$pipestatus if not set -e _tide_repaint | ||
128 | jobs -q && jobs -p | count | read -lx _tide_jobs | ||
129 | $fish_path -c \"set _tide_pipestatus \$_tide_pipestatus | ||
130 | set _tide_parent_dirs \$_tide_parent_dirs | ||
131 | PATH=\$(string escape \"\$PATH\") CMD_DURATION=\$CMD_DURATION fish_bind_mode=\$fish_bind_mode set $prompt_var (_tide_1_line_prompt)\" & | ||
132 | builtin disown | ||
133 | |||
134 | command kill \$_tide_last_pid 2>/dev/null | ||
135 | set -g _tide_last_pid \$last_pid | ||
136 | end | ||
137 | |||
138 | math \$COLUMNS-(string length -V \"\$$prompt_var[1][1]\$$prompt_var[1][2]\")$column_offset | read -lx dist_btwn_sides | ||
139 | string replace @PWD@ (_tide_pwd) $add_newline \$$prompt_var[1][1]'$color_normal ' | ||
140 | end | ||
141 | |||
142 | function fish_right_prompt | ||
143 | string unescape \"\$$prompt_var[1][2]$color_normal\" | ||
144 | end" | ||
145 | end | ||
146 | end | ||
147 | |||
148 | eval "function _tide_on_fish_exit --on-event fish_exit | ||
149 | set -e $prompt_var | ||
150 | end" | ||
151 | |||
152 | if test "$tide_prompt_transient_enabled" = true | ||
153 | function _tide_enter_transient | ||
154 | # If the commandline will be executed, or is empty | ||
155 | if commandline --is-valid || test -z "$(commandline)" | ||
156 | # Pager open usually means selecting, not running | ||
157 | # Can be untrue, but it's better than the alternative | ||
158 | if not commandline --paging-mode | ||
159 | set -g _tide_transient | ||
160 | set -g _tide_repaint | ||
161 | commandline -f repaint | ||
162 | end | ||
163 | end | ||
164 | commandline -f execute | ||
165 | end | ||
166 | |||
167 | bind \r _tide_enter_transient | ||
168 | bind \n _tide_enter_transient | ||
169 | bind -M insert \r _tide_enter_transient | ||
170 | bind -M insert \n _tide_enter_transient | ||
171 | end | ||
diff --git a/home-config/fish/functions/fisher.fish b/home-config/fish/functions/fisher.fish new file mode 100644 index 0000000..b1513d3 --- /dev/null +++ b/home-config/fish/functions/fisher.fish | |||
@@ -0,0 +1,240 @@ | |||
1 | function fisher --argument-names cmd --description "A plugin manager for Fish" | ||
2 | set --query fisher_path || set --local fisher_path $__fish_config_dir | ||
3 | set --local fisher_version 4.4.4 | ||
4 | set --local fish_plugins $__fish_config_dir/fish_plugins | ||
5 | |||
6 | switch "$cmd" | ||
7 | case -v --version | ||
8 | echo "fisher, version $fisher_version" | ||
9 | case "" -h --help | ||
10 | echo "Usage: fisher install <plugins...> Install plugins" | ||
11 | echo " fisher remove <plugins...> Remove installed plugins" | ||
12 | echo " fisher update <plugins...> Update installed plugins" | ||
13 | echo " fisher update Update all installed plugins" | ||
14 | echo " fisher list [<regex>] List installed plugins matching regex" | ||
15 | echo "Options:" | ||
16 | echo " -v, --version Print version" | ||
17 | echo " -h, --help Print this help message" | ||
18 | echo "Variables:" | ||
19 | echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~ | ||
20 | case ls list | ||
21 | string match --entire --regex -- "$argv[2]" $_fisher_plugins | ||
22 | case install update remove | ||
23 | isatty || read --local --null --array stdin && set --append argv $stdin | ||
24 | |||
25 | set --local install_plugins | ||
26 | set --local update_plugins | ||
27 | set --local remove_plugins | ||
28 | set --local arg_plugins $argv[2..-1] | ||
29 | set --local old_plugins $_fisher_plugins | ||
30 | set --local new_plugins | ||
31 | |||
32 | test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins) | ||
33 | |||
34 | if ! set --query argv[2] | ||
35 | if test "$cmd" != update | ||
36 | echo "fisher: Not enough arguments for command: \"$cmd\"" >&2 && return 1 | ||
37 | else if ! set --query file_plugins | ||
38 | echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 | ||
39 | end | ||
40 | set arg_plugins $file_plugins | ||
41 | end | ||
42 | |||
43 | for plugin in $arg_plugins | ||
44 | set plugin (test -e "$plugin" && realpath $plugin || string lower -- $plugin) | ||
45 | contains -- "$plugin" $new_plugins || set --append new_plugins $plugin | ||
46 | end | ||
47 | |||
48 | if set --query argv[2] | ||
49 | for plugin in $new_plugins | ||
50 | if contains -- "$plugin" $old_plugins | ||
51 | test "$cmd" = remove && | ||
52 | set --append remove_plugins $plugin || | ||
53 | set --append update_plugins $plugin | ||
54 | else if test "$cmd" = install | ||
55 | set --append install_plugins $plugin | ||
56 | else | ||
57 | echo "fisher: Plugin not installed: \"$plugin\"" >&2 && return 1 | ||
58 | end | ||
59 | end | ||
60 | else | ||
61 | for plugin in $new_plugins | ||
62 | contains -- "$plugin" $old_plugins && | ||
63 | set --append update_plugins $plugin || | ||
64 | set --append install_plugins $plugin | ||
65 | end | ||
66 | |||
67 | for plugin in $old_plugins | ||
68 | contains -- "$plugin" $new_plugins || set --append remove_plugins $plugin | ||
69 | end | ||
70 | end | ||
71 | |||
72 | set --local pid_list | ||
73 | set --local source_plugins | ||
74 | set --local fetch_plugins $update_plugins $install_plugins | ||
75 | set --local fish_path (status fish-path) | ||
76 | |||
77 | echo (set_color --bold)fisher $cmd version $fisher_version(set_color normal) | ||
78 | |||
79 | for plugin in $fetch_plugins | ||
80 | set --local source (command mktemp -d) | ||
81 | set --append source_plugins $source | ||
82 | |||
83 | command mkdir -p $source/{completions,conf.d,themes,functions} | ||
84 | |||
85 | $fish_path --command " | ||
86 | if test -e $plugin | ||
87 | command cp -Rf $plugin/* $source | ||
88 | else | ||
89 | set temp (command mktemp -d) | ||
90 | set repo (string split -- \@ $plugin) || set repo[2] HEAD | ||
91 | |||
92 | if set path (string replace --regex -- '^(https://)?gitlab.com/' '' \$repo[1]) | ||
93 | set name (string split -- / \$path)[-1] | ||
94 | set url https://gitlab.com/\$path/-/archive/\$repo[2]/\$name-\$repo[2].tar.gz | ||
95 | else | ||
96 | set url https://api.github.com/repos/\$repo[1]/tarball/\$repo[2] | ||
97 | end | ||
98 | |||
99 | echo Fetching (set_color --underline)\$url(set_color normal) | ||
100 | |||
101 | if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null | ||
102 | command cp -Rf \$temp/*/* $source | ||
103 | else | ||
104 | echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 | ||
105 | command rm -rf $source | ||
106 | end | ||
107 | |||
108 | command rm -rf \$temp | ||
109 | end | ||
110 | |||
111 | set files $source/* && string match --quiet --regex -- .+\.fish\\\$ \$files | ||
112 | " & | ||
113 | |||
114 | set --append pid_list (jobs --last --pid) | ||
115 | end | ||
116 | |||
117 | wait $pid_list 2>/dev/null | ||
118 | |||
119 | for plugin in $fetch_plugins | ||
120 | if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source | ||
121 | if set --local index (contains --index -- "$plugin" $install_plugins) | ||
122 | set --erase install_plugins[$index] | ||
123 | else | ||
124 | set --erase update_plugins[(contains --index -- "$plugin" $update_plugins)] | ||
125 | end | ||
126 | end | ||
127 | end | ||
128 | |||
129 | for plugin in $update_plugins $remove_plugins | ||
130 | if set --local index (contains --index -- "$plugin" $_fisher_plugins) | ||
131 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files | ||
132 | |||
133 | if contains -- "$plugin" $remove_plugins | ||
134 | for name in (string replace --filter --regex -- '.+/conf\.d/([^/]+)\.fish$' '$1' $$plugin_files_var) | ||
135 | emit {$name}_uninstall | ||
136 | end | ||
137 | printf "%s\n" Removing\ (set_color red --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ | ||
138 | set --erase _fisher_plugins[$index] | ||
139 | end | ||
140 | |||
141 | command rm -rf (string replace -- \~ ~ $$plugin_files_var) | ||
142 | |||
143 | functions --erase (string replace --filter --regex -- '.+/functions/([^/]+)\.fish$' '$1' $$plugin_files_var) | ||
144 | |||
145 | for name in (string replace --filter --regex -- '.+/completions/([^/]+)\.fish$' '$1' $$plugin_files_var) | ||
146 | complete --erase --command $name | ||
147 | end | ||
148 | |||
149 | set --erase $plugin_files_var | ||
150 | end | ||
151 | end | ||
152 | |||
153 | if set --query update_plugins[1] || set --query install_plugins[1] | ||
154 | command mkdir -p $fisher_path/{functions,themes,conf.d,completions} | ||
155 | end | ||
156 | |||
157 | for plugin in $update_plugins $install_plugins | ||
158 | set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] | ||
159 | set --local files $source/{functions,themes,conf.d,completions}/* | ||
160 | |||
161 | if set --local index (contains --index -- $plugin $install_plugins) | ||
162 | set --local user_files $fisher_path/{functions,themes,conf.d,completions}/* | ||
163 | set --local conflict_files | ||
164 | |||
165 | for file in (string replace -- $source/ $fisher_path/ $files) | ||
166 | contains -- $file $user_files && set --append conflict_files $file | ||
167 | end | ||
168 | |||
169 | if set --query conflict_files[1] && set --erase install_plugins[$index] | ||
170 | echo -s "fisher: Cannot install \"$plugin\": please remove or move conflicting files first:" \n" "$conflict_files >&2 | ||
171 | continue | ||
172 | end | ||
173 | end | ||
174 | |||
175 | for file in (string replace -- $source/ "" $files) | ||
176 | command cp -RLf $source/$file $fisher_path/$file | ||
177 | end | ||
178 | |||
179 | set --local plugin_files_var _fisher_(string escape --style=var -- $plugin)_files | ||
180 | |||
181 | set --query files[1] && set --universal $plugin_files_var (string replace -- $source $fisher_path $files | string replace -- ~ \~) | ||
182 | |||
183 | contains -- $plugin $_fisher_plugins || set --universal --append _fisher_plugins $plugin | ||
184 | contains -- $plugin $install_plugins && set --local event install || set --local event update | ||
185 | |||
186 | printf "%s\n" Installing\ (set_color --bold)$plugin(set_color normal) " "$$plugin_files_var | string replace -- \~ ~ | ||
187 | |||
188 | for file in (string match --regex -- '.+/[^/]+\.fish$' $$plugin_files_var | string replace -- \~ ~) | ||
189 | source $file | ||
190 | if set --local name (string replace --regex -- '.+conf\.d/([^/]+)\.fish$' '$1' $file) | ||
191 | emit {$name}_$event | ||
192 | end | ||
193 | end | ||
194 | end | ||
195 | |||
196 | command rm -rf $source_plugins | ||
197 | |||
198 | if set --query _fisher_plugins[1] | ||
199 | set --local commit_plugins | ||
200 | |||
201 | for plugin in $file_plugins | ||
202 | contains -- (string lower -- $plugin) (string lower -- $_fisher_plugins) && set --append commit_plugins $plugin | ||
203 | end | ||
204 | |||
205 | for plugin in $_fisher_plugins | ||
206 | contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin | ||
207 | end | ||
208 | |||
209 | printf "%s\n" $commit_plugins >$fish_plugins | ||
210 | else | ||
211 | set --erase _fisher_plugins | ||
212 | command rm -f $fish_plugins | ||
213 | end | ||
214 | |||
215 | set --local total (count $install_plugins) (count $update_plugins) (count $remove_plugins) | ||
216 | |||
217 | test "$total" != "0 0 0" && echo (string join ", " ( | ||
218 | test $total[1] = 0 || echo "Installed $total[1]") ( | ||
219 | test $total[2] = 0 || echo "Updated $total[2]") ( | ||
220 | test $total[3] = 0 || echo "Removed $total[3]") | ||
221 | ) plugin/s | ||
222 | case \* | ||
223 | echo "fisher: Unknown command: \"$cmd\"" >&2 && return 1 | ||
224 | end | ||
225 | end | ||
226 | |||
227 | if ! set --query _fisher_upgraded_to_4_4 | ||
228 | set --universal _fisher_upgraded_to_4_4 | ||
229 | if functions --query _fisher_list | ||
230 | set --query XDG_DATA_HOME[1] || set --local XDG_DATA_HOME ~/.local/share | ||
231 | command rm -rf $XDG_DATA_HOME/fisher | ||
232 | functions --erase _fisher_{list,plugin_parse} | ||
233 | fisher update >/dev/null 2>/dev/null | ||
234 | else | ||
235 | for var in (set --names | string match --entire --regex '^_fisher_.+_files$') | ||
236 | set $var (string replace -- ~ \~ $$var) | ||
237 | end | ||
238 | functions --erase _fisher_fish_postexec | ||
239 | end | ||
240 | end | ||
diff --git a/home-config/fish/functions/fzf_configure_bindings.fish b/home-config/fish/functions/fzf_configure_bindings.fish new file mode 100644 index 0000000..4b4e7a2 --- /dev/null +++ b/home-config/fish/functions/fzf_configure_bindings.fish | |||
@@ -0,0 +1,46 @@ | |||
1 | # Always installs bindings for insert and default mode for simplicity and b/c it has almost no side-effect | ||
2 | # https://gitter.im/fish-shell/fish-shell?at=60a55915ee77a74d685fa6b1 | ||
3 | function fzf_configure_bindings --description "Installs the default key bindings for fzf.fish with user overrides passed as options." | ||
4 | # no need to install bindings if not in interactive mode or running tests | ||
5 | status is-interactive || test "$CI" = true; or return | ||
6 | |||
7 | set -f options_spec h/help 'directory=?' 'git_log=?' 'git_status=?' 'history=?' 'processes=?' 'variables=?' | ||
8 | argparse --max-args=0 --ignore-unknown $options_spec -- $argv 2>/dev/null | ||
9 | if test $status -ne 0 | ||
10 | echo "Invalid option or a positional argument was provided." >&2 | ||
11 | _fzf_configure_bindings_help | ||
12 | return 22 | ||
13 | else if set --query _flag_help | ||
14 | _fzf_configure_bindings_help | ||
15 | return | ||
16 | else | ||
17 | # Initialize with default key sequences and then override or disable them based on flags | ||
18 | # index 1 = directory, 2 = git_log, 3 = git_status, 4 = history, 5 = processes, 6 = variables | ||
19 | set -f key_sequences \e\cf \e\cl \e\cs \cr \e\cp \cv # \c = control, \e = escape | ||
20 | set --query _flag_directory && set key_sequences[1] "$_flag_directory" | ||
21 | set --query _flag_git_log && set key_sequences[2] "$_flag_git_log" | ||
22 | set --query _flag_git_status && set key_sequences[3] "$_flag_git_status" | ||
23 | set --query _flag_history && set key_sequences[4] "$_flag_history" | ||
24 | set --query _flag_processes && set key_sequences[5] "$_flag_processes" | ||
25 | set --query _flag_variables && set key_sequences[6] "$_flag_variables" | ||
26 | |||
27 | # If fzf bindings already exists, uninstall it first for a clean slate | ||
28 | if functions --query _fzf_uninstall_bindings | ||
29 | _fzf_uninstall_bindings | ||
30 | end | ||
31 | |||
32 | for mode in default insert | ||
33 | test -n $key_sequences[1] && bind --mode $mode $key_sequences[1] _fzf_search_directory | ||
34 | test -n $key_sequences[2] && bind --mode $mode $key_sequences[2] _fzf_search_git_log | ||
35 | test -n $key_sequences[3] && bind --mode $mode $key_sequences[3] _fzf_search_git_status | ||
36 | test -n $key_sequences[4] && bind --mode $mode $key_sequences[4] _fzf_search_history | ||
37 | test -n $key_sequences[5] && bind --mode $mode $key_sequences[5] _fzf_search_processes | ||
38 | test -n $key_sequences[6] && bind --mode $mode $key_sequences[6] "$_fzf_search_vars_command" | ||
39 | end | ||
40 | |||
41 | function _fzf_uninstall_bindings --inherit-variable key_sequences | ||
42 | bind --erase -- $key_sequences | ||
43 | bind --erase --mode insert -- $key_sequences | ||
44 | end | ||
45 | end | ||
46 | end | ||
diff --git a/home-config/fish/functions/tide.fish b/home-config/fish/functions/tide.fish new file mode 100644 index 0000000..092a722 --- /dev/null +++ b/home-config/fish/functions/tide.fish | |||
@@ -0,0 +1,28 @@ | |||
1 | function tide --description 'Manage your Tide prompt' | ||
2 | argparse --stop-nonopt v/version h/help -- $argv | ||
3 | |||
4 | if set -q _flag_version | ||
5 | echo 'tide, version 6.1.1' | ||
6 | else if set -q _flag_help | ||
7 | _tide_help | ||
8 | else if functions --query _tide_sub_$argv[1] | ||
9 | _tide_sub_$argv[1] $argv[2..] | ||
10 | else | ||
11 | _tide_help | ||
12 | return 1 | ||
13 | end | ||
14 | end | ||
15 | |||
16 | function _tide_help | ||
17 | printf %s\n \ | ||
18 | 'Usage: tide [options] subcommand [options]' \ | ||
19 | '' \ | ||
20 | 'Options:' \ | ||
21 | ' -v or --version print tide version number' \ | ||
22 | ' -h or --help print this help message' \ | ||
23 | '' \ | ||
24 | 'Subcommands:' \ | ||
25 | ' configure run interactive configuration wizard' \ | ||
26 | ' reload reload tide configuration' \ | ||
27 | ' bug-report print info for use in bug reports' | ||
28 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/finish.fish b/home-config/fish/functions/tide/configure/choices/all/finish.fish new file mode 100644 index 0000000..f670b1e --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/finish.fish | |||
@@ -0,0 +1,46 @@ | |||
1 | function finish | ||
2 | _tide_title Finish | ||
3 | |||
4 | echo | ||
5 | set_color red | ||
6 | _tide_option y 'Overwrite your current tide config' | ||
7 | set_color normal | ||
8 | echo | ||
9 | |||
10 | _tide_option p 'Exit and print the config you just generated' | ||
11 | echo | ||
12 | |||
13 | _tide_menu (status function) | ||
14 | switch $_tide_selected_option | ||
15 | case 'Overwrite your current tide config' | ||
16 | _tide_finish | ||
17 | command -q clear && clear | ||
18 | set -q _flag_auto || _tide_print_configure_current_options | ||
19 | case 'Exit and print the config you just generated' | ||
20 | _tide_exit_configure | ||
21 | command -q clear && clear | ||
22 | _tide_print_configure_current_options | ||
23 | end | ||
24 | end | ||
25 | |||
26 | function _tide_finish | ||
27 | _tide_exit_configure | ||
28 | |||
29 | # Deal with prompt char/vi mode | ||
30 | contains character $fake_tide_left_prompt_items || set -p fake_tide_left_prompt_items vi_mode | ||
31 | |||
32 | # Set the real variables | ||
33 | for fakeVar in (set --names | string match -r "^fake_tide.*") | ||
34 | set -U (string replace 'fake_' '' $fakeVar) $$fakeVar | ||
35 | end | ||
36 | |||
37 | # Make sure old prompt won't display | ||
38 | set -e $_tide_prompt_var 2>/dev/null | ||
39 | |||
40 | # Re-initialize the prompt | ||
41 | tide reload | ||
42 | end | ||
43 | |||
44 | function _tide_print_configure_current_options | ||
45 | _tide_fish_colorize "tide configure --auto $_tide_configure_current_options" | ||
46 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/icons.fish b/home-config/fish/functions/tide/configure/choices/all/icons.fish new file mode 100644 index 0000000..be167bb --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/icons.fish | |||
@@ -0,0 +1,33 @@ | |||
1 | function icons | ||
2 | _tide_title Icons | ||
3 | |||
4 | _tide_option 1 'Few icons' | ||
5 | _tide_display_prompt | ||
6 | |||
7 | _tide_option 2 'Many icons' | ||
8 | _enable_icons | ||
9 | _tide_display_prompt | ||
10 | |||
11 | _tide_menu (status function) | ||
12 | switch $_tide_selected_option | ||
13 | case 'Few icons' | ||
14 | _disable_icons | ||
15 | end | ||
16 | _next_choice all/transient | ||
17 | end | ||
18 | |||
19 | function _enable_icons | ||
20 | set -p fake_tide_left_prompt_items os | ||
21 | set -g fake_tide_pwd_icon | ||
22 | set -g fake_tide_pwd_icon_home | ||
23 | set -g fake_tide_cmd_duration_icon | ||
24 | set -g fake_tide_git_icon | ||
25 | end | ||
26 | |||
27 | function _disable_icons | ||
28 | _tide_find_and_remove os fake_tide_left_prompt_items | ||
29 | set fake_tide_pwd_icon | ||
30 | set fake_tide_pwd_icon_home | ||
31 | set fake_tide_cmd_duration_icon | ||
32 | set fake_tide_git_icon | ||
33 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish new file mode 100644 index 0000000..247ef4e --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_colors.fish | |||
@@ -0,0 +1,26 @@ | |||
1 | function prompt_colors | ||
2 | _tide_title 'Prompt Colors' | ||
3 | |||
4 | _tide_option 1 'True color' | ||
5 | _tide_display_prompt | ||
6 | |||
7 | _tide_option 2 '16 colors' | ||
8 | _load_config "$_tide_configure_style"_16color | ||
9 | set -g _tide_16color true | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_menu (status function) | ||
13 | switch $_tide_selected_option | ||
14 | case 'True color' | ||
15 | _load_config "$_tide_configure_style" | ||
16 | set -e _tide_16color | ||
17 | switch $_tide_configure_style | ||
18 | case lean rainbow | ||
19 | _next_choice all/show_time | ||
20 | case classic | ||
21 | _next_choice classic/classic_prompt_color | ||
22 | end | ||
23 | case '16 colors' | ||
24 | _next_choice all/show_time | ||
25 | end | ||
26 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish new file mode 100644 index 0000000..ff76546 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_connection.fish | |||
@@ -0,0 +1,31 @@ | |||
1 | function prompt_connection | ||
2 | _tide_title 'Prompt Connection' | ||
3 | |||
4 | _tide_option 1 Disconnected | ||
5 | set -g fake_tide_prompt_icon_connection ' ' | ||
6 | _tide_display_prompt | ||
7 | |||
8 | _tide_option 2 Dotted | ||
9 | set -g fake_tide_prompt_icon_connection '·' | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_option 3 Solid | ||
13 | set -g fake_tide_prompt_icon_connection '─' | ||
14 | _tide_display_prompt | ||
15 | |||
16 | _tide_menu (status function) | ||
17 | switch $_tide_selected_option | ||
18 | case Disconnected | ||
19 | set -g fake_tide_prompt_icon_connection ' ' | ||
20 | case Dotted | ||
21 | set -g fake_tide_prompt_icon_connection '·' | ||
22 | case Solid | ||
23 | set -g fake_tide_prompt_icon_connection '─' | ||
24 | end | ||
25 | switch $_tide_configure_style | ||
26 | case lean | ||
27 | _next_choice all/prompt_connection_andor_frame_color | ||
28 | case classic rainbow | ||
29 | _next_choice powerline/powerline_right_prompt_frame | ||
30 | end | ||
31 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish new file mode 100644 index 0000000..cefbf2c --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_connection_andor_frame_color.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | function prompt_connection_andor_frame_color | ||
2 | if test "$_tide_16color" = true || | ||
3 | test "$fake_tide_left_prompt_frame_enabled" = false -a \ | ||
4 | "$fake_tide_right_prompt_frame_enabled" = false -a \ | ||
5 | "$fake_tide_prompt_icon_connection" = ' ' | ||
6 | _next_choice all/prompt_spacing | ||
7 | return 0 | ||
8 | end | ||
9 | |||
10 | _tide_title "Connection & Frame Color" | ||
11 | |||
12 | _tide_option 1 Lightest | ||
13 | set -g fake_tide_prompt_color_frame_and_connection 808080 | ||
14 | _tide_display_prompt | ||
15 | |||
16 | _tide_option 2 Light | ||
17 | set -g fake_tide_prompt_color_frame_and_connection 6C6C6C | ||
18 | _tide_display_prompt | ||
19 | |||
20 | _tide_option 3 Dark | ||
21 | set -g fake_tide_prompt_color_frame_and_connection 585858 | ||
22 | _tide_display_prompt | ||
23 | |||
24 | _tide_option 4 Darkest | ||
25 | set -g fake_tide_prompt_color_frame_and_connection 444444 | ||
26 | _tide_display_prompt | ||
27 | |||
28 | _tide_menu (status function) | ||
29 | switch $_tide_selected_option | ||
30 | case Lightest | ||
31 | set -g fake_tide_prompt_color_frame_and_connection 808080 | ||
32 | case Light | ||
33 | set -g fake_tide_prompt_color_frame_and_connection 6C6C6C | ||
34 | case Dark | ||
35 | set -g fake_tide_prompt_color_frame_and_connection 585858 | ||
36 | case Darkest | ||
37 | set -g fake_tide_prompt_color_frame_and_connection 444444 | ||
38 | end | ||
39 | _next_choice all/prompt_spacing | ||
40 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish b/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish new file mode 100644 index 0000000..f68be68 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/prompt_spacing.fish | |||
@@ -0,0 +1,22 @@ | |||
1 | function prompt_spacing | ||
2 | _tide_title 'Prompt Spacing' | ||
3 | |||
4 | _tide_option 1 Compact | ||
5 | set -g fake_tide_prompt_add_newline_before false | ||
6 | _tide_display_prompt | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Sparse | ||
10 | set -g fake_tide_prompt_add_newline_before true | ||
11 | _tide_display_prompt | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_menu (status function) | ||
15 | switch $_tide_selected_option | ||
16 | case Compact | ||
17 | set -g fake_tide_prompt_add_newline_before false | ||
18 | case Sparse | ||
19 | set -g fake_tide_prompt_add_newline_before true | ||
20 | end | ||
21 | _next_choice all/icons | ||
22 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/show_time.fish b/home-config/fish/functions/tide/configure/choices/all/show_time.fish new file mode 100644 index 0000000..b66c785 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/show_time.fish | |||
@@ -0,0 +1,33 @@ | |||
1 | function show_time | ||
2 | _tide_title 'Show current time?' | ||
3 | |||
4 | _tide_option 1 No | ||
5 | _tide_display_prompt | ||
6 | |||
7 | set -a fake_tide_right_prompt_items time | ||
8 | |||
9 | _tide_option 2 '24-hour format' | ||
10 | set -g fake_tide_time_format %T | ||
11 | _tide_display_prompt | ||
12 | |||
13 | _tide_option 3 '12-hour format' | ||
14 | set -g fake_tide_time_format %r | ||
15 | _tide_display_prompt | ||
16 | |||
17 | _tide_menu (status function) | ||
18 | switch $_tide_selected_option | ||
19 | case No | ||
20 | set -g fake_tide_time_format '' | ||
21 | set -e fake_tide_right_prompt_items[-1] | ||
22 | case '24-hour format' | ||
23 | set -g fake_tide_time_format %T | ||
24 | case '12-hour format' | ||
25 | set -g fake_tide_time_format %r | ||
26 | end | ||
27 | switch $_tide_configure_style | ||
28 | case lean | ||
29 | _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_height | ||
30 | case classic rainbow | ||
31 | _next_choice "$_tide_configure_style"/"$_tide_configure_style"_prompt_separators | ||
32 | end | ||
33 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/style.fish b/home-config/fish/functions/tide/configure/choices/all/style.fish new file mode 100644 index 0000000..fe9a58f --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/style.fish | |||
@@ -0,0 +1,36 @@ | |||
1 | function style | ||
2 | set -g _tide_configure_current_options | ||
3 | |||
4 | _tide_title 'Prompt Style' | ||
5 | |||
6 | _tide_option 1 Lean | ||
7 | _load_config lean | ||
8 | _tide_display_prompt | ||
9 | |||
10 | _tide_option 2 Classic | ||
11 | _load_config classic | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Rainbow | ||
15 | _load_config rainbow | ||
16 | _tide_display_prompt | ||
17 | |||
18 | _tide_menu (status function) --no-restart | ||
19 | switch $_tide_selected_option | ||
20 | case Lean | ||
21 | _load_config lean | ||
22 | set -g _tide_configure_style lean | ||
23 | case Classic | ||
24 | _load_config classic | ||
25 | set -g _tide_configure_style classic | ||
26 | case Rainbow | ||
27 | _load_config rainbow | ||
28 | set -g _tide_configure_style rainbow | ||
29 | end | ||
30 | _next_choice all/prompt_colors | ||
31 | end | ||
32 | |||
33 | function _load_config -a name | ||
34 | string replace -r '^' 'set -g fake_' <(status dirname)/../../icons.fish | source | ||
35 | string replace -r '^' 'set -g fake_' <(status dirname)/../../configs/$name.fish | source | ||
36 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/all/transient.fish b/home-config/fish/functions/tide/configure/choices/all/transient.fish new file mode 100644 index 0000000..df2b6b6 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/all/transient.fish | |||
@@ -0,0 +1,22 @@ | |||
1 | function transient | ||
2 | _tide_title 'Enable transient prompt?' | ||
3 | |||
4 | _tide_option 1 No | ||
5 | _tide_display_prompt | ||
6 | _tide_display_prompt | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Yes | ||
10 | _configure_transient= _tide_display_prompt | ||
11 | _configure_transient= _tide_display_prompt | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_menu (status function) | ||
15 | switch $_tide_selected_option | ||
16 | case No | ||
17 | set fake_tide_prompt_transient_enabled false | ||
18 | case Yes | ||
19 | set fake_tide_prompt_transient_enabled true | ||
20 | end | ||
21 | _next_choice all/finish | ||
22 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish b/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish new file mode 100644 index 0000000..77ceeaf --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_color.fish | |||
@@ -0,0 +1,38 @@ | |||
1 | function classic_prompt_color | ||
2 | _tide_title 'Prompt Color' | ||
3 | |||
4 | _tide_option 1 Lightest | ||
5 | _set_all_items_bg_color 585858 | ||
6 | _tide_display_prompt | ||
7 | |||
8 | _tide_option 2 Light | ||
9 | _set_all_items_bg_color 444444 | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_option 3 Dark | ||
13 | _set_all_items_bg_color 303030 | ||
14 | _tide_display_prompt | ||
15 | |||
16 | _tide_option 4 Darkest | ||
17 | _set_all_items_bg_color 1C1C1C | ||
18 | _tide_display_prompt | ||
19 | |||
20 | _tide_menu (status function) | ||
21 | switch $_tide_selected_option | ||
22 | case Lightest | ||
23 | _set_all_items_bg_color 585858 | ||
24 | case Light | ||
25 | _set_all_items_bg_color 444444 | ||
26 | case Dark | ||
27 | _set_all_items_bg_color 303030 | ||
28 | case Darkest | ||
29 | _set_all_items_bg_color 1C1C1C | ||
30 | end | ||
31 | _next_choice all/show_time | ||
32 | end | ||
33 | |||
34 | function _set_all_items_bg_color -a color | ||
35 | for var in (set --names | string match -r "fake_.*_bg_color.*") | ||
36 | set $var $color | ||
37 | end | ||
38 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish b/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish new file mode 100644 index 0000000..20af6cd --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/classic/classic_prompt_separators.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | function classic_prompt_separators | ||
2 | _tide_title 'Prompt Separators' | ||
3 | |||
4 | _tide_option 1 Angled | ||
5 | set -g fake_tide_left_prompt_separator_same_color | ||
6 | set -g fake_tide_right_prompt_separator_same_color | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Vertical | ||
10 | set -g fake_tide_left_prompt_separator_same_color │ | ||
11 | set -g fake_tide_right_prompt_separator_same_color │ | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Slanted | ||
15 | set -g fake_tide_left_prompt_separator_same_color ╱ | ||
16 | set -g fake_tide_right_prompt_separator_same_color ╱ | ||
17 | _tide_display_prompt | ||
18 | |||
19 | _tide_option 4 Round | ||
20 | set -g fake_tide_left_prompt_separator_same_color | ||
21 | set -g fake_tide_right_prompt_separator_same_color | ||
22 | _tide_display_prompt | ||
23 | |||
24 | _tide_menu (status function) | ||
25 | switch $_tide_selected_option | ||
26 | case Angled | ||
27 | set -g fake_tide_left_prompt_separator_same_color | ||
28 | set -g fake_tide_right_prompt_separator_same_color | ||
29 | case Vertical | ||
30 | set -g fake_tide_left_prompt_separator_same_color │ | ||
31 | set -g fake_tide_right_prompt_separator_same_color │ | ||
32 | case Slanted | ||
33 | set -g fake_tide_left_prompt_separator_same_color ╱ | ||
34 | set -g fake_tide_right_prompt_separator_same_color ╱ | ||
35 | case Round | ||
36 | set -g fake_tide_left_prompt_separator_same_color | ||
37 | set -g fake_tide_right_prompt_separator_same_color | ||
38 | end | ||
39 | _next_choice powerline/powerline_prompt_heads | ||
40 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish b/home-config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish new file mode 100644 index 0000000..2077241 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/lean/lean_prompt_height.fish | |||
@@ -0,0 +1,26 @@ | |||
1 | function lean_prompt_height | ||
2 | _tide_title 'Prompt Height' | ||
3 | |||
4 | _tide_option 1 'One line' | ||
5 | _tide_find_and_remove newline fake_tide_left_prompt_items | ||
6 | set -g fake_tide_left_prompt_suffix '' | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 'Two lines' | ||
10 | set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1] | ||
11 | set -g fake_tide_left_prompt_suffix ' ' | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_menu (status function) | ||
15 | switch $_tide_selected_option | ||
16 | case 'One line' | ||
17 | _tide_find_and_remove newline fake_tide_left_prompt_items | ||
18 | set fake_tide_left_prompt_suffix '' | ||
19 | _next_choice all/prompt_connection_andor_frame_color | ||
20 | case 'Two lines' | ||
21 | _tide_find_and_remove newline fake_tide_left_prompt_items | ||
22 | set -g fake_tide_left_prompt_items $fake_tide_left_prompt_items[1..-2] newline $fake_tide_left_prompt_items[-1] | ||
23 | set -g fake_tide_left_prompt_suffix ' ' | ||
24 | _next_choice all/prompt_connection | ||
25 | end | ||
26 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish new file mode 100644 index 0000000..0030cad --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_heads.fish | |||
@@ -0,0 +1,32 @@ | |||
1 | function powerline_prompt_heads | ||
2 | _tide_title 'Prompt Heads' | ||
3 | |||
4 | _tide_option 1 Sharp | ||
5 | set -g fake_tide_left_prompt_suffix | ||
6 | set -g fake_tide_right_prompt_prefix | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Slanted | ||
10 | set -g fake_tide_left_prompt_suffix | ||
11 | set -g fake_tide_right_prompt_prefix | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Round | ||
15 | set -g fake_tide_left_prompt_suffix | ||
16 | set -g fake_tide_right_prompt_prefix | ||
17 | _tide_display_prompt | ||
18 | |||
19 | _tide_menu (status function) | ||
20 | switch $_tide_selected_option | ||
21 | case Sharp | ||
22 | set -g fake_tide_left_prompt_suffix | ||
23 | set -g fake_tide_right_prompt_prefix | ||
24 | case Slanted | ||
25 | set -g fake_tide_left_prompt_suffix | ||
26 | set -g fake_tide_right_prompt_prefix | ||
27 | case Round | ||
28 | set -g fake_tide_left_prompt_suffix | ||
29 | set -g fake_tide_right_prompt_prefix | ||
30 | end | ||
31 | _next_choice powerline/powerline_prompt_tails | ||
32 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish new file mode 100644 index 0000000..b374757 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_style.fish | |||
@@ -0,0 +1,51 @@ | |||
1 | function powerline_prompt_style | ||
2 | _tide_title 'Powerline Prompt Style' | ||
3 | |||
4 | _tide_option 1 'One line' | ||
5 | _tide_find_and_remove newline fake_tide_left_prompt_items | ||
6 | _tide_find_and_remove character fake_tide_left_prompt_items | ||
7 | set fake_tide_left_prompt_frame_enabled false | ||
8 | set fake_tide_right_prompt_frame_enabled false | ||
9 | _tide_display_prompt | ||
10 | |||
11 | set -a fake_tide_left_prompt_items newline | ||
12 | |||
13 | _tide_option 2 'Two lines, character' | ||
14 | set -a fake_tide_left_prompt_items character | ||
15 | set fake_tide_left_prompt_frame_enabled false | ||
16 | set fake_tide_right_prompt_frame_enabled false | ||
17 | _tide_display_prompt | ||
18 | |||
19 | _tide_option 3 'Two lines, frame' | ||
20 | _tide_find_and_remove character fake_tide_left_prompt_items | ||
21 | set fake_tide_left_prompt_frame_enabled true | ||
22 | set fake_tide_right_prompt_frame_enabled true | ||
23 | _tide_display_prompt | ||
24 | |||
25 | _tide_option 4 'Two lines, character and frame' | ||
26 | set -a fake_tide_left_prompt_items character | ||
27 | set fake_tide_left_prompt_frame_enabled true | ||
28 | set fake_tide_right_prompt_frame_enabled true | ||
29 | _tide_display_prompt | ||
30 | |||
31 | _tide_menu (status function) | ||
32 | switch $_tide_selected_option | ||
33 | case 'One line' | ||
34 | _tide_find_and_remove newline fake_tide_left_prompt_items | ||
35 | _tide_find_and_remove character fake_tide_left_prompt_items | ||
36 | set fake_tide_left_prompt_frame_enabled false | ||
37 | set fake_tide_right_prompt_frame_enabled false | ||
38 | _next_choice all/prompt_connection_andor_frame_color | ||
39 | case 'Two lines, character' | ||
40 | set fake_tide_left_prompt_frame_enabled false | ||
41 | set fake_tide_right_prompt_frame_enabled false | ||
42 | _next_choice all/prompt_connection | ||
43 | case 'Two lines, frame' | ||
44 | _tide_find_and_remove character fake_tide_left_prompt_items | ||
45 | set fake_tide_left_prompt_frame_enabled true | ||
46 | set fake_tide_right_prompt_frame_enabled true | ||
47 | _next_choice all/prompt_connection | ||
48 | case 'Two lines, character and frame' | ||
49 | _next_choice all/prompt_connection | ||
50 | end | ||
51 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish new file mode 100644 index 0000000..6b1574b --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/powerline/powerline_prompt_tails.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | function powerline_prompt_tails | ||
2 | _tide_title 'Prompt Tails' | ||
3 | |||
4 | _tide_option 1 Flat | ||
5 | set -g fake_tide_left_prompt_prefix '' | ||
6 | set -g fake_tide_right_prompt_suffix '' | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Sharp | ||
10 | set -g fake_tide_left_prompt_prefix | ||
11 | set -g fake_tide_right_prompt_suffix | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Slanted | ||
15 | set -g fake_tide_left_prompt_prefix | ||
16 | set -g fake_tide_right_prompt_suffix | ||
17 | _tide_display_prompt | ||
18 | |||
19 | _tide_option 4 Round | ||
20 | set -g fake_tide_left_prompt_prefix | ||
21 | set -g fake_tide_right_prompt_suffix | ||
22 | _tide_display_prompt | ||
23 | |||
24 | _tide_menu (status function) | ||
25 | switch $_tide_selected_option | ||
26 | case Flat | ||
27 | set -g fake_tide_left_prompt_prefix '' | ||
28 | set -g fake_tide_right_prompt_suffix '' | ||
29 | case Sharp | ||
30 | set -g fake_tide_left_prompt_prefix | ||
31 | set -g fake_tide_right_prompt_suffix | ||
32 | case Slanted | ||
33 | set -g fake_tide_left_prompt_prefix | ||
34 | set -g fake_tide_right_prompt_suffix | ||
35 | case Round | ||
36 | set -g fake_tide_left_prompt_prefix | ||
37 | set -g fake_tide_right_prompt_suffix | ||
38 | end | ||
39 | _next_choice powerline/powerline_prompt_style | ||
40 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish b/home-config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish new file mode 100644 index 0000000..a2d0a5b --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/powerline/powerline_right_prompt_frame.fish | |||
@@ -0,0 +1,20 @@ | |||
1 | function powerline_right_prompt_frame | ||
2 | _tide_title 'Right Prompt Frame' | ||
3 | |||
4 | _tide_option 1 No | ||
5 | set fake_tide_right_prompt_frame_enabled false | ||
6 | _tide_display_prompt | ||
7 | |||
8 | _tide_option 2 Yes | ||
9 | set fake_tide_right_prompt_frame_enabled true | ||
10 | _tide_display_prompt | ||
11 | |||
12 | _tide_menu (status function) | ||
13 | switch $_tide_selected_option | ||
14 | case No | ||
15 | set fake_tide_right_prompt_frame_enabled false | ||
16 | case Yes | ||
17 | set fake_tide_right_prompt_frame_enabled true | ||
18 | end | ||
19 | _next_choice all/prompt_connection_andor_frame_color | ||
20 | end | ||
diff --git a/home-config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish b/home-config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish new file mode 100644 index 0000000..14b9319 --- /dev/null +++ b/home-config/fish/functions/tide/configure/choices/rainbow/rainbow_prompt_separators.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | function rainbow_prompt_separators | ||
2 | _tide_title 'Prompt Separators' | ||
3 | |||
4 | _tide_option 1 Angled | ||
5 | set -g fake_tide_left_prompt_separator_diff_color | ||
6 | set -g fake_tide_right_prompt_separator_diff_color | ||
7 | _tide_display_prompt | ||
8 | |||
9 | _tide_option 2 Vertical | ||
10 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
11 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
12 | _tide_display_prompt | ||
13 | |||
14 | _tide_option 3 Slanted | ||
15 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
16 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
17 | _tide_display_prompt | ||
18 | |||
19 | _tide_option 4 Round | ||
20 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
21 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
22 | _tide_display_prompt | ||
23 | |||
24 | _tide_menu (status function) | ||
25 | switch $_tide_selected_option | ||
26 | case Angled | ||
27 | set -g fake_tide_left_prompt_separator_diff_color | ||
28 | set -g fake_tide_right_prompt_separator_diff_color | ||
29 | case Vertical | ||
30 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
31 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
32 | case Slanted | ||
33 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
34 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
35 | case Round | ||
36 | set -g fake_tide_left_prompt_separator_diff_color '' | ||
37 | set -g fake_tide_right_prompt_separator_diff_color '' | ||
38 | end | ||
39 | _next_choice powerline/powerline_prompt_heads | ||
40 | end | ||
diff --git a/home-config/fish/functions/tide/configure/configs/classic.fish b/home-config/fish/functions/tide/configure/configs/classic.fish new file mode 100644 index 0000000..8973cbc --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/classic.fish | |||
@@ -0,0 +1,116 @@ | |||
1 | tide_aws_bg_color 444444 | ||
2 | tide_aws_color FF9900 | ||
3 | tide_character_color $_tide_color_green | ||
4 | tide_character_color_failure FF0000 | ||
5 | tide_cmd_duration_bg_color 444444 | ||
6 | tide_cmd_duration_color 87875F | ||
7 | tide_cmd_duration_decimals 0 | ||
8 | tide_cmd_duration_threshold 3000 | ||
9 | tide_context_always_display false | ||
10 | tide_context_bg_color 444444 | ||
11 | tide_context_color_default D7AF87 | ||
12 | tide_context_color_root $_tide_color_gold | ||
13 | tide_context_color_ssh D7AF87 | ||
14 | tide_context_hostname_parts 1 | ||
15 | tide_crystal_bg_color 444444 | ||
16 | tide_crystal_color FFFFFF | ||
17 | tide_direnv_bg_color 444444 | ||
18 | tide_direnv_bg_color_denied 444444 | ||
19 | tide_direnv_color $_tide_color_gold | ||
20 | tide_direnv_color_denied FF0000 | ||
21 | tide_distrobox_bg_color 444444 | ||
22 | tide_distrobox_color FF00FF | ||
23 | tide_docker_bg_color 444444 | ||
24 | tide_docker_color 2496ED | ||
25 | tide_docker_default_contexts default colima | ||
26 | tide_elixir_bg_color 444444 | ||
27 | tide_elixir_color 4E2A8E | ||
28 | tide_gcloud_bg_color 444444 | ||
29 | tide_gcloud_color 4285F4 | ||
30 | tide_git_bg_color 444444 | ||
31 | tide_git_bg_color_unstable 444444 | ||
32 | tide_git_bg_color_urgent 444444 | ||
33 | tide_git_color_branch $_tide_color_green | ||
34 | tide_git_color_conflicted FF0000 | ||
35 | tide_git_color_dirty $_tide_color_gold | ||
36 | tide_git_color_operation FF0000 | ||
37 | tide_git_color_staged $_tide_color_gold | ||
38 | tide_git_color_stash $_tide_color_green | ||
39 | tide_git_color_untracked $_tide_color_light_blue | ||
40 | tide_git_color_upstream $_tide_color_green | ||
41 | tide_git_truncation_length 24 | ||
42 | tide_git_truncation_strategy | ||
43 | tide_go_bg_color 444444 | ||
44 | tide_go_color 00ACD7 | ||
45 | tide_java_bg_color 444444 | ||
46 | tide_java_color ED8B00 | ||
47 | tide_jobs_bg_color 444444 | ||
48 | tide_jobs_color $_tide_color_dark_green | ||
49 | tide_jobs_number_threshold 1000 | ||
50 | tide_kubectl_bg_color 444444 | ||
51 | tide_kubectl_color 326CE5 | ||
52 | tide_left_prompt_frame_enabled true | ||
53 | tide_left_prompt_items pwd git newline | ||
54 | tide_left_prompt_prefix '' | ||
55 | tide_left_prompt_separator_diff_color | ||
56 | tide_left_prompt_separator_same_color | ||
57 | tide_left_prompt_suffix | ||
58 | tide_nix_shell_bg_color 444444 | ||
59 | tide_nix_shell_color 7EBAE4 | ||
60 | tide_node_bg_color 444444 | ||
61 | tide_node_color 44883E | ||
62 | tide_os_bg_color 444444 | ||
63 | tide_os_color EEEEEE | ||
64 | tide_php_bg_color 444444 | ||
65 | tide_php_color 617CBE | ||
66 | tide_private_mode_bg_color 444444 | ||
67 | tide_private_mode_color FFFFFF | ||
68 | tide_prompt_add_newline_before true | ||
69 | tide_prompt_color_frame_and_connection 6C6C6C | ||
70 | tide_prompt_color_separator_same_color 949494 | ||
71 | tide_prompt_min_cols 34 | ||
72 | tide_prompt_pad_items true | ||
73 | tide_prompt_transient_enabled false | ||
74 | tide_pulumi_bg_color 444444 | ||
75 | tide_pulumi_color F7BF2A | ||
76 | tide_pwd_bg_color 444444 | ||
77 | tide_pwd_color_anchors $_tide_color_light_blue | ||
78 | tide_pwd_color_dirs $_tide_color_dark_blue | ||
79 | tide_pwd_color_truncated_dirs 8787AF | ||
80 | 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 | ||
81 | tide_python_bg_color 444444 | ||
82 | tide_python_color 00AFAF | ||
83 | tide_right_prompt_frame_enabled true | ||
84 | 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 | ||
85 | tide_right_prompt_prefix | ||
86 | tide_right_prompt_separator_diff_color | ||
87 | tide_right_prompt_separator_same_color | ||
88 | tide_right_prompt_suffix '' | ||
89 | tide_ruby_bg_color 444444 | ||
90 | tide_ruby_color B31209 | ||
91 | tide_rustc_bg_color 444444 | ||
92 | tide_rustc_color F74C00 | ||
93 | tide_shlvl_bg_color 444444 | ||
94 | tide_shlvl_color d78700 | ||
95 | tide_shlvl_threshold 1 | ||
96 | tide_status_bg_color 444444 | ||
97 | tide_status_bg_color_failure 444444 | ||
98 | tide_status_color $_tide_color_dark_green | ||
99 | tide_status_color_failure D70000 | ||
100 | tide_terraform_bg_color 444444 | ||
101 | tide_terraform_color 844FBA | ||
102 | tide_time_bg_color 444444 | ||
103 | tide_time_color 5F8787 | ||
104 | tide_time_format %T | ||
105 | tide_toolbox_bg_color 444444 | ||
106 | tide_toolbox_color 613583 | ||
107 | tide_vi_mode_bg_color_default 444444 | ||
108 | tide_vi_mode_bg_color_insert 444444 | ||
109 | tide_vi_mode_bg_color_replace 444444 | ||
110 | tide_vi_mode_bg_color_visual 444444 | ||
111 | tide_vi_mode_color_default 949494 | ||
112 | tide_vi_mode_color_insert 87AFAF | ||
113 | tide_vi_mode_color_replace 87AF87 | ||
114 | tide_vi_mode_color_visual FF8700 | ||
115 | tide_zig_bg_color 444444 | ||
116 | tide_zig_color F7A41D | ||
diff --git a/home-config/fish/functions/tide/configure/configs/classic_16color.fish b/home-config/fish/functions/tide/configure/configs/classic_16color.fish new file mode 100644 index 0000000..670170f --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/classic_16color.fish | |||
@@ -0,0 +1,89 @@ | |||
1 | tide_aws_bg_color black | ||
2 | tide_aws_color yellow | ||
3 | tide_character_color brgreen | ||
4 | tide_character_color_failure brred | ||
5 | tide_cmd_duration_bg_color black | ||
6 | tide_cmd_duration_color brblack | ||
7 | tide_context_bg_color black | ||
8 | tide_context_color_default yellow | ||
9 | tide_context_color_root bryellow | ||
10 | tide_context_color_ssh yellow | ||
11 | tide_crystal_bg_color black | ||
12 | tide_crystal_color brwhite | ||
13 | tide_direnv_bg_color black | ||
14 | tide_direnv_bg_color_denied black | ||
15 | tide_direnv_color bryellow | ||
16 | tide_direnv_color_denied brred | ||
17 | tide_distrobox_bg_color black | ||
18 | tide_distrobox_color brmagenta | ||
19 | tide_docker_bg_color black | ||
20 | tide_docker_color blue | ||
21 | tide_elixir_bg_color black | ||
22 | tide_elixir_color magenta | ||
23 | tide_gcloud_bg_color black | ||
24 | tide_gcloud_color blue | ||
25 | tide_git_bg_color black | ||
26 | tide_git_bg_color_unstable black | ||
27 | tide_git_bg_color_urgent black | ||
28 | tide_git_color_branch brgreen | ||
29 | tide_git_color_conflicted brred | ||
30 | tide_git_color_dirty bryellow | ||
31 | tide_git_color_operation brred | ||
32 | tide_git_color_staged bryellow | ||
33 | tide_git_color_stash brgreen | ||
34 | tide_git_color_untracked brblue | ||
35 | tide_git_color_upstream brgreen | ||
36 | tide_go_bg_color black | ||
37 | tide_go_color brcyan | ||
38 | tide_java_bg_color black | ||
39 | tide_java_color yellow | ||
40 | tide_jobs_bg_color black | ||
41 | tide_jobs_color green | ||
42 | tide_kubectl_bg_color black | ||
43 | tide_kubectl_color blue | ||
44 | tide_nix_shell_bg_color black | ||
45 | tide_nix_shell_color brblue | ||
46 | tide_node_bg_color black | ||
47 | tide_node_color green | ||
48 | tide_os_bg_color black | ||
49 | tide_os_color brwhite | ||
50 | tide_php_bg_color black | ||
51 | tide_php_color blue | ||
52 | tide_private_mode_bg_color black | ||
53 | tide_private_mode_color brwhite | ||
54 | tide_prompt_color_frame_and_connection brblack | ||
55 | tide_prompt_color_separator_same_color brblack | ||
56 | tide_pulumi_bg_color black | ||
57 | tide_pulumi_color yellow | ||
58 | tide_pwd_bg_color black | ||
59 | tide_pwd_color_anchors brcyan | ||
60 | tide_pwd_color_dirs cyan | ||
61 | tide_pwd_color_truncated_dirs magenta | ||
62 | tide_python_bg_color black | ||
63 | tide_python_color cyan | ||
64 | tide_ruby_bg_color black | ||
65 | tide_ruby_color red | ||
66 | tide_rustc_bg_color black | ||
67 | tide_rustc_color red | ||
68 | tide_shlvl_bg_color black | ||
69 | tide_shlvl_color yellow | ||
70 | tide_status_bg_color black | ||
71 | tide_status_bg_color_failure black | ||
72 | tide_status_color green | ||
73 | tide_status_color_failure red | ||
74 | tide_terraform_bg_color black | ||
75 | tide_terraform_color magenta | ||
76 | tide_time_bg_color black | ||
77 | tide_time_color brblack | ||
78 | tide_toolbox_bg_color black | ||
79 | tide_toolbox_color magenta | ||
80 | tide_vi_mode_bg_color_default black | ||
81 | tide_vi_mode_bg_color_insert black | ||
82 | tide_vi_mode_bg_color_replace black | ||
83 | tide_vi_mode_bg_color_visual black | ||
84 | tide_vi_mode_color_default white | ||
85 | tide_vi_mode_color_insert cyan | ||
86 | tide_vi_mode_color_replace green | ||
87 | tide_vi_mode_color_visual yellow | ||
88 | tide_zig_bg_color black | ||
89 | tide_zig_color yellow | ||
diff --git a/home-config/fish/functions/tide/configure/configs/lean.fish b/home-config/fish/functions/tide/configure/configs/lean.fish new file mode 100644 index 0000000..a958a17 --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/lean.fish | |||
@@ -0,0 +1,116 @@ | |||
1 | tide_aws_bg_color normal | ||
2 | tide_aws_color FF9900 | ||
3 | tide_character_color $_tide_color_green | ||
4 | tide_character_color_failure FF0000 | ||
5 | tide_cmd_duration_bg_color normal | ||
6 | tide_cmd_duration_color 87875F | ||
7 | tide_cmd_duration_decimals 0 | ||
8 | tide_cmd_duration_threshold 3000 | ||
9 | tide_context_always_display false | ||
10 | tide_context_bg_color normal | ||
11 | tide_context_color_default D7AF87 | ||
12 | tide_context_color_root $_tide_color_gold | ||
13 | tide_context_color_ssh D7AF87 | ||
14 | tide_context_hostname_parts 1 | ||
15 | tide_crystal_bg_color normal | ||
16 | tide_crystal_color FFFFFF | ||
17 | tide_direnv_bg_color normal | ||
18 | tide_direnv_bg_color_denied normal | ||
19 | tide_direnv_color $_tide_color_gold | ||
20 | tide_direnv_color_denied FF0000 | ||
21 | tide_distrobox_bg_color normal | ||
22 | tide_distrobox_color FF00FF | ||
23 | tide_docker_bg_color normal | ||
24 | tide_docker_color 2496ED | ||
25 | tide_docker_default_contexts default colima | ||
26 | tide_elixir_bg_color normal | ||
27 | tide_elixir_color 4E2A8E | ||
28 | tide_gcloud_bg_color normal | ||
29 | tide_gcloud_color 4285F4 | ||
30 | tide_git_bg_color normal | ||
31 | tide_git_bg_color_unstable normal | ||
32 | tide_git_bg_color_urgent normal | ||
33 | tide_git_color_branch $_tide_color_green | ||
34 | tide_git_color_conflicted FF0000 | ||
35 | tide_git_color_dirty $_tide_color_gold | ||
36 | tide_git_color_operation FF0000 | ||
37 | tide_git_color_staged $_tide_color_gold | ||
38 | tide_git_color_stash $_tide_color_green | ||
39 | tide_git_color_untracked $_tide_color_light_blue | ||
40 | tide_git_color_upstream $_tide_color_green | ||
41 | tide_git_truncation_length 24 | ||
42 | tide_git_truncation_strategy | ||
43 | tide_go_bg_color normal | ||
44 | tide_go_color 00ACD7 | ||
45 | tide_java_bg_color normal | ||
46 | tide_java_color ED8B00 | ||
47 | tide_jobs_bg_color normal | ||
48 | tide_jobs_color $_tide_color_dark_green | ||
49 | tide_jobs_number_threshold 1000 | ||
50 | tide_kubectl_bg_color normal | ||
51 | tide_kubectl_color 326CE5 | ||
52 | tide_left_prompt_frame_enabled false | ||
53 | tide_left_prompt_items pwd git newline character | ||
54 | tide_left_prompt_prefix '' | ||
55 | tide_left_prompt_separator_diff_color ' ' | ||
56 | tide_left_prompt_separator_same_color ' ' | ||
57 | tide_left_prompt_suffix ' ' | ||
58 | tide_nix_shell_bg_color normal | ||
59 | tide_nix_shell_color 7EBAE4 | ||
60 | tide_node_bg_color normal | ||
61 | tide_node_color 44883E | ||
62 | tide_os_bg_color normal | ||
63 | tide_os_color normal | ||
64 | tide_php_bg_color normal | ||
65 | tide_php_color 617CBE | ||
66 | tide_private_mode_bg_color normal | ||
67 | tide_private_mode_color FFFFFF | ||
68 | tide_prompt_add_newline_before true | ||
69 | tide_prompt_color_frame_and_connection 6C6C6C | ||
70 | tide_prompt_color_separator_same_color 949494 | ||
71 | tide_prompt_min_cols 34 | ||
72 | tide_prompt_pad_items false | ||
73 | tide_prompt_transient_enabled false | ||
74 | tide_pulumi_bg_color normal | ||
75 | tide_pulumi_color F7BF2A | ||
76 | tide_pwd_bg_color normal | ||
77 | tide_pwd_color_anchors $_tide_color_light_blue | ||
78 | tide_pwd_color_dirs $_tide_color_dark_blue | ||
79 | tide_pwd_color_truncated_dirs 8787AF | ||
80 | 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 | ||
81 | tide_python_bg_color normal | ||
82 | tide_python_color 00AFAF | ||
83 | tide_right_prompt_frame_enabled false | ||
84 | 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 | ||
85 | tide_right_prompt_prefix ' ' | ||
86 | tide_right_prompt_separator_diff_color ' ' | ||
87 | tide_right_prompt_separator_same_color ' ' | ||
88 | tide_right_prompt_suffix '' | ||
89 | tide_ruby_bg_color normal | ||
90 | tide_ruby_color B31209 | ||
91 | tide_rustc_bg_color normal | ||
92 | tide_rustc_color F74C00 | ||
93 | tide_shlvl_bg_color normal | ||
94 | tide_shlvl_color d78700 | ||
95 | tide_shlvl_threshold 1 | ||
96 | tide_status_bg_color normal | ||
97 | tide_status_bg_color_failure normal | ||
98 | tide_status_color $_tide_color_dark_green | ||
99 | tide_status_color_failure D70000 | ||
100 | tide_terraform_bg_color normal | ||
101 | tide_terraform_color 844FBA | ||
102 | tide_time_bg_color normal | ||
103 | tide_time_color 5F8787 | ||
104 | tide_time_format %T | ||
105 | tide_toolbox_bg_color normal | ||
106 | tide_toolbox_color 613583 | ||
107 | tide_vi_mode_bg_color_default normal | ||
108 | tide_vi_mode_bg_color_insert normal | ||
109 | tide_vi_mode_bg_color_replace normal | ||
110 | tide_vi_mode_bg_color_visual normal | ||
111 | tide_vi_mode_color_default 949494 | ||
112 | tide_vi_mode_color_insert 87AFAF | ||
113 | tide_vi_mode_color_replace 87AF87 | ||
114 | tide_vi_mode_color_visual FF8700 | ||
115 | tide_zig_bg_color normal | ||
116 | tide_zig_color F7A41D | ||
diff --git a/home-config/fish/functions/tide/configure/configs/lean_16color.fish b/home-config/fish/functions/tide/configure/configs/lean_16color.fish new file mode 100644 index 0000000..16c2511 --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/lean_16color.fish | |||
@@ -0,0 +1,89 @@ | |||
1 | tide_aws_bg_color normal | ||
2 | tide_aws_color yellow | ||
3 | tide_character_color brgreen | ||
4 | tide_character_color_failure brred | ||
5 | tide_cmd_duration_bg_color normal | ||
6 | tide_cmd_duration_color brblack | ||
7 | tide_context_bg_color normal | ||
8 | tide_context_color_default yellow | ||
9 | tide_context_color_root bryellow | ||
10 | tide_context_color_ssh yellow | ||
11 | tide_crystal_bg_color normal | ||
12 | tide_crystal_color brwhite | ||
13 | tide_direnv_bg_color normal | ||
14 | tide_direnv_bg_color_denied normal | ||
15 | tide_direnv_color bryellow | ||
16 | tide_direnv_color_denied brred | ||
17 | tide_distrobox_bg_color normal | ||
18 | tide_distrobox_color brmagenta | ||
19 | tide_docker_bg_color normal | ||
20 | tide_docker_color blue | ||
21 | tide_elixir_bg_color normal | ||
22 | tide_elixir_color magenta | ||
23 | tide_gcloud_bg_color normal | ||
24 | tide_gcloud_color blue | ||
25 | tide_git_bg_color normal | ||
26 | tide_git_bg_color_unstable normal | ||
27 | tide_git_bg_color_urgent normal | ||
28 | tide_git_color_branch brgreen | ||
29 | tide_git_color_conflicted brred | ||
30 | tide_git_color_dirty bryellow | ||
31 | tide_git_color_operation brred | ||
32 | tide_git_color_staged bryellow | ||
33 | tide_git_color_stash brgreen | ||
34 | tide_git_color_untracked brblue | ||
35 | tide_git_color_upstream brgreen | ||
36 | tide_go_bg_color normal | ||
37 | tide_go_color brcyan | ||
38 | tide_java_bg_color normal | ||
39 | tide_java_color yellow | ||
40 | tide_jobs_bg_color normal | ||
41 | tide_jobs_color green | ||
42 | tide_kubectl_bg_color normal | ||
43 | tide_kubectl_color blue | ||
44 | tide_nix_shell_bg_color normal | ||
45 | tide_nix_shell_color brblue | ||
46 | tide_node_bg_color normal | ||
47 | tide_node_color green | ||
48 | tide_os_bg_color normal | ||
49 | tide_os_color brwhite | ||
50 | tide_php_bg_color normal | ||
51 | tide_php_color blue | ||
52 | tide_private_mode_bg_color normal | ||
53 | tide_private_mode_color brwhite | ||
54 | tide_prompt_color_frame_and_connection brblack | ||
55 | tide_prompt_color_separator_same_color brblack | ||
56 | tide_pulumi_bg_color normal | ||
57 | tide_pulumi_color yellow | ||
58 | tide_pwd_bg_color normal | ||
59 | tide_pwd_color_anchors brcyan | ||
60 | tide_pwd_color_dirs cyan | ||
61 | tide_pwd_color_truncated_dirs magenta | ||
62 | tide_python_bg_color normal | ||
63 | tide_python_color cyan | ||
64 | tide_ruby_bg_color normal | ||
65 | tide_ruby_color red | ||
66 | tide_rustc_bg_color normal | ||
67 | tide_rustc_color red | ||
68 | tide_shlvl_bg_color normal | ||
69 | tide_shlvl_color yellow | ||
70 | tide_status_bg_color normal | ||
71 | tide_status_bg_color_failure normal | ||
72 | tide_status_color green | ||
73 | tide_status_color_failure red | ||
74 | tide_terraform_bg_color normal | ||
75 | tide_terraform_color magenta | ||
76 | tide_time_bg_color normal | ||
77 | tide_time_color brblack | ||
78 | tide_toolbox_bg_color normal | ||
79 | tide_toolbox_color magenta | ||
80 | tide_vi_mode_bg_color_default normal | ||
81 | tide_vi_mode_bg_color_insert normal | ||
82 | tide_vi_mode_bg_color_replace normal | ||
83 | tide_vi_mode_bg_color_visual normal | ||
84 | tide_vi_mode_color_default white | ||
85 | tide_vi_mode_color_insert cyan | ||
86 | tide_vi_mode_color_replace green | ||
87 | tide_vi_mode_color_visual yellow | ||
88 | tide_zig_bg_color normal | ||
89 | tide_zig_color yellow | ||
diff --git a/home-config/fish/functions/tide/configure/configs/rainbow.fish b/home-config/fish/functions/tide/configure/configs/rainbow.fish new file mode 100644 index 0000000..60c1592 --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/rainbow.fish | |||
@@ -0,0 +1,116 @@ | |||
1 | tide_aws_bg_color FF9900 | ||
2 | tide_aws_color 232F3E | ||
3 | tide_character_color $_tide_color_green | ||
4 | tide_character_color_failure FF0000 | ||
5 | tide_cmd_duration_bg_color C4A000 | ||
6 | tide_cmd_duration_color 000000 | ||
7 | tide_cmd_duration_decimals 0 | ||
8 | tide_cmd_duration_threshold 3000 | ||
9 | tide_context_always_display false | ||
10 | tide_context_bg_color 444444 | ||
11 | tide_context_color_default D7AF87 | ||
12 | tide_context_color_root $_tide_color_gold | ||
13 | tide_context_color_ssh D7AF87 | ||
14 | tide_context_hostname_parts 1 | ||
15 | tide_crystal_bg_color FFFFFF | ||
16 | tide_crystal_color 000000 | ||
17 | tide_direnv_bg_color $_tide_color_gold | ||
18 | tide_direnv_bg_color_denied FF0000 | ||
19 | tide_direnv_color 000000 | ||
20 | tide_direnv_color_denied 000000 | ||
21 | tide_distrobox_bg_color FF00FF | ||
22 | tide_distrobox_color 000000 | ||
23 | tide_docker_bg_color 2496ED | ||
24 | tide_docker_color 000000 | ||
25 | tide_docker_default_contexts default colima | ||
26 | tide_elixir_bg_color 4E2A8E | ||
27 | tide_elixir_color 000000 | ||
28 | tide_gcloud_bg_color 4285F4 | ||
29 | tide_gcloud_color 000000 | ||
30 | tide_git_bg_color 4E9A06 | ||
31 | tide_git_bg_color_unstable C4A000 | ||
32 | tide_git_bg_color_urgent CC0000 | ||
33 | tide_git_color_branch 000000 | ||
34 | tide_git_color_conflicted 000000 | ||
35 | tide_git_color_dirty 000000 | ||
36 | tide_git_color_operation 000000 | ||
37 | tide_git_color_staged 000000 | ||
38 | tide_git_color_stash 000000 | ||
39 | tide_git_color_untracked 000000 | ||
40 | tide_git_color_upstream 000000 | ||
41 | tide_git_truncation_length 24 | ||
42 | tide_git_truncation_strategy | ||
43 | tide_go_bg_color 00ACD7 | ||
44 | tide_go_color 000000 | ||
45 | tide_java_bg_color ED8B00 | ||
46 | tide_java_color 000000 | ||
47 | tide_jobs_bg_color 444444 | ||
48 | tide_jobs_color 4E9A06 | ||
49 | tide_jobs_number_threshold 1000 | ||
50 | tide_kubectl_bg_color 326CE5 | ||
51 | tide_kubectl_color 000000 | ||
52 | tide_left_prompt_frame_enabled true | ||
53 | tide_left_prompt_items pwd git newline | ||
54 | tide_left_prompt_prefix '' | ||
55 | tide_left_prompt_separator_diff_color | ||
56 | tide_left_prompt_separator_same_color | ||
57 | tide_left_prompt_suffix | ||
58 | tide_nix_shell_bg_color 7EBAE4 | ||
59 | tide_nix_shell_color 000000 | ||
60 | tide_node_bg_color 44883E | ||
61 | tide_node_color 000000 | ||
62 | tide_os_bg_color $os_branding_bg_color | ||
63 | tide_os_color $os_branding_color | ||
64 | tide_php_bg_color 617CBE | ||
65 | tide_php_color 000000 | ||
66 | tide_private_mode_bg_color F1F3F4 | ||
67 | tide_private_mode_color 000000 | ||
68 | tide_prompt_add_newline_before true | ||
69 | tide_prompt_color_frame_and_connection 6C6C6C | ||
70 | tide_prompt_color_separator_same_color 949494 | ||
71 | tide_prompt_min_cols 34 | ||
72 | tide_prompt_pad_items true | ||
73 | tide_prompt_transient_enabled false | ||
74 | tide_pulumi_bg_color F7BF2A | ||
75 | tide_pulumi_color 000000 | ||
76 | tide_pwd_bg_color 3465A4 | ||
77 | tide_pwd_color_anchors E4E4E4 | ||
78 | tide_pwd_color_dirs E4E4E4 | ||
79 | tide_pwd_color_truncated_dirs BCBCBC | ||
80 | 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 | ||
81 | tide_python_bg_color 444444 | ||
82 | tide_python_color 00AFAF | ||
83 | tide_right_prompt_frame_enabled true | ||
84 | 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 | ||
85 | tide_right_prompt_prefix | ||
86 | tide_right_prompt_separator_diff_color | ||
87 | tide_right_prompt_separator_same_color | ||
88 | tide_right_prompt_suffix '' | ||
89 | tide_ruby_bg_color B31209 | ||
90 | tide_ruby_color 000000 | ||
91 | tide_rustc_bg_color F74C00 | ||
92 | tide_rustc_color 000000 | ||
93 | tide_shlvl_bg_color 808000 | ||
94 | tide_shlvl_color 000000 | ||
95 | tide_shlvl_threshold 1 | ||
96 | tide_status_bg_color 2E3436 | ||
97 | tide_status_bg_color_failure CC0000 | ||
98 | tide_status_color 4E9A06 | ||
99 | tide_status_color_failure FFFF00 | ||
100 | tide_terraform_bg_color 800080 | ||
101 | tide_terraform_color 000000 | ||
102 | tide_time_bg_color D3D7CF | ||
103 | tide_time_color 000000 | ||
104 | tide_time_format %T | ||
105 | tide_toolbox_bg_color 613583 | ||
106 | tide_toolbox_color 000000 | ||
107 | tide_vi_mode_bg_color_default 949494 | ||
108 | tide_vi_mode_bg_color_insert 87AFAF | ||
109 | tide_vi_mode_bg_color_replace 87AF87 | ||
110 | tide_vi_mode_bg_color_visual FF8700 | ||
111 | tide_vi_mode_color_default 000000 | ||
112 | tide_vi_mode_color_insert 000000 | ||
113 | tide_vi_mode_color_replace 000000 | ||
114 | tide_vi_mode_color_visual 000000 | ||
115 | tide_zig_bg_color F7A41D | ||
116 | tide_zig_color 000000 | ||
diff --git a/home-config/fish/functions/tide/configure/configs/rainbow_16color.fish b/home-config/fish/functions/tide/configure/configs/rainbow_16color.fish new file mode 100644 index 0000000..a040f58 --- /dev/null +++ b/home-config/fish/functions/tide/configure/configs/rainbow_16color.fish | |||
@@ -0,0 +1,93 @@ | |||
1 | tide_aws_bg_color yellow | ||
2 | tide_aws_color brblack | ||
3 | tide_character_color brgreen | ||
4 | tide_character_color_failure brred | ||
5 | tide_cmd_duration_bg_color yellow | ||
6 | tide_cmd_duration_color black | ||
7 | tide_context_bg_color brblack | ||
8 | tide_context_color_default yellow | ||
9 | tide_context_color_root yellow | ||
10 | tide_context_color_ssh yellow | ||
11 | tide_crystal_bg_color brwhite | ||
12 | tide_crystal_color black | ||
13 | tide_direnv_bg_color bryellow | ||
14 | tide_direnv_bg_color_denied brred | ||
15 | tide_direnv_color black | ||
16 | tide_direnv_color_denied black | ||
17 | tide_distrobox_bg_color brmagenta | ||
18 | tide_distrobox_color black | ||
19 | tide_docker_bg_color blue | ||
20 | tide_docker_color black | ||
21 | tide_elixir_bg_color magenta | ||
22 | tide_elixir_color black | ||
23 | tide_gcloud_bg_color blue | ||
24 | tide_gcloud_color black | ||
25 | tide_git_bg_color green | ||
26 | tide_git_bg_color_unstable yellow | ||
27 | tide_git_bg_color_urgent red | ||
28 | tide_git_color_branch black | ||
29 | tide_git_color_conflicted black | ||
30 | tide_git_color_dirty black | ||
31 | tide_git_color_operation black | ||
32 | tide_git_color_staged black | ||
33 | tide_git_color_stash black | ||
34 | tide_git_color_untracked black | ||
35 | tide_git_color_upstream black | ||
36 | tide_go_bg_color brcyan | ||
37 | tide_go_color black | ||
38 | tide_java_bg_color yellow | ||
39 | tide_java_color black | ||
40 | tide_jobs_bg_color brblack | ||
41 | tide_jobs_color green | ||
42 | tide_kubectl_bg_color blue | ||
43 | tide_kubectl_color black | ||
44 | tide_nix_shell_bg_color brblue | ||
45 | tide_nix_shell_color black | ||
46 | tide_node_bg_color green | ||
47 | tide_node_color black | ||
48 | tide_os_bg_color white | ||
49 | tide_os_color black | ||
50 | tide_php_bg_color blue | ||
51 | tide_php_color black | ||
52 | tide_private_mode_bg_color brwhite | ||
53 | tide_private_mode_color black | ||
54 | tide_prompt_color_frame_and_connection brblack | ||
55 | tide_prompt_color_separator_same_color brblack | ||
56 | tide_pulumi_bg_color yellow | ||
57 | tide_pulumi_color black | ||
58 | tide_pwd_bg_color blue | ||
59 | tide_pwd_color_anchors brwhite | ||
60 | tide_pwd_color_dirs brwhite | ||
61 | tide_pwd_color_truncated_dirs white | ||
62 | tide_python_bg_color brblack | ||
63 | tide_python_color cyan | ||
64 | tide_ruby_bg_color red | ||
65 | tide_ruby_color black | ||
66 | tide_rustc_bg_color red | ||
67 | tide_rustc_color black | ||
68 | tide_shlvl_bg_color yellow | ||
69 | tide_shlvl_color black | ||
70 | tide_status_bg_color black | ||
71 | tide_status_bg_color_failure red | ||
72 | tide_status_color green | ||
73 | tide_status_color_failure bryellow | ||
74 | tide_terraform_bg_color magenta | ||
75 | tide_terraform_color black | ||
76 | tide_time_bg_color white | ||
77 | tide_time_color black | ||
78 | tide_toolbox_bg_color magenta | ||
79 | tide_toolbox_color black | ||
80 | tide_vi_mode_bg_color_default white | ||
81 | tide_vi_mode_bg_color_insert cyan | ||
82 | tide_vi_mode_bg_color_replace green | ||
83 | tide_vi_mode_bg_color_visual yellow | ||
84 | tide_vi_mode_color_default black | ||
85 | tide_vi_mode_color_insert black | ||
86 | tide_vi_mode_color_replace black | ||
87 | tide_vi_mode_color_visual black | ||
88 | tide_vi_mode_icon_default D | ||
89 | tide_vi_mode_icon_insert I | ||
90 | tide_vi_mode_icon_replace R | ||
91 | tide_vi_mode_icon_visual V | ||
92 | tide_zig_bg_color yellow | ||
93 | tide_zig_color black | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish new file mode 100644 index 0000000..4661ab1 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_cache_variables.fish | |||
@@ -0,0 +1,41 @@ | |||
1 | function _fake_tide_cache_variables | ||
2 | # pwd | ||
3 | set_color -o $fake_tide_pwd_color_anchors | read -gx _fake_tide_color_anchors | ||
4 | set -gx _fake_tide_color_truncated_dirs "$(set_color $fake_tide_pwd_color_truncated_dirs)" | ||
5 | set -gx _fake_tide_reset_to_color_dirs (set_color normal -b $fake_tide_pwd_bg_color; set_color $fake_tide_pwd_color_dirs) | ||
6 | |||
7 | # git | ||
8 | contains git $fake_tide_left_prompt_items $fake_tide_right_prompt_items && | ||
9 | set -gx _fake_tide_location_color "$(set_color $fake_tide_git_color_branch)" | ||
10 | |||
11 | # private_mode | ||
12 | if contains private_mode $fake_tide_left_prompt_items $fake_tide_right_prompt_items && test -n "$fish_private_mode" | ||
13 | set -gx _fake_tide_private_mode | ||
14 | else | ||
15 | set -e _fake_tide_private_mode | ||
16 | end | ||
17 | |||
18 | # Same-color-separator color | ||
19 | set -gx _fake_tide_color_separator_same_color "$(set_color $fake_tide_prompt_color_separator_same_color)" | ||
20 | |||
21 | # two line prompt | ||
22 | if contains newline $fake_tide_left_prompt_items | ||
23 | set_color $fake_tide_prompt_color_frame_and_connection -b normal | read -gx _fake_tide_prompt_and_frame_color | ||
24 | else | ||
25 | set -e _fake_tide_prompt_and_frame_color | ||
26 | end | ||
27 | |||
28 | # newline before | ||
29 | if test "$fake_tide_prompt_add_newline_before" = true | ||
30 | set -g _fake_tide_add_newline '' | ||
31 | else | ||
32 | set -e _fake_tide_add_newline | ||
33 | end | ||
34 | |||
35 | # item padding | ||
36 | if test "$fake_tide_prompt_pad_items" = true | ||
37 | set -gx _fake_tide_pad ' ' | ||
38 | else | ||
39 | set -e _fake_tide_pad | ||
40 | end | ||
41 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish new file mode 100644 index 0000000..94892ec --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_character.fish | |||
@@ -0,0 +1,8 @@ | |||
1 | function _fake_tide_item_character | ||
2 | set_color $fake_tide_character_color | ||
3 | if contains newline $fake_tide_left_prompt_items || set -q _configure_transient | ||
4 | echo -ns $fake_tide_character_icon | ||
5 | else | ||
6 | echo -ns ' '$fake_tide_character_icon | ||
7 | end | ||
8 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish new file mode 100644 index 0000000..5aa13b2 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_cmd_duration.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _fake_tide_item_cmd_duration | ||
2 | _fake_tide_print_item cmd_duration $fake_tide_cmd_duration_icon' ' 5s | ||
3 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish new file mode 100644 index 0000000..fb5b957 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_git.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _fake_tide_item_git | ||
2 | _fake_tide_print_item git (set_color $fake_tide_git_color_branch) $fake_tide_git_icon' ' main | ||
3 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish new file mode 100644 index 0000000..c614bab --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_newline.fish | |||
@@ -0,0 +1,5 @@ | |||
1 | function _fake_tide_item_newline | ||
2 | set_color $prev_bg_color -b normal | ||
3 | var=fake_tide_"$_fake_tide_side"_prompt_suffix echo $$var | ||
4 | set -g add_prefix | ||
5 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish new file mode 100644 index 0000000..5255721 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_os.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _fake_tide_item_os | ||
2 | _fake_tide_print_item os $fake_tide_os_icon | ||
3 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish new file mode 100644 index 0000000..bbce0b5 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_item_time.fish | |||
@@ -0,0 +1,3 @@ | |||
1 | function _fake_tide_item_time | ||
2 | _fake_tide_print_item time (date +$fake_tide_time_format) | ||
3 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish new file mode 100644 index 0000000..30cd024 --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_print_item.fish | |||
@@ -0,0 +1,22 @@ | |||
1 | function _fake_tide_print_item -a item | ||
2 | var=fake_tide_"$item"_bg_color set -f item_bg_color $$var | ||
3 | |||
4 | if set -e add_prefix | ||
5 | set_color $item_bg_color -b normal | ||
6 | var=fake_tide_"$_fake_tide_side"_prompt_prefix echo -ns $$var | ||
7 | else if test "$item_bg_color" = "$prev_bg_color" | ||
8 | var=fake_tide_"$_fake_tide_side"_prompt_separator_same_color echo -ns $_fake_tide_color_separator_same_color$$var | ||
9 | else if test "$_fake_tide_side" = left | ||
10 | set_color $prev_bg_color -b $item_bg_color | ||
11 | echo -ns $fake_tide_left_prompt_separator_diff_color | ||
12 | else | ||
13 | set_color $item_bg_color -b $prev_bg_color | ||
14 | echo -ns $fake_tide_right_prompt_separator_diff_color | ||
15 | end | ||
16 | |||
17 | var=fake_tide_"$item"_color set_color $$var -b $item_bg_color | ||
18 | |||
19 | echo -ns $_fake_tide_pad $argv[2..] $_fake_tide_pad | ||
20 | |||
21 | set -g prev_bg_color $item_bg_color | ||
22 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish new file mode 100644 index 0000000..11f20ca --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_prompt.fish | |||
@@ -0,0 +1,42 @@ | |||
1 | function _fake_tide_prompt | ||
2 | set -g add_prefix | ||
3 | _fake_tide_side=left set -f left (for item in $fake_tide_left_prompt_items | ||
4 | _fake_tide_item_$item | ||
5 | end | ||
6 | if not set -e add_prefix | ||
7 | set_color $prev_bg_color -b normal | ||
8 | echo -ns $fake_tide_left_prompt_suffix | ||
9 | end) | ||
10 | |||
11 | set -g add_prefix | ||
12 | _fake_tide_side=right set -f right (for item in $fake_tide_right_prompt_items | ||
13 | _fake_tide_item_$item | ||
14 | end | ||
15 | if not set -e add_prefix | ||
16 | set_color $prev_bg_color -b normal | ||
17 | echo -ns $fake_tide_right_prompt_suffix | ||
18 | end) | ||
19 | |||
20 | if set -q _fake_tide_prompt_and_frame_color # If prompt is two lines | ||
21 | test "$fake_tide_left_prompt_frame_enabled" = true && | ||
22 | set left[1] "$_fake_tide_prompt_and_frame_color╭─$left[1]" && | ||
23 | set left[2] "$_fake_tide_prompt_and_frame_color╰─$left[2]" | ||
24 | test "$fake_tide_right_prompt_frame_enabled" = true && | ||
25 | set right[1] "$right[1]$_fake_tide_prompt_and_frame_color─╮" && | ||
26 | set right[2] "$right[2]$_fake_tide_prompt_and_frame_color─╯" | ||
27 | |||
28 | # 5 = @PWD@ length which will be replaced | ||
29 | math $fake_columns+5-(string length --visible "$left[1]$right[1]") | read -lx dist_btwn_sides | ||
30 | echo -ns "$right[2]"\n(string replace @PWD@ (_fake_tide_pwd) "$left[1]")$_fake_tide_prompt_and_frame_color | ||
31 | |||
32 | string repeat --no-newline --max (math max 0, $dist_btwn_sides-$_tide_pwd_len) $fake_tide_prompt_icon_connection | ||
33 | echo -ns "$right[1]"\n"$left[2] " | ||
34 | else | ||
35 | math $fake_columns+5-(string length --visible "$left[1]$right[1]") -$fake_tide_prompt_min_cols | read -lx dist_btwn_sides | ||
36 | string replace @PWD@ (_fake_tide_pwd) "$right[1]" "$left[1] " | ||
37 | end | ||
38 | end | ||
39 | |||
40 | function _fake_tide_item_pwd | ||
41 | _fake_tide_print_item pwd @PWD@ | ||
42 | end | ||
diff --git a/home-config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish b/home-config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish new file mode 100644 index 0000000..433eafa --- /dev/null +++ b/home-config/fish/functions/tide/configure/functions/_fake_tide_pwd.fish | |||
@@ -0,0 +1,11 @@ | |||
1 | function _fake_tide_pwd | ||
2 | set -l out ( | ||
3 | set_color $fake_tide_pwd_color_dirs | ||
4 | echo -ns $fake_tide_pwd_icon' ' '~/' | ||
5 | set_color -o $fake_tide_pwd_color_anchors | ||
6 | echo -ns src | ||
7 | set_color normal -b $fake_tide_pwd_bg_color | ||
8 | ) | ||
9 | set -g _tide_pwd_len (string length --visible $out) | ||
10 | echo -ns $out | ||
11 | end | ||
diff --git a/home-config/fish/functions/tide/configure/icons.fish b/home-config/fish/functions/tide/configure/icons.fish new file mode 100644 index 0000000..70611cd --- /dev/null +++ b/home-config/fish/functions/tide/configure/icons.fish | |||
@@ -0,0 +1,40 @@ | |||
1 | tide_aws_icon # Actual aws glyph is harder to see | ||
2 | tide_character_icon ❯ | ||
3 | tide_character_vi_icon_default ❮ | ||
4 | tide_character_vi_icon_replace ▶ | ||
5 | tide_character_vi_icon_visual V | ||
6 | tide_cmd_duration_icon | ||
7 | tide_crystal_icon | ||
8 | tide_direnv_icon ▼ | ||
9 | tide_distrobox_icon | ||
10 | tide_docker_icon | ||
11 | tide_elixir_icon | ||
12 | tide_gcloud_icon # Actual google cloud glyph is harder to see | ||
13 | tide_git_icon | ||
14 | tide_go_icon | ||
15 | tide_java_icon | ||
16 | tide_jobs_icon | ||
17 | tide_kubectl_icon | ||
18 | tide_nix_shell_icon | ||
19 | tide_node_icon # Actual nodejs glyph is harder to see | ||
20 | tide_os_icon $os_branding_icon | ||
21 | tide_php_icon | ||
22 | tide_private_mode_icon | ||
23 | tide_prompt_icon_connection ' ' | ||
24 | tide_pulumi_icon | ||
25 | tide_pwd_icon | ||
26 | tide_pwd_icon_home | ||
27 | tide_pwd_icon_unwritable | ||
28 | tide_python_icon | ||
29 | tide_ruby_icon | ||
30 | tide_rustc_icon | ||
31 | tide_shlvl_icon | ||
32 | tide_status_icon ✔ | ||
33 | tide_status_icon_failure ✘ | ||
34 | tide_terraform_icon | ||
35 | tide_toolbox_icon | ||
36 | tide_vi_mode_icon_default D | ||
37 | tide_vi_mode_icon_insert I | ||
38 | tide_vi_mode_icon_replace R | ||
39 | tide_vi_mode_icon_visual V | ||
40 | tide_zig_icon | ||
diff --git a/home-config/home-configuration.scm b/home-config/home-configuration.scm index 06b3d96..4dac5b1 100644 --- a/home-config/home-configuration.scm +++ b/home-config/home-configuration.scm | |||
@@ -34,6 +34,8 @@ | |||
34 | ;; Below is the list of packages that will show up in your | 34 | ;; Below is the list of packages that will show up in your |
35 | ;; Home profile, under ~/.guix-home/profile. | 35 | ;; Home profile, under ~/.guix-home/profile. |
36 | (packages (append (specifications->packages (list "bat" | 36 | (packages (append (specifications->packages (list "bat" |
37 | "fd" | ||
38 | "fish" | ||
37 | "xdg-utils" | 39 | "xdg-utils" |
38 | "abook" | 40 | "abook" |
39 | "libnotify" | 41 | "libnotify" |
@@ -138,6 +140,10 @@ | |||
138 | ("sway" ,(local-file "sway" #:recursive? #t)) | 140 | ("sway" ,(local-file "sway" #:recursive? #t)) |
139 | ("hypr" ,(local-file "hypr" #:recursive? #t)) | 141 | ("hypr" ,(local-file "hypr" #:recursive? #t)) |
140 | ("foot" ,(local-file "foot" #:recursive? #t)) | 142 | ("foot" ,(local-file "foot" #:recursive? #t)) |
143 | ("fish/completions" ,(local-file "fish/completions" #:recursive? #t)) | ||
144 | ("fish/conf.d" ,(local-file "fish/conf.d" #:recursive? #t)) | ||
145 | ("fish/fish_plugins" ,(local-file "fish/fish_plugins")) | ||
146 | ("fish/functions" ,(local-file "fish/functions" #:recursive? #t)) | ||
141 | ("pulse/client.conf" ,(local-file "pulseaudio/client.conf")) | 147 | ("pulse/client.conf" ,(local-file "pulseaudio/client.conf")) |
142 | ("waybar" ,(local-file "waybar" #:recursive? #t)) | 148 | ("waybar" ,(local-file "waybar" #:recursive? #t)) |
143 | ("alacritty" ,(local-file "alacritty" #:recursive? #t)) | 149 | ("alacritty" ,(local-file "alacritty" #:recursive? #t)) |