mirror of
https://github.com/tedkulp/dotfiles
synced 2026-03-05 13:40:18 -05:00
multiple changes
* Switch back to starship from powerline * Switch from n to nvm * Other random stuff
This commit is contained in:
@@ -86,13 +86,13 @@ brew "nnn"
|
|||||||
brew "openjdk"
|
brew "openjdk"
|
||||||
brew "pandoc"
|
brew "pandoc"
|
||||||
brew "pinentry-mac"
|
brew "pinentry-mac"
|
||||||
brew "powerline-go"
|
|
||||||
brew "ruby-build"
|
brew "ruby-build"
|
||||||
brew "rbenv"
|
brew "rbenv"
|
||||||
brew "rclone"
|
brew "rclone"
|
||||||
brew "reattach-to-user-namespace"
|
brew "reattach-to-user-namespace"
|
||||||
brew "redis"
|
brew "redis"
|
||||||
brew "ripgrep"
|
brew "ripgrep"
|
||||||
|
brew "starship"
|
||||||
brew "speedtest-cli"
|
brew "speedtest-cli"
|
||||||
brew "stow"
|
brew "stow"
|
||||||
brew "teensy_loader_cli"
|
brew "teensy_loader_cli"
|
||||||
@@ -139,6 +139,7 @@ cask "dropbox"
|
|||||||
cask "duplicati"
|
cask "duplicati"
|
||||||
cask "firefox"
|
cask "firefox"
|
||||||
cask "fork"
|
cask "fork"
|
||||||
|
cask "gitkraken"
|
||||||
cask "google-chrome"
|
cask "google-chrome"
|
||||||
cask "google-drive-file-stream"
|
cask "google-drive-file-stream"
|
||||||
cask "handbrake"
|
cask "handbrake"
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ if [ "$system_type" = "Darwin" ]; then
|
|||||||
brew bundle --global
|
brew bundle --global
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Install powerline-go if necessary
|
# Install starship if necessary
|
||||||
if ! command -v powerline-go >/dev/null 2>&1; then
|
if ! command -v starship >/dev/null 2>&1; then
|
||||||
go install github.com/justjanne/powerline-go@latest
|
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,12 @@ ecsInstanceIds() {
|
|||||||
ecsInstanceInfo $cluster $profile | jq -r '.containerInstances[].ec2InstanceId'
|
ecsInstanceInfo $cluster $profile | jq -r '.containerInstances[].ec2InstanceId'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
asgInstanceIds() {
|
||||||
|
cluster=$1
|
||||||
|
profile=${2:-default}
|
||||||
|
aws autoscaling describe-auto-scaling-groups --profile $profile | jq -r '.AutoScalingGroups[] | select(.AutoScalingGroupName == "$cluster") | .Instances | map(.InstanceId) | join(" ")'
|
||||||
|
}
|
||||||
|
|
||||||
xecsSsh() {
|
xecsSsh() {
|
||||||
cluster=$1
|
cluster=$1
|
||||||
profile=${2:-default}
|
profile=${2:-default}
|
||||||
@@ -28,3 +34,16 @@ xecsSsh() {
|
|||||||
eval $CMD
|
eval $CMD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xasgSsh() {
|
||||||
|
cluster=$1
|
||||||
|
profile=${2:-default}
|
||||||
|
user=${3:-"ec2-user"}
|
||||||
|
key=${4:-$profile}
|
||||||
|
# KEYS=(`find ~/.ssh/*$profile*.pem | xargs -I {} echo "-i {}" | xargs`)
|
||||||
|
KEYS=(`find ~/.ssh/$key.pem | xargs -I {} echo "-i {}" | xargs`)
|
||||||
|
echo $KEYS
|
||||||
|
echo $(asgInstanceIds $cluster $profile | xargs)
|
||||||
|
CMD="xpanes -tsc \"SSM_PROFILE=$profile autossh -M 0 ${KEYS[@]} -o ServerAliveInterval=60 -o StrictHostKeyChecking=no $user@{}\" $(asgInstanceIds $cluster $profile | xargs)"
|
||||||
|
echo $CMD
|
||||||
|
# eval $CMD
|
||||||
|
}
|
||||||
|
|||||||
@@ -17,3 +17,8 @@ alias gie='git init && git commit --allow-empty -m "Initial commit"'
|
|||||||
|
|
||||||
alias grc="git branch --merged | grep -v '\*' | grep -v master | grep -v stage | xargs -n 1 git branch -d"
|
alias grc="git branch --merged | grep -v '\*' | grep -v master | grep -v stage | xargs -n 1 git branch -d"
|
||||||
alias grcr="git fetch --all -p && git branch -r --merged | grep -v '\*' | grep origin | grep -v master | grep -v stage | sed 's/origin\//:/' | xargs -n 1 echo git push origin"
|
alias grcr="git fetch --all -p && git branch -r --merged | grep -v '\*' | grep origin | grep -v master | grep -v stage | sed 's/origin\//:/' | xargs -n 1 echo git push origin"
|
||||||
|
|
||||||
|
krak () {
|
||||||
|
dir="$(cd "$(dirname "$1")"; pwd -P)/$(basename "$1")"
|
||||||
|
open gitkraken://repo/$dir
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,2 +1,24 @@
|
|||||||
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
|
||||||
|
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
||||||
|
|
||||||
|
autoload -U add-zsh-hook
|
||||||
|
load-nvmrc() {
|
||||||
|
local node_version="$(nvm version)"
|
||||||
|
local nvmrc_path="$(nvm_find_nvmrc)"
|
||||||
|
|
||||||
|
if [ -n "$nvmrc_path" ]; then
|
||||||
|
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
||||||
|
|
||||||
|
if [ "$nvmrc_node_version" = "N/A" ]; then
|
||||||
|
nvm install
|
||||||
|
elif [ "$nvmrc_node_version" != "$node_version" ]; then
|
||||||
|
nvm use
|
||||||
|
fi
|
||||||
|
elif [ "$node_version" != "$(nvm version default)" ]; then
|
||||||
|
echo "Reverting to nvm default version"
|
||||||
|
nvm use default
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
add-zsh-hook chpwd load-nvmrc
|
||||||
|
load-nvmrc
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
function powerline_precmd() {
|
|
||||||
PS1="$($GOPATH/bin/powerline-go -error $? -jobs ${${(%):%j}:-0})"
|
|
||||||
|
|
||||||
# Uncomment the following line to automatically clear errors after showing
|
|
||||||
# them once. This not only clears the error for powerline-go, but also for
|
|
||||||
# everything else you run in that shell. Don't enable this if you're not
|
|
||||||
# sure this is what you want.
|
|
||||||
|
|
||||||
#set "?"
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_powerline_precmd() {
|
|
||||||
for s in "${precmd_functions[@]}"; do
|
|
||||||
if [ "$s" = "powerline_precmd" ]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
precmd_functions+=(powerline_precmd)
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ "$TERM" != "linux" ] && [ -f "$GOPATH/bin/powerline-go" ]; then
|
|
||||||
install_powerline_precmd
|
|
||||||
fi
|
|
||||||
@@ -9,3 +9,5 @@
|
|||||||
helper = osxkeychain
|
helper = osxkeychain
|
||||||
[pull]
|
[pull]
|
||||||
rebase = false
|
rebase = false
|
||||||
|
[tag]
|
||||||
|
forceSignAnnotated = true
|
||||||
|
|||||||
@@ -378,6 +378,7 @@ set -g @plugin 'tmux-plugins/tmux-cpu'
|
|||||||
set -g @plugin 'tmux-plugins/tmux-urlview'
|
set -g @plugin 'tmux-plugins/tmux-urlview'
|
||||||
#set -g @continuum-restore 'on'
|
#set -g @continuum-restore 'on'
|
||||||
set -g @plugin 'sainnhe/tmux-fzf'
|
set -g @plugin 'sainnhe/tmux-fzf'
|
||||||
|
set -g @plugin 'laktak/extrakto'
|
||||||
|
|
||||||
|
|
||||||
# -- custom variables ----------------------------------------------------------
|
# -- custom variables ----------------------------------------------------------
|
||||||
|
|||||||
6
.zshrc
6
.zshrc
@@ -107,8 +107,4 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
# uninstall by removing these lines
|
# uninstall by removing these lines
|
||||||
# [ -f ~/.config/tabtab/__tabtab.fish ]; and . ~/.config/tabtab/__tabtab.fish; or true
|
# [ -f ~/.config/tabtab/__tabtab.fish ]; and . ~/.config/tabtab/__tabtab.fish; or true
|
||||||
|
|
||||||
# source <("/usr/local/bin/starship" init zsh --print-full-init)
|
source <("/usr/local/bin/starship" init zsh --print-full-init)
|
||||||
|
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user