From a8b7e972ead8df887f06537ccc017fe556f43fd3 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Fri, 12 Apr 2024 23:09:46 -0400 Subject: [PATCH] added zoxide helper plugin --- home-config/fish/conf.d/zoxide.fish | 26 +++++++++++++++++++ home-config/fish/config.fish | 2 -- home-config/fish/fish_plugins | 1 + home-config/fish/fish_variables | 7 ++--- home-config/fish/functions/__zoxide_cd.fish | 6 +++++ home-config/fish/functions/__zoxide_pwd.fish | 7 +++++ home-config/fish/functions/__zoxide_z.fish | 13 ++++++++++ .../fish/functions/__zoxide_z_complete.fish | 15 +++++++++++ home-config/fish/functions/__zoxide_zi.fish | 4 +++ 9 files changed, 76 insertions(+), 5 deletions(-) create mode 100644 home-config/fish/conf.d/zoxide.fish create mode 100644 home-config/fish/functions/__zoxide_cd.fish create mode 100644 home-config/fish/functions/__zoxide_pwd.fish create mode 100644 home-config/fish/functions/__zoxide_z.fish create mode 100644 home-config/fish/functions/__zoxide_z_complete.fish create mode 100644 home-config/fish/functions/__zoxide_zi.fish diff --git a/home-config/fish/conf.d/zoxide.fish b/home-config/fish/conf.d/zoxide.fish new file mode 100644 index 0000000..169e2af --- /dev/null +++ b/home-config/fish/conf.d/zoxide.fish @@ -0,0 +1,26 @@ +if ! status is-interactive || + ! command --query zoxide + exit +end + +functions --query __zoxide_cd_internal || functions --copy cd __zoxide_cd_internal + +set --query zoxide_hook || set --local zoxide_hook --on-variable PWD +if test -n "$zoxide_hook" + function __zoxide_hook $zoxide_hook + test -z "$fish_private_mode" + and command zoxide add -- (__zoxide_pwd) + end +end + +set --query zoxide_cmd || set --local zoxide_cmd z +if test -n "$zoxide_cmd" + function $zoxide_cmd + __zoxide_z $argv + end + complete $zoxide_cmd --no-files -a '(__zoxide_z_complete)' + + function "$zoxide_cmd"i + __zoxide_zi $argv + end +end diff --git a/home-config/fish/config.fish b/home-config/fish/config.fish index c842712..c0e2977 100644 --- a/home-config/fish/config.fish +++ b/home-config/fish/config.fish @@ -29,6 +29,4 @@ if status is-interactive alias grep "grep --color=auto" alias ll "ls -l" - zoxide init fish | source - end diff --git a/home-config/fish/fish_plugins b/home-config/fish/fish_plugins index 32f71ac..0adf3cd 100644 --- a/home-config/fish/fish_plugins +++ b/home-config/fish/fish_plugins @@ -3,3 +3,4 @@ ilancosman/tide@v6 patrickf1/fzf.fish lilyball/nix-env.fish oh-my-fish/plugin-foreign-env +kidonng/zoxide.fish diff --git a/home-config/fish/fish_variables b/home-config/fish/fish_variables index 3b9e6d7..50675b7 100644 --- a/home-config/fish/fish_variables +++ b/home-config/fish/fish_variables @@ -4,18 +4,18 @@ SETUVAR VIRTUAL_ENV_DISABLE_PROMPT:true SETUVAR __fish_initialized:3400 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 SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish +SETUVAR _fisher_kidonng_2F_zoxide_2E_fish_files:\x7e/\x2econfig/fish/functions/__zoxide_cd\x2efish\x1e\x7e/\x2econfig/fish/functions/__zoxide_pwd\x2efish\x1e\x7e/\x2econfig/fish/functions/__zoxide_z\x2efish\x1e\x7e/\x2econfig/fish/functions/__zoxide_z_complete\x2efish\x1e\x7e/\x2econfig/fish/functions/__zoxide_zi\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/zoxide\x2efish SETUVAR _fisher_lilyball_2F_nix_2D_env_2E_fish_files:\x7e/\x2econfig/fish/conf\x2ed/nix\x2denv\x2efish SETUVAR _fisher_oh_2D_my_2D_fish_2F_plugin_2D_foreign_2D_env_files:\x7e/\x2econfig/fish/functions/fenv\x2efish\x1e\x7e/\x2econfig/fish/functions/fenv\x2emain\x2efish 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 -SETUVAR _fisher_plugins:jorgebucaran/fisher\x1eilancosman/tide\x40v6\x1epatrickf1/fzf\x2efish\x1elilyball/nix\x2denv\x2efish\x1eoh\x2dmy\x2dfish/plugin\x2dforeign\x2denv +SETUVAR _fisher_plugins:jorgebucaran/fisher\x1eilancosman/tide\x40v6\x1epatrickf1/fzf\x2efish\x1elilyball/nix\x2denv\x2efish\x1eoh\x2dmy\x2dfish/plugin\x2dforeign\x2denv\x1ekidonng/zoxide\x2efish SETUVAR _fisher_upgraded_to_4_4:\x1d SETUVAR _tide_left_items:pwd\x1egit\x1enewline\x1echaracter -SETUVAR _tide_prompt_1179:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5b90m\ue0b1\x1b\x5b40m\x20\x1b\x5b37m\x1b\x5b33mmain\x1b\x5b31m\x1b\x5b33m\x1b\x5b33m\x20\x2a1\x1b\x5b31m\x1b\x5b33m\x1b\x5b33m\x20\x216\x1b\x5b36m\x20\x3f2\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5b33m\u276f\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b90m\x1b\x5b40m\x2023\x3a04\x3a41\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m +SETUVAR _tide_prompt_1179:\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\x1b\x5b40m\x20\x40PWD\x40\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b0\x1e\x1b\x5b33m\u276f\x1e\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m\ue0b2\x1b\x5b90m\x1b\x5b40m\x2023\x3a06\x3a30\x20\x1b\x5bm\x0f\x1b\x5bm\x0f\x1b\x5b30m SETUVAR _tide_prompt_12416:\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\x2021\x3a38\x3a53\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_12595:\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\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2026s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2021\x3a24\x3a15\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_13884:\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\x20\u21e11\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\x212\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\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2024m\x202s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2017\x3a08\x3a10\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_14976:\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\x3b0mmaster\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b95\x3b215\x3b0m\x1b\x5b38\x3b2\x3b255\x3b0\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\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\x3b255\x3b0\x3b0m\u276f\x1e\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m\ue0b2\x1b\x5b38\x3b2\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x202h\x2025m\x2019s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b68\x3b136\x3b62m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x20\ue24f\x2018\x2e19\x2e0\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2020\x3a47\x3a02\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m -SETUVAR _tide_prompt_1541:\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\x20\x2b8\x1b\x5b38\x3b2\x3b215\x3b175\x3b0m\x20\x211\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\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\x2023\x3a05\x3a08\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_17673:\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\x2011\x3a24\x3a10\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_18208:\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\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2037s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2022\x3a57\x3a20\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_18590:\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\x2015\x3a38\x3a52\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m @@ -34,6 +34,7 @@ SETUVAR _tide_prompt_29676:\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x SETUVAR _tide_prompt_2970:\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\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2024s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2019\x3a56\x3a35\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_29929:\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\x2022\x3a13\x3a03\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_30328:\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\x3b135\x3b135\x3b95m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x202m\x208s\x20\x1b\x5b38\x3b2\x3b148\x3b148\x3b148m\ue0b3\x1b\x5b38\x3b2\x3b95\x3b135\x3b135m\x1b\x5b48\x3b2\x3b48\x3b48\x3b48m\x2022\x3a26\x3a45\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m +SETUVAR _tide_prompt_4873:\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\x213\x1b\x5b38\x3b2\x3b0\x3b175\x3b255m\x20\x3f6\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\x2023\x3a09\x3a43\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_6060:\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\x2020\x3a10\x3a57\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_7930:\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\x2015\x3a20\x3a57\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m SETUVAR _tide_prompt_8003:\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\x2015\x3a20\x3a59\x20\x1b\x28B\x1b\x5bm\x1b\x28B\x1b\x5bm\x1b\x5b38\x3b2\x3b48\x3b48\x3b48m diff --git a/home-config/fish/functions/__zoxide_cd.fish b/home-config/fish/functions/__zoxide_cd.fish new file mode 100644 index 0000000..d5a8b2b --- /dev/null +++ b/home-config/fish/functions/__zoxide_cd.fish @@ -0,0 +1,6 @@ +function __zoxide_cd + __zoxide_cd_internal $argv + if test "$_ZO_ECHO" = 1 + __zoxide_pwd + end +end diff --git a/home-config/fish/functions/__zoxide_pwd.fish b/home-config/fish/functions/__zoxide_pwd.fish new file mode 100644 index 0000000..49f9357 --- /dev/null +++ b/home-config/fish/functions/__zoxide_pwd.fish @@ -0,0 +1,7 @@ +function __zoxide_pwd + if test "$_ZO_RESOLVE_SYMLINKS" = 1 + builtin pwd -P + else + builtin pwd -L + end +end diff --git a/home-config/fish/functions/__zoxide_z.fish b/home-config/fish/functions/__zoxide_z.fish new file mode 100644 index 0000000..bb24f69 --- /dev/null +++ b/home-config/fish/functions/__zoxide_z.fish @@ -0,0 +1,13 @@ +function __zoxide_z + set --local argc (count $argv) + if test $argc -eq 0 + __zoxide_cd $HOME + else if test "$argv" = - + __zoxide_cd - + else if test $argc -eq 1 -a -d $argv[1] + __zoxide_cd $argv[1] + else + set --local result (command zoxide query --exclude (__zoxide_pwd) -- $argv) + and __zoxide_cd $result + end +end diff --git a/home-config/fish/functions/__zoxide_z_complete.fish b/home-config/fish/functions/__zoxide_z_complete.fish new file mode 100644 index 0000000..9e6196f --- /dev/null +++ b/home-config/fish/functions/__zoxide_z_complete.fish @@ -0,0 +1,15 @@ +function __zoxide_z_complete + set --local tokens (commandline --current-process --tokenize) + set --local curr_tokens (commandline --cut-at-cursor --current-process --tokenize) + + if test (count $tokens) -le 2 -a (count $curr_tokens) -eq 1 + # If there are < 2 arguments, use `cd` completions. + __fish_complete_directories "$tokens[2]" '' + else if test (count $tokens) -eq (count $curr_tokens) + # If the last argument is empty, use interactive selection. + set --local query $tokens[2..-1] + set --local result (zoxide query --interactive -- $query) + commandline --current-process "$tokens[1] "(string escape $result) + commandline --function repaint + end +end diff --git a/home-config/fish/functions/__zoxide_zi.fish b/home-config/fish/functions/__zoxide_zi.fish new file mode 100644 index 0000000..35837ac --- /dev/null +++ b/home-config/fish/functions/__zoxide_zi.fish @@ -0,0 +1,4 @@ +function __zoxide_zi + set --local result (command zoxide query --interactive -- $argv) + and __zoxide_cd $result +end