mirror of
https://github.com/kp2pml30/dotfiles.git
synced 2026-02-16 23:34:42 +04:00
update
This commit is contained in:
parent
5d8c6dd080
commit
f2f4ead62f
7 changed files with 9317 additions and 6 deletions
|
|
@ -1,19 +1,43 @@
|
|||
function __scrap_select
|
||||
for cmd in $argv
|
||||
if command -v "$cmd" 2> /dev/null > /dev/null
|
||||
command -v "$cmd"
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function 'scrap-default-tool-paths'
|
||||
env > /tmp/env-before
|
||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||
set -le NP
|
||||
for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.bin" "$HOME/.ghcup/bin" "$HOME/.cabal/bin"
|
||||
for dir in "$HOME/.cargo/bin" "$HOME/.local/bin" "$HOME/.bin" "$HOME/.ghcup/bin" "$HOME/.cabal/bin" "$HOME/go/bin" "$HOME/.pyenv/bin"
|
||||
if test -d "$dir"
|
||||
echo "$dir exists"
|
||||
set -a NP "$dir"
|
||||
if test -n "$NP"
|
||||
set NP "$NP:$dir"
|
||||
else
|
||||
set NP "$dir"
|
||||
end
|
||||
end
|
||||
end
|
||||
echo "found path is $NP"
|
||||
set -U KP2PATH "$NP"
|
||||
set -l OLDP "$PATH"
|
||||
set PATH "$NP:$PATH"
|
||||
|
||||
set -l IFS ''
|
||||
set -le COMPLETIONS
|
||||
if command -v poetry > /dev/null
|
||||
set -l out (poetry completions fish)
|
||||
IFS='' set -l out (poetry completions fish)
|
||||
set COMPLETIONS "$COMPLETIONS"\n"$out"
|
||||
end
|
||||
set -U KP2COMPLETIONS "$COMPLETIONS"
|
||||
IFS='' set -U KP2COMPLETIONS "$COMPLETIONS"
|
||||
set -Ux EDITOR (__scrap_select nvim vim vi)
|
||||
set -Ux PAGER (__scrap_select less more)
|
||||
set -Ux GIT_EDITOR "$EDITOR"
|
||||
|
||||
set PATH "$OLDP"
|
||||
env > /tmp/env-after
|
||||
diff /tmp/env-before /tmp/env-after
|
||||
rm /tmp/env-after /tmp/env-before
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue