diff --git a/fish/.config/fish/conf.d/fzf.fish b/fish/.config/fish/conf.d/fzf.fish index 8156c11..446dd3c 100644 --- a/fish/.config/fish/conf.d/fzf.fish +++ b/fish/.config/fish/conf.d/fzf.fish @@ -9,7 +9,6 @@ end # This variable is global so that it can be referenced by fzf_configure_bindings and in tests set --global _fzf_search_vars_command '_fzf_search_variables (set --show | psub) (set --names | psub)' - # Install the default bindings, which are mnemonic and minimally conflict with fish's preset bindings fzf_configure_bindings diff --git a/fish/.config/fish/fish_variables b/fish/.config/fish/fish_variables index 683d4ca..6012247 100644 --- a/fish/.config/fish/fish_variables +++ b/fish/.config/fish/fish_variables @@ -1,7 +1,7 @@ # This file contains fish universal variable definitions. # VERSION: 3.0 SETUVAR --export FZF_DEFAULT_OPTS:\x2d\x2dcolor\x3dbg\x2b\x3a\x23313244\x2cbg\x3a\x231e1e2e\x2cspinner\x3a\x23f5e0dc\x2chl\x3a\x23f38ba8\x20\x2d\x2dcolor\x3dfg\x3a\x23cdd6f4\x2cheader\x3a\x23f38ba8\x2cinfo\x3a\x23cba6f7\x2cpointer\x3a\x23f5e0dc\x20\x2d\x2dcolor\x3dmarker\x3a\x23f5e0dc\x2cfg\x2b\x3a\x23cdd6f4\x2cprompt\x3a\x23cba6f7\x2chl\x2b\x3a\x23f38ba8 -SETUVAR --export GPG_TTY:not\x20a\x20tty +SETUVAR --export GPG_TTY:/dev/pts/0 SETUVAR --export SSH_AGENT_PID:786479 SETUVAR --export SSH_AUTH_SOCK:/home/wball/\x2ebitwarden\x2dssh\x2dagent\x2esock SETUVAR ZO_CMD:zo diff --git a/fish/.config/fish/functions/_fzf_extract_var_info.fish b/fish/.config/fish/functions/_fzf_extract_var_info.fish index dd4e952..34a4b44 100644 --- a/fish/.config/fish/functions/_fzf_extract_var_info.fish +++ b/fish/.config/fish/functions/_fzf_extract_var_info.fish @@ -3,10 +3,8 @@ function _fzf_extract_var_info --argument-names variable_name set_show_output -- # Extract only the lines about the variable, all of which begin with either # $variable_name: ...or... $variable_name[ string match --regex "^\\\$$variable_name(?::|\[).*" <$set_show_output | - # Strip the variable name prefix, including ": " for scope info lines string replace --regex "^\\\$$variable_name(?:: )?" '' | - # Distill the lines of values, replacing... # [1]: |value| # ...with... diff --git a/fish/.config/fish/functions/_fzf_search_directory.fish b/fish/.config/fish/functions/_fzf_search_directory.fish index 4541eec..b00c34a 100644 --- a/fish/.config/fish/functions/_fzf_search_directory.fish +++ b/fish/.config/fish/functions/_fzf_search_directory.fish @@ -24,7 +24,6 @@ function _fzf_search_directory --description "Search the current directory. Repl set -f file_paths_selected ($fd_cmd 2>/dev/null | _fzf_wrapper $fzf_arguments) end - if test $status -eq 0 commandline --current-token --replace -- (string escape -- $file_paths_selected | string join ' ') end diff --git a/fish/.config/fish/functions/fisher.fish b/fish/.config/fish/functions/fisher.fish index e915cb8..4f5be4f 100644 --- a/fish/.config/fish/functions/fisher.fish +++ b/fish/.config/fish/functions/fisher.fish @@ -1,17 +1,18 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" set --query fisher_path || set --local fisher_path $__fish_config_dir - set --local fisher_version 4.4.5 + set --local fisher_version 4.4.8 set --local fish_plugins $__fish_config_dir/fish_plugins switch "$cmd" case -v --version echo "fisher, version $fisher_version" case "" -h --help - echo "Usage: fisher install Install plugins" - echo " fisher remove Remove installed plugins" - echo " fisher update Update installed plugins" - echo " fisher update Update all installed plugins" - echo " fisher list [] List installed plugins matching regex" + echo "Usage: fisher install Install plugins" + echo " fisher remove Remove installed plugins" + echo " fisher uninstall Remove installed plugins (alias)" + echo " fisher update Update installed plugins" + echo " fisher update Update all installed plugins" + echo " fisher list [] List installed plugins matching regex" echo "Options:" echo " -v, --version Print version" echo " -h, --help Print this help message" @@ -19,9 +20,11 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" echo " \$fisher_path Plugin installation path. Default: $__fish_config_dir" | string replace --regex -- $HOME \~ case ls list string match --entire --regex -- "$argv[2]" $_fisher_plugins - case install update remove + case install update remove uninstall isatty || read --local --null --array stdin && set --append argv $stdin + test "$cmd" = uninstall && set cmd remove + set --local install_plugins set --local update_plugins set --local remove_plugins @@ -38,6 +41,8 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" echo "fisher: \"$fish_plugins\" file not found: \"$cmd\"" >&2 && return 1 end set arg_plugins $file_plugins + else if test "$cmd" = install && ! set --query old_plugins[1] + set --append arg_plugins $file_plugins end for plugin in $arg_plugins @@ -86,6 +91,7 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" if test -e $plugin command cp -Rf $plugin/* $source else + set resp (command mktemp) set temp (command mktemp -d) set repo (string split -- \@ $plugin) || set repo[2] HEAD @@ -98,8 +104,13 @@ function fisher --argument-names cmd --description "A plugin manager for Fish" echo Fetching (set_color --underline)\$url(set_color normal) - if command curl -q --silent -L \$url | command tar -xzC \$temp -f - 2>/dev/null + set http (command curl -q --silent -L -o \$resp -w %{http_code} \$url) + + if test \"\$http\" = 200 && command tar -xzC \$temp -f \$resp 2>/dev/null command cp -Rf \$temp/*/* $source + else if test \"\$http\" = 403 + echo fisher: GitHub API rate limit exceeded \(HTTP 403\) >&2 + command rm -rf $source else echo fisher: Invalid plugin name or host unavailable: \\\"$plugin\\\" >&2 command rm -rf $source