mirror of
https://github.com/gyoder/dots.git
synced 2026-09-01 02:35:50 +00:00
multiple: changes to multiple configs
This commit is contained in:
parent
10c80394a7
commit
fef08c2efa
9 changed files with 90 additions and 69 deletions
|
|
@ -1 +1 @@
|
|||
source "$HOME/.cargo/env.fish"
|
||||
# source "$HOME/.cargo/env.fish"
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
set host (hostname)
|
||||
|
||||
if string match -q "*turing*" "$host"
|
||||
set -x PATH /Users/scie/.local/nvim-macos-arm64/bin \
|
||||
/opt/homebrew/Cellar/universal-ctags/HEAD-43ca055/bin \
|
||||
/Users/scie/.local/xonsh-env/xbin \
|
||||
/Users/scie/.local/xonsh-env/xbin \
|
||||
if string match -q Darwin (uname)
|
||||
set -x PATH ~/.local/nvim-macos-arm64/bin \
|
||||
/opt/homebrew/opt/uutils-coreutils/libexec/uubin \
|
||||
~/.local/xonsh-env/xbin \
|
||||
~/.local/xonsh-env/xbin \
|
||||
/opt/homebrew/opt/icu4c@76/sbin \
|
||||
/opt/homebrew/opt/icu4c@76/bin \
|
||||
/opt/homebrew/opt/llvm/bin \
|
||||
/Users/scie/.dotnet/tools \
|
||||
/Users/scie/.local/bin \
|
||||
/Users/scie/Library/Python/3.9/bin \
|
||||
/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/emulators \
|
||||
~/.dotnet/tools \
|
||||
~/.local/bin \
|
||||
~/Library/Python/3.9/bin \
|
||||
/opt/homebrew/bin/iodine \
|
||||
/opt/homebrew/bin \
|
||||
/opt/homebrew/opt/zig@0.14/bin \
|
||||
/Users/scie/.platformio/penv/bin/ \
|
||||
/Users/scie/.cargo/bin \
|
||||
/Users/scie/.local/xonsh-env/xbin \
|
||||
/Users/scie/go/bin \
|
||||
~/.platformio/penv/bin/ \
|
||||
~/.cargo/bin \
|
||||
~/.local/xonsh-env/xbin \
|
||||
~/go/bin \
|
||||
/usr/bin \
|
||||
/usr/local/bin \
|
||||
/usr/sbin \
|
||||
/usr/local/sbin \
|
||||
/bin \
|
||||
/sbin
|
||||
/sbin \
|
||||
$PATH
|
||||
else if test "$host" = lovelace
|
||||
set -x PATH /home/scie/.local/bin \
|
||||
/home/linuxbrew/.linuxbrew/bin \
|
||||
|
|
|
|||
4
fish/.config/fish/functions/ask.fish
Normal file
4
fish/.config/fish/functions/ask.fish
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
function ask --description "Ask for input and respond with input"
|
||||
read -s -P "Enter Input: " response
|
||||
echo $response
|
||||
end
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
# Copilot Generated
|
||||
function load_env --description 'Load environment variables from a .env file (defaults to ./.env)'
|
||||
set -l env_file ".env"
|
||||
if test (count $argv) -gt 0
|
||||
set env_file $argv[1]
|
||||
end
|
||||
|
||||
if not test -f "$env_file"
|
||||
echo "Error: Environment file not found: $env_file" >&2
|
||||
return 1
|
||||
end
|
||||
|
||||
for line in (cat -- "$env_file")
|
||||
set -l trimmed (string trim -- "$line")
|
||||
# Skip empty lines and comments
|
||||
if test -z "$trimmed"; or string match -q -r "^\s*#" -- "$trimmed"
|
||||
continue
|
||||
end
|
||||
|
||||
# Only process lines with =
|
||||
if not string match -q -- '*=*' "$trimmed"
|
||||
continue
|
||||
end
|
||||
|
||||
# Use regex to extract key and value, and preserve quotes in value
|
||||
set -l key (string match -r '^[^=]+' "$trimmed")
|
||||
set -l rest (string match -r '=[\s\S]*$' "$trimmed")
|
||||
|
||||
if test -z "$key" -o -z "$rest"
|
||||
continue
|
||||
end
|
||||
|
||||
set -l key (string trim -- "$key")
|
||||
set -l value (string trim -- (string sub -s 2 -- "$rest")) # Remove leading '='
|
||||
|
||||
# Validate variable name
|
||||
if not string match -q -r '^[a-zA-Z_][a-zA-Z0-9_]*$' "$key"
|
||||
echo "Warning: Invalid variable name '$key'. Skipping."
|
||||
continue
|
||||
end
|
||||
|
||||
# Reconstruct assignment and use eval to preserve value as-is
|
||||
eval "set -gx $key $value"
|
||||
end
|
||||
end
|
||||
3
fish/.config/fish/functions/pysource.fish
Normal file
3
fish/.config/fish/functions/pysource.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function pysource --wraps='source .venv/bin/activate.fish' --description 'alias pysource=source .venv/bin/activate.fish'
|
||||
source .venv/bin/activate.fish $argv
|
||||
end
|
||||
3
fish/.config/fish/functions/tcl.fish
Normal file
3
fish/.config/fish/functions/tcl.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function tcl --wraps='clear && clear' --description 'alias tcl=clear && clear'
|
||||
clear && clear $argv
|
||||
end
|
||||
3
fish/.config/fish/functions/tclear.fish
Normal file
3
fish/.config/fish/functions/tclear.fish
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
function tclear --wraps='clear && clear' --description 'alias tclear=clear && clear'
|
||||
clear && clear $argv
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue