2022-10-17 22:35:06 -04:00
|
|
|
if test -f /usr/share/doc/fzf/examples/completion.zsh &> /dev/null; then
|
|
|
|
source /usr/share/doc/fzf/examples/completion.zsh
|
|
|
|
fi
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2024-01-25 20:29:19 -05:00
|
|
|
ssh_ids=$(find "$HOME/.ssh" -type f -name "id*" | grep -v '\.pub')
|
|
|
|
if [[ "$ssh_ids" != "" ]]; then
|
|
|
|
eval "$(ssh-agent -s)" &> /dev/null
|
|
|
|
for id in $(echo $ssh_ids); do
|
|
|
|
ssh-add "$id" &> /dev/null
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2020-04-21 12:39:18 -04:00
|
|
|
HISTFILE=~/.histfile
|
2024-01-22 13:30:45 -05:00
|
|
|
HISTSIZE=SAVEHIST=100000000
|
2020-04-21 12:39:18 -04:00
|
|
|
setopt appendhistory autocd notify
|
|
|
|
setopt menu_complete
|
|
|
|
unsetopt beep
|
|
|
|
bindkey -v
|
2020-04-21 13:54:09 -04:00
|
|
|
|
2020-06-12 18:44:25 -04:00
|
|
|
autoload -Uz up-line-or-beginning-search
|
|
|
|
autoload -Uz down-line-or-beginning-search
|
|
|
|
zle -N up-line-or-beginning-search
|
|
|
|
zle -N down-line-or-beginning-search
|
|
|
|
bindkey '\eOA' up-line-or-beginning-search
|
|
|
|
bindkey '\e[A' up-line-or-beginning-search
|
|
|
|
bindkey '\eOB' down-line-or-beginning-search
|
|
|
|
bindkey '\e[B' down-line-or-beginning-search
|
2020-04-21 13:54:09 -04:00
|
|
|
|
|
|
|
export EDITOR="vim"
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2020-04-21 12:39:18 -04:00
|
|
|
zstyle ':completion:*' completer _expand _complete _ignored _correct _approximate
|
|
|
|
zstyle ':completion:*' matcher-list '+' '+m:{[:lower:]}={[:upper:]}' '+m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=** r:|=** l:|=*'
|
2020-04-21 13:54:09 -04:00
|
|
|
zstyle :compinstall filename '~/.zshrc'
|
2021-10-06 13:15:39 -04:00
|
|
|
zstyle ':completion:*' ignored-patterns '*.class'
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2020-04-21 12:39:18 -04:00
|
|
|
autoload -Uz compinit
|
|
|
|
compinit
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2020-04-21 12:39:18 -04:00
|
|
|
# enable color support of ls and also add handy aliases
|
|
|
|
if [ -x /usr/bin/dircolors ]; then
|
|
|
|
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
|
|
|
|
alias grep='grep --color=auto'
|
|
|
|
alias fgrep='fgrep --color=auto'
|
|
|
|
alias egrep='egrep --color=auto'
|
|
|
|
fi
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2023-12-13 12:23:16 -05:00
|
|
|
export PATH=~/.bin:$HOME/.dotnet:~/.local/bin:/usr/local/go/bin:$PATH
|
2020-04-21 12:39:18 -04:00
|
|
|
|
2024-01-22 14:04:24 -05:00
|
|
|
fignore=(o class swp)
|
2020-04-21 12:39:18 -04:00
|
|
|
|
|
|
|
function SetTtyColors() {
|
2024-01-09 10:12:38 -05:00
|
|
|
echo -en "\e]P0""2c2d27" # black 1
|
|
|
|
echo -en "\e]P1""f92672" # darkgrey 2
|
|
|
|
echo -en "\e]P2""00aa00" # darkred 3
|
|
|
|
echo -en "\e]P3""f92672" # red 4
|
|
|
|
echo -en "\e]P4""4444aa" # darkgreen 5
|
|
|
|
echo -en "\e]P5""a6e22e" # green 6
|
|
|
|
echo -en "\e]P6""f59762" # brown 7
|
|
|
|
echo -en "\e]P7""fdfff1" # yellow 8
|
|
|
|
echo -en "\e]P8""f92672" # darkblue 9
|
|
|
|
echo -en "\e]P9""f92672" # blue 10
|
|
|
|
echo -en "\e]PA""55ff55" # darkmagenta 11
|
|
|
|
echo -en "\e]PB""f92672" # magenta 12
|
|
|
|
echo -en "\e]PC""66d9ef" # darkcyan 13
|
|
|
|
echo -en "\e]PD""ae81ff" # cyan 14
|
|
|
|
echo -en "\e]PE""a1efe4" # lightgray 15
|
|
|
|
echo -en "\e]PF""fdfff1" # white 16
|
2020-04-21 12:39:18 -04:00
|
|
|
clear
|
|
|
|
}
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2020-04-21 12:39:18 -04:00
|
|
|
if [ "$TERM" = "linux" ]; then
|
|
|
|
SetTtyColors
|
|
|
|
fi
|
2020-02-09 12:29:17 -05:00
|
|
|
|
2023-12-13 15:09:02 -05:00
|
|
|
source ~/.shell_aliases
|
|
|
|
source ~/.zsh_local
|
|
|
|
|
2024-07-21 12:24:26 -04:00
|
|
|
SYNC_LOCK_FILE="$HOME/.sync-lock"
|
|
|
|
|
2024-04-25 08:55:30 -04:00
|
|
|
# Ignores certain values/sections that shouldn't be synced
|
|
|
|
function dconf-clean {
|
2024-02-19 01:25:44 -05:00
|
|
|
local current_section=""
|
2024-02-18 01:15:03 -05:00
|
|
|
local ignore_section=false
|
2024-04-25 08:55:30 -04:00
|
|
|
cat "$1" | while read -r line; do
|
2024-02-19 01:25:44 -05:00
|
|
|
if [[ "$line" == "["* ]]; then
|
|
|
|
current_section="$line"
|
2024-02-19 00:12:19 -05:00
|
|
|
ignore_section=false
|
2024-04-09 07:03:15 -04:00
|
|
|
elif [[ "$line" == "']" ]]; then
|
|
|
|
current_section="$line"
|
|
|
|
ignore_section=true
|
2024-02-19 00:12:19 -05:00
|
|
|
fi
|
2024-04-09 07:03:15 -04:00
|
|
|
|
2024-02-19 01:25:44 -05:00
|
|
|
case "$current_section" in
|
2024-02-19 01:30:26 -05:00
|
|
|
"[org/gnome/desktop/background]" | \
|
2024-04-09 07:04:50 -04:00
|
|
|
"[org/gnome/gedit/state/history-entry]" | \
|
2024-04-25 08:55:30 -04:00
|
|
|
"[org/gnome/gedit/plugins/filebrowser]" | \
|
|
|
|
"[org/gnome/desktop/notifications]" | \
|
|
|
|
"[org/gnome/cheese]" | \
|
2024-02-19 01:30:26 -05:00
|
|
|
"[org/gnome/shell/extensions/gsconnect"*)
|
2024-02-19 01:25:44 -05:00
|
|
|
ignore_section=true
|
|
|
|
;;
|
|
|
|
"[org/gnome/desktop/interface]")
|
2024-02-19 01:30:26 -05:00
|
|
|
if [[ "$line" == "gtk-theme='"* ]]; then
|
|
|
|
continue
|
2024-02-19 01:25:44 -05:00
|
|
|
fi
|
2024-02-19 01:30:26 -05:00
|
|
|
echo "$line"
|
2024-02-19 01:25:44 -05:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if ! $ignore_section; then
|
|
|
|
echo "$line"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2024-02-18 01:15:03 -05:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-04-25 08:55:30 -04:00
|
|
|
function dconf-dump {
|
|
|
|
dconf dump / > "$HOME/.dconf-dump.tmp"
|
|
|
|
}
|
|
|
|
|
2024-10-10 16:27:58 -04:00
|
|
|
alias tscp="scp -o ConnectTimeout=8 -P 11275"
|
2024-10-04 10:01:28 -04:00
|
|
|
|
2024-02-17 14:40:50 -05:00
|
|
|
function push-dconf {
|
2024-02-26 00:21:53 -05:00
|
|
|
if ! command -v dconf &> /dev/null; then
|
|
|
|
echo "The current system does not include dconf"
|
|
|
|
return
|
|
|
|
fi
|
2024-02-19 01:37:07 -05:00
|
|
|
if ! command -v scpace &> /dev/null; then
|
2024-02-17 14:06:08 -05:00
|
|
|
echo "An alias for scpace has not been defined on this device!"
|
2024-02-19 01:37:07 -05:00
|
|
|
return 1
|
2024-02-17 14:06:08 -05:00
|
|
|
fi
|
2024-02-26 00:24:28 -05:00
|
|
|
dconf-dump > $HOME/.tmp/dconf-dump || return 1
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp $HOME/.tmp/dconf-dump 'sage@sagev.space:~/dconf-dump'
|
2024-02-17 14:40:50 -05:00
|
|
|
}
|
|
|
|
|
2024-02-24 12:16:49 -05:00
|
|
|
function push-extensions {
|
|
|
|
if ! command -v gnome-extensions &> /dev/null; then
|
|
|
|
echo "gnome-extensions is not installed!"
|
|
|
|
return
|
|
|
|
fi
|
2024-06-30 10:52:41 -04:00
|
|
|
mv $HOME/.tmp/gnome-extension-list "$HOME/.tmp/prev-gnome-extension-list" &> /dev/null
|
|
|
|
gnome-extensions list --enabled > "$HOME/.tmp/gnome-extension-list"
|
2024-10-04 10:01:28 -04:00
|
|
|
# If there is NO difference, skip tscp
|
2024-06-30 10:52:41 -04:00
|
|
|
if [[ "$1" != "--force" ]] && diff "$HOME/.tmp/gnome-extension-list" "$HOME/.tmp/prev-gnome-extension-list" &> /dev/null; then
|
2024-02-24 13:12:23 -05:00
|
|
|
return
|
|
|
|
fi
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp "$HOME/.tmp/gnome-extension-list" 'sage@sagev.space:~/gnome-extension-list'
|
2024-02-24 12:16:49 -05:00
|
|
|
}
|
|
|
|
|
2024-02-24 13:36:19 -05:00
|
|
|
function merge-hist {
|
|
|
|
\diff --unified=9999999999999999 "$1" "$2" | tail -n +4 | sed 's/^.//'
|
|
|
|
}
|
|
|
|
|
|
|
|
function sync-history {
|
2024-10-10 16:25:13 -04:00
|
|
|
local local_history="$HOME/.histfile"
|
|
|
|
local remote_file="sage@sagev.space:~/histfile"
|
|
|
|
local copy_of_remote="$HOME/.tmp/.histfile"
|
|
|
|
local merged="$HOME/.tmp/$(whoami).histfile"
|
|
|
|
|
2024-07-21 11:49:28 -04:00
|
|
|
echo "Downloading shared history..."
|
2024-10-10 16:27:58 -04:00
|
|
|
if ! tscp "$remote_file" "$copy_of_remote"; then
|
2024-07-21 11:49:28 -04:00
|
|
|
echo "Shared history download failed!"
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp "$local_history" "$remote_file"
|
2024-02-24 13:38:43 -05:00
|
|
|
return
|
|
|
|
fi
|
2024-10-10 16:33:45 -04:00
|
|
|
|
2024-07-21 12:19:10 -04:00
|
|
|
echo "Merging history files..."
|
2024-03-08 19:19:54 -05:00
|
|
|
fc -W # Write to history file
|
2024-10-10 16:25:13 -04:00
|
|
|
merge-hist "$local_history" "$copy_of_remote" > "$merged"
|
|
|
|
mv "$merged" "$local_history"
|
2024-03-08 19:19:54 -05:00
|
|
|
fc -R # Read from new history file
|
2024-10-10 16:33:45 -04:00
|
|
|
|
2024-07-21 11:49:28 -04:00
|
|
|
echo "Uploading new shared history..."
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp "$local_history" "$remote_file"
|
2024-02-24 13:36:19 -05:00
|
|
|
}
|
|
|
|
|
2024-05-18 13:38:40 -04:00
|
|
|
function install-extension {
|
|
|
|
local ext="$1"
|
|
|
|
local file="$1.zip"
|
|
|
|
if ! gnome-extensions install --force ${ext}.zip; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
if ! gnome-extensions list | grep --quiet ${ext}; then
|
|
|
|
if ! busctl --user call org.gnome.Shell.Extensions /org/gnome/Shell/Extensions org.gnome.Shell.Extensions InstallRemoteExtension s ${ext}; then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
gnome-extensions enable ${ext}
|
|
|
|
}
|
|
|
|
|
2024-02-24 12:16:49 -05:00
|
|
|
function load-extensions {
|
|
|
|
if ! command -v gnome-extensions &> /dev/null; then
|
|
|
|
echo "gnome-extensions is not installed!"
|
|
|
|
return
|
|
|
|
fi
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp 'sage@sagev.space:~/gnome-extension-list' $HOME/.tmp/gnome-extension-list
|
2024-05-14 09:06:04 -04:00
|
|
|
touch "$HOME/.unavailable-extensions"
|
|
|
|
local existing="$(cat <(gnome-extensions list) "$HOME/.unavailable-extensions")"
|
2024-02-26 00:24:28 -05:00
|
|
|
for ext in $(cat $HOME/.tmp/gnome-extension-list); do
|
2024-02-24 12:16:49 -05:00
|
|
|
if grep "$ext" <(echo $existing) &> /dev/null; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
VERSION_TAG=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=${ext}" | jq '.extensions[0] | .shell_version_map | map(.pk) | max')
|
2024-05-14 09:06:04 -04:00
|
|
|
if ! wget -O ${ext}.zip "https://extensions.gnome.org/download-extension/${ext}.shell-extension.zip?version_tag=$VERSION_TAG"; then
|
|
|
|
echo "$ext" >> "$HOME/.unavailable-extensions"
|
|
|
|
continue
|
|
|
|
fi
|
2024-05-18 13:38:40 -04:00
|
|
|
if ! install-extension "$ext"; then
|
|
|
|
echo "$ext" >> "$HOME/.unavailable-extensions"
|
2024-02-24 12:16:49 -05:00
|
|
|
fi
|
2024-05-18 13:38:40 -04:00
|
|
|
rm ${ext}.zip
|
2024-02-24 12:16:49 -05:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2024-07-21 12:53:33 -04:00
|
|
|
function lock-wait {
|
|
|
|
local file="$1"
|
|
|
|
local seconds="$2"
|
|
|
|
local action="$3"
|
|
|
|
|
|
|
|
if test -f "$file"; then
|
|
|
|
echo "Sync lockfile present at '$file'"
|
|
|
|
echo "Watching its output:"
|
|
|
|
tail -f "$file" &
|
|
|
|
tail_pid=$!
|
|
|
|
[[ "$action" == "" ]] || echo "Waiting for $action to finish"
|
|
|
|
for i in {0..$seconds}; do
|
2024-07-21 12:24:26 -04:00
|
|
|
sleep 1
|
2024-07-21 12:53:33 -04:00
|
|
|
if ! test -f "$file"; then
|
|
|
|
kill $tail_pid &> /dev/null
|
|
|
|
echo
|
|
|
|
echo "Lock file at '$file' freed."
|
|
|
|
echo
|
2024-07-21 12:24:26 -04:00
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
2024-07-21 12:28:35 -04:00
|
|
|
}
|
|
|
|
|
2024-07-21 12:53:33 -04:00
|
|
|
function lockfor {
|
|
|
|
local file="$1"
|
|
|
|
local seconds="$2"
|
|
|
|
|
|
|
|
lock-wait "$file" "$seconds"
|
|
|
|
touch "$file"
|
2024-07-21 12:59:33 -04:00
|
|
|
$3 $4 $5 $6 $7 $8 $9 $10
|
2024-07-21 12:53:33 -04:00
|
|
|
rm "$file"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function dot-lock-wait {
|
2024-07-21 13:01:59 -04:00
|
|
|
lock-wait "$SYNC_LOCK_FILE" 90 "ongoing sync"
|
2024-07-21 12:53:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
function _pushdot {
|
2024-07-21 12:28:35 -04:00
|
|
|
cd "$DOT_DIR" || return 1
|
2024-02-19 00:49:01 -05:00
|
|
|
local res
|
2024-03-08 19:12:03 -05:00
|
|
|
if ! git diff --quiet; then
|
|
|
|
if [ $# -eq 0 ]; then
|
|
|
|
git commit -a
|
|
|
|
res="$?"
|
|
|
|
else
|
|
|
|
git commit -a -m "$@"
|
|
|
|
res="$?"
|
|
|
|
fi
|
|
|
|
if [[ "$res" == "0" ]]; then
|
|
|
|
git push -u origin main
|
|
|
|
fi
|
2024-02-24 12:16:49 -05:00
|
|
|
fi
|
2024-08-30 14:15:55 -04:00
|
|
|
if [[ "$(hostname)" == "sage-bigboy" ]]; then
|
2024-08-30 14:14:29 -04:00
|
|
|
cd - > /dev/null
|
|
|
|
return $res
|
|
|
|
fi
|
2024-07-21 12:59:33 -04:00
|
|
|
push-extensions | tee -a "$SYNC_LOCK_FILE"
|
|
|
|
sync-history | tee -a "$SYNC_LOCK_FILE"
|
|
|
|
push-dconf | tee -a "$SYNC_LOCK_FILE"
|
2020-02-09 12:36:34 -05:00
|
|
|
cd -
|
2024-02-19 00:49:01 -05:00
|
|
|
return $res
|
2020-02-09 12:36:34 -05:00
|
|
|
}
|
2020-04-23 11:46:53 -04:00
|
|
|
|
2024-07-21 12:53:33 -04:00
|
|
|
function pushdot {
|
|
|
|
lockfor "$SYNC_LOCK_FILE" 90 _pushdot $@
|
|
|
|
}
|
|
|
|
|
2024-02-26 00:21:53 -05:00
|
|
|
function sync-dconf {
|
|
|
|
if ! command -v dconf &> /dev/null; then
|
|
|
|
echo "System does not use dconf"
|
|
|
|
return
|
|
|
|
fi
|
2024-02-26 00:24:28 -05:00
|
|
|
rm $HOME/.tmp/dconf-dump &> /dev/null
|
2024-10-10 16:27:58 -04:00
|
|
|
tscp 'sage@sagev.space:~/dconf-dump' $HOME/.tmp/dconf-dump-inbound
|
2024-04-25 08:55:30 -04:00
|
|
|
dconf-clean $HOME/.tmp/dconf-dump-inbound > $HOME/.tmp/dconf-dump
|
2024-02-26 00:24:28 -05:00
|
|
|
dconf-dump > $HOME/.tmp/current-dconf-dump
|
2024-04-09 07:17:26 -04:00
|
|
|
if ! git --no-pager diff --no-index $HOME/.tmp/current-dconf-dump $HOME/.tmp/dconf-dump &> /dev/null; then
|
|
|
|
echo
|
|
|
|
echo "Incoming conf changes:"
|
|
|
|
echo
|
|
|
|
git --no-pager diff --no-index $HOME/.tmp/current-dconf-dump $HOME/.tmp/dconf-dump
|
|
|
|
echo
|
|
|
|
bash -c 'read -p "Press enter to continue, or Ctrl-C to cancel."' || return 1
|
|
|
|
echo "Applying changes..."
|
|
|
|
fi
|
2024-02-26 00:24:28 -05:00
|
|
|
dconf load / < $HOME/.tmp/dconf-dump || return 1
|
2024-02-26 22:49:17 -05:00
|
|
|
push-dconf
|
2024-02-26 00:21:53 -05:00
|
|
|
}
|
|
|
|
|
2024-07-21 12:53:33 -04:00
|
|
|
function _getdot {
|
2024-02-19 01:37:07 -05:00
|
|
|
if ! command -v scpace &> /dev/null; then
|
|
|
|
echo "An alias for scpace has not been defined on this device!"
|
|
|
|
return 1
|
|
|
|
fi
|
2023-12-13 15:09:02 -05:00
|
|
|
cd "$DOT_DIR" || return 1
|
2024-07-21 12:59:33 -04:00
|
|
|
git pull && ./copy.sh | tee -a "$SYNC_LOCK_FILE"
|
2024-08-30 14:15:55 -04:00
|
|
|
if [[ "$(hostname)" == "sage-bigboy" ]]; then
|
2024-08-30 14:14:29 -04:00
|
|
|
cd - > /dev/null
|
|
|
|
return
|
|
|
|
fi
|
2024-02-24 13:36:19 -05:00
|
|
|
|
2024-07-21 12:59:33 -04:00
|
|
|
sync-history | tee -a "$SYNC_LOCK_FILE"
|
|
|
|
load-extensions | tee -a "$SYNC_LOCK_FILE"
|
|
|
|
[[ "$1" != "--skip-dconf" ]] && sync-dconf | tee -a "$SYNC_LOCK_FILE"
|
2024-02-24 13:36:19 -05:00
|
|
|
|
2024-01-22 20:38:11 -05:00
|
|
|
cd - > /dev/null
|
2020-04-23 11:46:53 -04:00
|
|
|
}
|
2020-04-26 20:17:35 -04:00
|
|
|
|
2024-07-21 12:53:33 -04:00
|
|
|
function getdot {
|
|
|
|
lockfor "$SYNC_LOCK_FILE" 90 _getdot $@
|
|
|
|
}
|
|
|
|
|
2024-10-04 11:17:24 -04:00
|
|
|
if [[ "$OS" != "Windows_NT" ]] && which starship &> /dev/null; then
|
2022-10-17 22:35:06 -04:00
|
|
|
eval "$(starship init zsh)"
|
|
|
|
fi
|
|
|
|
|
2024-02-26 00:24:28 -05:00
|
|
|
last_get_file="$HOME/.tmp/.$(whoami)-dotfiles-last-get"
|
2024-01-22 13:30:45 -05:00
|
|
|
current_date="$(date '+%Y-%m-%d')"
|
2024-10-10 16:07:41 -04:00
|
|
|
|
2024-10-10 16:14:57 -04:00
|
|
|
GETDOT_ARGS="--skip-dconf"
|
2024-10-10 16:07:41 -04:00
|
|
|
|
2024-05-18 14:17:06 -04:00
|
|
|
if [[ "$RUN_GETDOT" == "true" ]] || (test -d "$DOT_DIR" && [[ "$current_date" != "$(cat "$last_get_file")" ]] &> /dev/null); then
|
2024-01-22 13:30:45 -05:00
|
|
|
echo "$current_date" > "$last_get_file"
|
2024-05-18 14:17:06 -04:00
|
|
|
date >> "$HOME/.tmp/getdot-log"
|
|
|
|
getdot $GETDOT_ARGS >> "$HOME/.tmp/getdot-log"
|
|
|
|
echo >> "$HOME/.tmp/getdot-log"
|
2024-01-22 13:30:45 -05:00
|
|
|
fi
|
|
|
|
|
2024-01-24 21:33:45 -05:00
|
|
|
export nvm_loaded=false
|
|
|
|
|
|
|
|
alias nvm="load_nvm; nvm"
|
2024-05-14 09:06:04 -04:00
|
|
|
alias npm="load_nvm; npm"
|
2024-01-24 21:33:45 -05:00
|
|
|
alias node="load_nvm; node"
|
2024-06-24 12:32:46 -04:00
|
|
|
alias standard="load_nvm; standard"
|
|
|
|
alias lf="load_nvm; standard --fix"
|
2024-01-24 21:33:45 -05:00
|
|
|
|
|
|
|
function load_nvm {
|
|
|
|
if $nvm_loaded; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
unalias nvm
|
|
|
|
unalias node
|
|
|
|
export NVM_DIR="$HOME/.nvm"
|
|
|
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
|
|
|
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
|
|
|
export nvm_loaded=true
|
|
|
|
}
|
2023-09-27 12:21:12 -04:00
|
|
|
|
2023-12-13 13:39:18 -05:00
|
|
|
test -f /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh && source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
2023-12-13 13:42:44 -05:00
|
|
|
test -f "$HOME/.asdf/asdf.sh" && . "$HOME/.asdf/asdf.sh"
|
2024-01-22 14:04:24 -05:00
|
|
|
test -f ~/.cargo/env && source ~/.cargo/env
|
2024-06-24 12:24:19 -04:00
|
|
|
|
|
|
|
# bun completions
|
2024-07-21 11:49:28 -04:00
|
|
|
[ -s "$HOME/.bun/_bun" ] && source "$HOME/.bun/_bun"
|
2024-06-24 12:24:19 -04:00
|
|
|
|
|
|
|
# bun
|
|
|
|
export BUN_INSTALL="$HOME/.bun"
|
|
|
|
export PATH="$BUN_INSTALL/bin:$PATH"
|