diff --git a/.Brewfile b/.Brewfile index 46ad313..f0370e1 100644 --- a/.Brewfile +++ b/.Brewfile @@ -86,13 +86,13 @@ brew "nnn" brew "openjdk" brew "pandoc" brew "pinentry-mac" -brew "powerline-go" brew "ruby-build" brew "rbenv" brew "rclone" brew "reattach-to-user-namespace" brew "redis" brew "ripgrep" +brew "starship" brew "speedtest-cli" brew "stow" brew "teensy_loader_cli" @@ -139,6 +139,7 @@ cask "dropbox" cask "duplicati" cask "firefox" cask "fork" +cask "gitkraken" cask "google-chrome" cask "google-drive-file-stream" cask "handbrake" diff --git a/.config/yadm/bootstrap b/.config/yadm/bootstrap index 6341d57..cc3c1a8 100755 --- a/.config/yadm/bootstrap +++ b/.config/yadm/bootstrap @@ -39,9 +39,9 @@ if [ "$system_type" = "Darwin" ]; then brew bundle --global fi - # Install powerline-go if necessary - if ! command -v powerline-go >/dev/null 2>&1; then - go install github.com/justjanne/powerline-go@latest + # Install starship if necessary + if ! command -v starship >/dev/null 2>&1; then + sh -c "$(curl -fsSL https://starship.rs/install.sh)" fi fi diff --git a/.config/zsh/ecs.zsh b/.config/zsh/ecs.zsh index 1b0096c..ed43bc9 100644 --- a/.config/zsh/ecs.zsh +++ b/.config/zsh/ecs.zsh @@ -17,6 +17,12 @@ ecsInstanceIds() { 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() { cluster=$1 profile=${2:-default} @@ -28,3 +34,16 @@ xecsSsh() { 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 +} diff --git a/.config/zsh/git.zsh b/.config/zsh/git.zsh index 18edd06..4671bf1 100644 --- a/.config/zsh/git.zsh +++ b/.config/zsh/git.zsh @@ -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 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 +} diff --git a/.config/zsh/nvm.zsh b/.config/zsh/nvm.zsh index a7042dd..0e0debf 100644 --- a/.config/zsh/nvm.zsh +++ b/.config/zsh/nvm.zsh @@ -1,2 +1,24 @@ -export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +export NVM_DIR="$HOME/.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 diff --git a/.config/zsh/powerline.zsh b/.config/zsh/powerline.zsh deleted file mode 100644 index 941ac17..0000000 --- a/.config/zsh/powerline.zsh +++ /dev/null @@ -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 diff --git a/.gitconfig b/.gitconfig index 9c66cf1..886bc04 100644 --- a/.gitconfig +++ b/.gitconfig @@ -9,3 +9,5 @@ helper = osxkeychain [pull] rebase = false +[tag] + forceSignAnnotated = true diff --git a/.tmux.conf.local b/.tmux.conf.local index d41e2f4..2f472d0 100644 --- a/.tmux.conf.local +++ b/.tmux.conf.local @@ -378,6 +378,7 @@ set -g @plugin 'tmux-plugins/tmux-cpu' set -g @plugin 'tmux-plugins/tmux-urlview' #set -g @continuum-restore 'on' set -g @plugin 'sainnhe/tmux-fzf' +set -g @plugin 'laktak/extrakto' # -- custom variables ---------------------------------------------------------- diff --git a/.zshrc b/.zshrc index a4811d4..8e42602 100644 --- a/.zshrc +++ b/.zshrc @@ -107,8 +107,4 @@ source $ZSH/oh-my-zsh.sh # uninstall by removing these lines # [ -f ~/.config/tabtab/__tabtab.fish ]; and . ~/.config/tabtab/__tabtab.fish; or true -# 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 +source <("/usr/local/bin/starship" init zsh --print-full-init)