Skip to content

Commit

Permalink
Update fish configs
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAbdi committed Sep 7, 2024
1 parent 054947b commit d94e63e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
10 changes: 8 additions & 2 deletions fish/conf.d/installs.fish
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@ end
function install-repgrep
set -l TMP_DIR (mktemp -d -p /tmp install-XXXXXX)
cd $TMP_DIR
install-from-github acheronfail/repgrep "repgrep.*apple-darwin.tar.gz"
if test (uname -s) = "Darwin"
set os "apple-darwin"
else
set os "unknown-linux-gnu"
end
install-from-github acheronfail/repgrep "repgrep.*$os.tar.gz"
tar -xzf repgrep* --strip-components=1
mv rgr ~/.local/bin
mv complete/rgr.fish ~/.config/fish/completions/
Expand Down Expand Up @@ -649,8 +654,9 @@ function install-dev-core
install-difftastic
install-mold
install-libtree
install-gh
install-ccache
install-pixi
install-repgrep
## Linters
install-pre-commit
install-hadolint
Expand Down
19 changes: 3 additions & 16 deletions fish/config.fish
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,6 @@ function git-bisect
git bisect old $bad_commit
end

# Find and replace string in all files in a directory
# param1 - old word
# param2 - new word
function findreplace
# Use ` since I hopefully don't use it much
rg --files-with-matches "$argv[1]" | xargs sed -i "s`$argv[1]`$argv[2]`g" ;
end

function findreplacehidden
rg --files-with-matches --glob '!.git' --hidden "$argv[1]" | xargs sed -i "s`$argv[1]`$argv[2]`g" ;
end

# get just the ip address
function myip
echo "Public IP: " (curl ifconfig.me -s)
Expand Down Expand Up @@ -284,10 +272,6 @@ function kill-all
end
end

function restart-zerotier-one
sudo systemctl stop zerotier-one.service && sudo systemctl start zerotier-one.service
end

function set-timezone
sudo timedatectl set-timezone $argv[1]
end
Expand Down Expand Up @@ -663,6 +647,9 @@ function setup_container
if test (docker exec $container_name sh -c 'if [ -d "$HOME/myconfigs" ]; then echo "1"; else echo "0"; fi') -eq 0
docker cp $HOME/myconfigs $container_name:$HOME/myconfigs
end
if test (docker exec $container_name sh -c 'if [ -d "$HOME/.config/github-copilot" ]; then echo "1"; else echo "0"; fi') -eq 0
docker cp $HOME/.config/github-copilot $container_name:$HOME/.config/github-copilot
end
docker exec $container_name mkdir -p $HOME/.config
if test (docker exec $container_name sh -c 'if [ -d "$HOME/.config/gh" ]; then echo "1"; else echo "0"; fi') -eq 0
docker cp $HOME/.config/gh $container_name:$HOME/.config/gh
Expand Down

0 comments on commit d94e63e

Please sign in to comment.