mirror of
https://github.com/tedkulp/dotfiles
synced 2026-04-18 21:54:46 -04:00
fish!
This commit is contained in:
@@ -0,0 +1,54 @@
|
|||||||
|
# exit if not in interactive
|
||||||
|
status is-interactive || exit
|
||||||
|
|
||||||
|
# ASDF configuration code
|
||||||
|
if test -z $ASDF_DATA_DIR
|
||||||
|
set _asdf_shims "$HOME/.asdf/shims"
|
||||||
|
else
|
||||||
|
set _asdf_shims "$ASDF_DATA_DIR/shims"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Do not use fish_add_path (added in Fish 3.2) because it
|
||||||
|
# potentially changes the order of items in PATH
|
||||||
|
if not contains $_asdf_shims $PATH
|
||||||
|
set -gx --prepend PATH $_asdf_shims
|
||||||
|
end
|
||||||
|
set --erase _asdf_shims
|
||||||
|
|
||||||
|
# Export environment variables
|
||||||
|
set -gx ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY latest_installed
|
||||||
|
set -gx ASDF_GOLANG_MOD_VERSION_ENABLED true
|
||||||
|
set -gx KERL_BUILD_DOCS yes
|
||||||
|
set -gx KERL_CONFIGURE_OPTIONS "--without-javac --without-wx --without-odbc --enable-threads --enable-kernel-poll --enable-webview --enable-gettimeofday-as-os-system-time"
|
||||||
|
|
||||||
|
# Function to update ASDF plugin version
|
||||||
|
function asdf-up
|
||||||
|
set -l plugin $argv[1]
|
||||||
|
set -l cur_version (asdf current $plugin | tr -s ' ' | cut -d ' ' -f 2)
|
||||||
|
echo "Updating plugin: $plugin version: $cur_version"
|
||||||
|
asdf uninstall $plugin $cur_version; and asdf install $plugin $cur_version
|
||||||
|
end
|
||||||
|
|
||||||
|
# Append to existing KERL_CONFIGURE_OPTIONS
|
||||||
|
set -gx KERL_CONFIGURE_OPTIONS "$KERL_CONFIGURE_OPTIONS --enable-darwin-64bit"
|
||||||
|
|
||||||
|
# Compiler flags
|
||||||
|
set -gx CFLAGS ""
|
||||||
|
set -gx LDFLAGS ""
|
||||||
|
|
||||||
|
# Check if Homebrew is installed and configure OpenSSL paths
|
||||||
|
if command -v brew >/dev/null
|
||||||
|
set -l openssl_prefix (brew --prefix openssl 2> /dev/null)
|
||||||
|
if test -n "$openssl_prefix"
|
||||||
|
set -gx CFLAGS "$CFLAGS -I$openssl_prefix/include"
|
||||||
|
set -gx LDFLAGS "$LDFLAGS -L$openssl_prefix/lib"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Stuff for building Erlang on Apple ARM (commented out)
|
||||||
|
# if test -d "/opt/homebrew/opt/openssl@1.1/lib"
|
||||||
|
# set -gx LDFLAGS "-L/opt/homebrew/opt/openssl@1.1/lib"
|
||||||
|
# set -gx CPPFLAGS "-I/opt/homebrew/opt/openssl@1.1/include"
|
||||||
|
# set -gx KERL_CONFIGURE_OPTIONS "--disable-debug --disable-silent-rules --without-javac --enable-shared-zlib --enable-dynamic-ssl-lib --enable-threads --enable-kernel-poll --enable-wx --enable-webview --enable-darwin-64bit --enable-gettimeofday-as-os-system-time --with-ssl=(brew --prefix openssl@1.1)"
|
||||||
|
# set -gx KERL_BUILD_DOCS "yes"
|
||||||
|
# end
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
if status is-interactive
|
||||||
|
atuin init fish | source
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
set -gx BAT_THEME Catppuccin-mocha
|
||||||
|
set -gx PAGER bat
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
if status is-interactive
|
||||||
|
direnv hook fish | source
|
||||||
|
end
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
# Aliases
|
||||||
|
alias dcrun "docker compose"
|
||||||
|
alias dclogs "docker compose logs"
|
||||||
|
|
||||||
|
# Function to enter a shell in a Docker container
|
||||||
|
function dcshell
|
||||||
|
docker compose exec $argv sh -c "[ -e /bin/bash ] && /bin/bash || [ -e /bin/zsh ] && /bin/zsh || /bin/sh"
|
||||||
|
end
|
||||||
|
|
||||||
|
# Function to restart a Docker container
|
||||||
|
function dcrestart
|
||||||
|
docker compose rm -sf $argv
|
||||||
|
docker compose up -d $argv
|
||||||
|
end
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
set -U __done_min_cmd_duration 30000
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
alias ls="eza --icons"
|
||||||
|
alias ll="eza -lbF --icons --git"
|
||||||
|
alias llm="ll --sort=modified"
|
||||||
|
alias la="eza -lbhHigUmuSa --icons --git --color-scale --time-style=long-iso"
|
||||||
|
alias lam="la --sort=modified"
|
||||||
|
alias laa="eza -lbhHigUmuSaa --icons --git --color-scale --time-style=long-iso"
|
||||||
|
alias lx="eza -lbhHigUmuSa@ --icons --git --color-scale --time-style=long-iso"
|
||||||
|
alias lxa="eza -lbhHigUmuSa@a --icons --git --color-scale --time-style=long-iso"
|
||||||
|
alias lS="eza -1"
|
||||||
|
alias llt="eza -1 --icons --tree --git"
|
||||||
|
alias llta="eza -1 --icons --tree --git --all"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alias fd="fd -H"
|
||||||
|
alias fda="fd -HI"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
alias ghm='git push heroku master'
|
||||||
|
alias gpp='git pull origin "(git_current_branch)" && git push origin "(git_current_branch)"'
|
||||||
|
alias gfap='git pull --all -p'
|
||||||
|
|
||||||
|
alias lazygit='lazygit --use-config-file "$HOME/.config/lazygit/config.yml"'
|
||||||
|
alias lg='lazygit'
|
||||||
|
alias ly='lazygit --use-config-file "$HOME/.config/yadm/lazygit.yml,$HOME/.config/lazygit/config.yml" --work-tree ~ --git-dir ~/.local/share/yadm/repo.git'
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alias glvw="glab repo view --web"
|
||||||
|
alias glmr="glab mr create --fill --squash-before-merge --remove-source-branch --allow-collaboration"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
alias hbu="brew outdated 2> /dev/null | sort | fzf --no-sort --height 50% --header 'Homebrew Upgrade' --reverse -m --border --preview 'sleep 1 && brew info {}' | xargs -I '{}' brew upgrade {}"
|
||||||
|
alias hbx="brew list 2> /dev/null | sort | fzf --no-sort --height 50% --header 'Homebrew Uninstall' --reverse -m --border --preview 'sleep 1 && brew info {}' | xargs -I '{}' brew uninstall {}"
|
||||||
|
alias hbi="brew list 2> /dev/null | sort | fzf --no-sort --height 50% --header 'Homebrew Installed Packages' --reverse -m --border --preview 'sleep 1 && brew info {}'"
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Function to get all namespaced resources in a Kubernetes namespace
|
||||||
|
function kubectlgetallresources
|
||||||
|
for i in (kubectl api-resources --verbs=list --namespaced -o name | grep -v "events.events.k8s.io" | grep -v "events" | sort | uniq)
|
||||||
|
echo "Resource: $i"
|
||||||
|
kubectl -n $argv[1] get --ignore-not-found $i
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Function to get all rolebindings and clusterrolebindings
|
||||||
|
function kubectlgetallbindings
|
||||||
|
kubectl get rolebindings,clusterrolebindings --all-namespaces -o custom-columns='KIND:kind,NAMESPACE:metadata.namespace,NAME:metadata.name,SERVICE_ACCOUNTS:subjects[?(@.kind=="ServiceAccount")].name'
|
||||||
|
end
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alias strip-ansi="perl -pe 's/\e\[[0-9;]*m(?:\e\[K)?//g'"
|
||||||
|
alias format-csv="perl -pe 's/((?<=,)|(?<=^)),/ ,/g;' | column -t -s,"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
alias certinfo="openssl x509 -text -noout -in"
|
||||||
|
alias keyinfo="openssl rsa -text -noout -in"
|
||||||
|
alias keyinfo-rsa="openssl rsa -text -noout -in"
|
||||||
|
alias keyinfo-ec="openssl ec -text -noout -in"
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
function p
|
||||||
|
set -l pager $PAGER
|
||||||
|
|
||||||
|
if test -n "$pager"
|
||||||
|
if command -v "$pager" &>/dev/null
|
||||||
|
env BAT_STYLE=grid,numbers,snip,changes $pager $argv
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if command -v less &>/dev/null
|
||||||
|
less -R $argv
|
||||||
|
else
|
||||||
|
cat $argv
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
alias pl="p -l"
|
||||||
|
# alias jqp="jq . | p -l json"
|
||||||
|
#alias yqp="yq . | p -l yaml"
|
||||||
|
alias pjq="jq . | p -l json"
|
||||||
|
alias pyq="yq . | p -l yaml"
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
set -gx RIPGREP_CONFIG_PATH $HOME/.config/ripgrep/config
|
||||||
|
|
||||||
|
alias r="rg"
|
||||||
|
alias ri="r --ignore-case"
|
||||||
|
alias ra="r --no-ignore"
|
||||||
|
alias rA="r --hidden --no-ignore"
|
||||||
|
alias ria="r --no-ignore --ignore-case"
|
||||||
|
alias riA="r --hidden --no-ignore --ignore-case"
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# If we're not in tmux, make sure we're in xterm-256color
|
||||||
|
if not set -q TMUX
|
||||||
|
set -gx TERM xterm-256color
|
||||||
|
end
|
||||||
|
|
||||||
|
# Some terminals like to set erase to ^H. Override it.
|
||||||
|
if status is-interactive
|
||||||
|
if stty -g | grep -q "erase=8"
|
||||||
|
stty erase '^?'
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export TS_VERSION_CHECK=0
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
if status is-interactive
|
||||||
|
thefuck --alias | source
|
||||||
|
end
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# Aliases
|
||||||
|
alias xssh "xpanes --ssh"
|
||||||
|
alias tmux "tmux -2"
|
||||||
|
|
||||||
|
# Function to get the current TMUX session
|
||||||
|
function _tm_get_current_session
|
||||||
|
tmux display-message -p '#S'
|
||||||
|
end
|
||||||
|
|
||||||
|
# Function to attach or switch to a TMUX session
|
||||||
|
function tm
|
||||||
|
set -l targetSession (test -n "$argv[1]"; and echo "$argv[1]"; or echo "main")
|
||||||
|
|
||||||
|
# If outside tmux, start a new session or attach
|
||||||
|
if not set -q TMUX
|
||||||
|
tmux new -A -s $targetSession
|
||||||
|
return $status
|
||||||
|
end
|
||||||
|
|
||||||
|
# If already in the target session, return
|
||||||
|
if test (_tm_get_current_session) = "$targetSession"
|
||||||
|
echo "You did not move."
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
# Create session if it doesn't exist
|
||||||
|
tmux new -d -s $targetSession 2>/dev/null
|
||||||
|
|
||||||
|
# Switch to the target session
|
||||||
|
tmux switch-client -t $targetSession
|
||||||
|
end
|
||||||
|
|
||||||
|
# Function to complete tmux session names
|
||||||
|
function _tm
|
||||||
|
set -l tmuxList (tmux ls -F "#{session_name}" 2>/dev/null)
|
||||||
|
|
||||||
|
# If outside tmux, complete with session list
|
||||||
|
if not set -q TMUX
|
||||||
|
for session in $tmuxList
|
||||||
|
echo $session
|
||||||
|
end
|
||||||
|
return 0
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l currentSession (_tm_get_current_session)
|
||||||
|
set -l actualList
|
||||||
|
|
||||||
|
# Exclude the current session from the list
|
||||||
|
for session in $tmuxList
|
||||||
|
if test "$session" != "$currentSession"
|
||||||
|
set actualList $actualList $session
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
for session in $actualList
|
||||||
|
echo $session
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Register the function for tab completion
|
||||||
|
complete -c tm -a "(_tm)"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
set -gx EDITOR nvim
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alias yy="yazi"
|
||||||
|
alias yyh="yy $HOME"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
if status is-interactive
|
||||||
|
zoxide init fish | source
|
||||||
|
function cd --wraps=z --description 'alias cd z'
|
||||||
|
z $argv
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
set -q XDG_CONFIG_HOME; or set -gx XDG_CONFIG_HOME $HOME/.config
|
||||||
|
|
||||||
|
set -q FZF_TMUX; or set -gx FZF_TMUX 1
|
||||||
|
|
||||||
|
# disable default greeting
|
||||||
|
set fish_greeting
|
||||||
|
|
||||||
|
# Fisher!
|
||||||
|
if not functions -q fisher
|
||||||
|
echo "==> Fisherman not found. Installing."
|
||||||
|
curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
|
||||||
|
source $XDG_CONFIG_HOME/fish/functions/fisher.fish
|
||||||
|
fisher update
|
||||||
|
tide configure --auto --style=Rainbow --prompt_colors='True color' --show_time='24-hour format' --rainbow_prompt_separators=Slanted --powerline_prompt_heads=Sharp --powerline_prompt_tails=Flat --powerline_prompt_style='Two lines, character and frame' --prompt_connection=Dotted --powerline_right_prompt_frame=No --prompt_connection_andor_frame_color=Darkest --prompt_spacing=Sparse --icons='Many icons' --transient=No
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
# uv
|
||||||
|
fish_add_path "/Users/tedkulp/.local/bin"
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
jorgebucaran/fisher
|
||||||
|
ilancosman/tide@v6
|
||||||
|
catppuccin/fish
|
||||||
|
franciscolourenco/done
|
||||||
Reference in New Issue
Block a user