diff --git a/README.md b/README.md new file mode 100644 index 0000000..a1ab5da --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +fish `scrap-default-tool-paths` to update paths and completions (persists after a restart) diff --git a/home/.config/fish/config.fish b/home/.config/fish/config.fish index 837d038..8cc593e 100644 --- a/home/.config/fish/config.fish +++ b/home/.config/fish/config.fish @@ -32,18 +32,18 @@ if status is-interactive zoxide init fish | source end end -if command -v poetry > /dev/null - poetry completions fish | source -end -if test -f ~/.ghcup/env - bass source ~/.ghcup/env -end -if test -x ~/.rbenv/bin/rbenv - ~/.rbenv/bin/rbenv init - fish | source -end -if test -f ~/.opam/opam-init/init.fish - source ~/.opam/opam-init/init.fish -end +#if test -f ~/.ghcup/env +# bass source ~/.ghcup/env +#end +#if test -x ~/.rbenv/bin/rbenv +# ~/.rbenv/bin/rbenv init - fish | source +#end +#if test -f ~/.opam/opam-init/init.fish +# source ~/.opam/opam-init/init.fish +#end alias clear="printf '\033[2J\033[3J\033[1;1H'" -export PATH="$PATH:$HOME/.bin:$HOME/.local/bin" +export PATH="$PATH:$KP2PATH" +if set -uq KP2COMPLETIONS + eval "$KP2COMPLETIONS" +end bass source ~/.bashrc diff --git a/home/.config/fish/functions/scrap-default-tool-paths.fish b/home/.config/fish/functions/scrap-default-tool-paths.fish new file mode 100644 index 0000000..2dbe2e5 --- /dev/null +++ b/home/.config/fish/functions/scrap-default-tool-paths.fish @@ -0,0 +1,19 @@ +function 'scrap-default-tool-paths' + set -le NP + for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.bin" "$HOME/.ghcup/bin" "$HOME/.cabal/bin" + if test -d "$dir" + echo "$dir exists" + set -a NP "$dir" + end + end + echo "found path is $NP" + set -U KP2PATH "$NP" + + set -l IFS '' + set -le COMPLETIONS + if command -v poetry > /dev/null + set -l out (poetry completions fish) + set COMPLETIONS "$COMPLETIONS"\n"$out" + end + set -U KP2COMPLETIONS "$COMPLETIONS" +end