Various updates

- change to tmux in lieu of zellij
- disable obsidian nvim plugin
- add vim-ai nvim plugin
- add gitclone.sh script
This commit is contained in:
Jacob Bohanon
2025-03-07 07:12:01 -05:00
parent ad93df5f2f
commit 52c0e15303
9 changed files with 281 additions and 96 deletions

View File

@@ -5,7 +5,7 @@ export EDITOR=nvim
if [[ -d "/home/linuxbrew" ]]; then eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"; fi
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:/opt/local/bin:$PATH
export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:/opt/local/bin:$HOME/.node_modules/bin:$PATH
# Add the zig path used by myzvm
export PATH=$HOME/.zig/zig:$PATH
@@ -29,10 +29,6 @@ else
echo ""
echo "see https://github.com/settings/tokens for creating a github access token"
echo "export GITHUB_TOKEN=<token>"
echo ""
echo "see https://github.com/solo-io/licensing for generating licenses"
echo "export GLOO_LICENSE_KEY=<gloo edge enterprise license>"
echo "export GLOO_MESH_LICENSE_KEY=<gloo mesh enterprise license>"
fi
alias pls='sudo'
@@ -66,4 +62,12 @@ export TERM=xterm-256color
export STARSHIP_CONFIG=~/.config/zsh/starship.toml
# the gitclone.sh script is designed to be run in a subshell. it executes
# the git clone and then returns a pushd to the caller. With this function, we
# simply `eval` that command so that we effectively git clone a repo from anywhere
# into the correct directory and the move into that directory
function gclone () {
eval $(gitclone.sh $1)
}
eval "$(starship init zsh)"

View File

@@ -1,70 +0,0 @@
SOLO_DIR="$HOME/src/github.com/solo-io"
SOLO_GITHUB="https://github.com/solo-io"
mkdir -p $SOLO_DIR
REPOS=(
"gloo"
"gloo-fed"
"solo-projects"
"solo-apis"
"solo-kit"
"dev-portal"
"gloo-mesh"
"gloo-mesh-ui"
"gloo-mesh-enterprise"
"ext-auth-service"
"rate-limiter"
"caching-service"
"envoy-gloo"
"envoy-gloo-ee"
)
for repo in "${REPOS[@]}"
do
repo_addr="${SOLO_GITHUB}/${repo}"
repo_dir="${SOLO_DIR}/${repo}"
if [[ ! -d $repo_dir ]]; then
pushd $SOLO_DIR
git clone $repo_addr
popd
fi
done
function nvim_readme() {
nvim ./README.md
}
# Aliases to reach different repos
alias cdsi='cd $SOLO_DIR'
alias cdg='cd $SOLO_DIR/gloo'
alias nvg='cdg && nvim_readme'
alias cdgf='cd $SOLO_DIR/gloo-fed'
alias nvgf='cdgf && nvim_readme'
alias cdsp='cd $SOLO_DIR/solo-projects'
alias nvsp='cdsp && nvim_readme'
alias cdsa='cd $SOLO_DIR/solo-apis'
alias nvsa='cdsa && nvim_readme'
alias cdsk='cd $SOLO_DIR/solo-kit'
alias nvsk='cdsk && nvim_readme'
alias cddp='cd $SOLO_DIR/dev-portal'
alias nvdp='cddp && nvim_readme'
alias cdgm='cd $SOLO_DIR/gloo-mesh'
alias nvgm='cdgm && nvim_readme'
alias cdgmui='cd $SOLO_DIR/gloo-mesh-ui'
alias nvgmui='cdgmui && nvim_readme'
alias cdgme='cd $SOLO_DIR/gloo-mesh-enterprise'
alias nvgme='cdgme && nvim_readme'
alias cdea='cd $SOLO_DIR/ext-auth-service'
alias nvea='cdea && nvim_readme'
alias cdrl='cd $SOLO_DIR/rate-limiter'
alias nvrl='cdrl && nvim_readme'
alias cdcs='cd $SOLO_DIR/caching-service'
alias nvcs='cdcs && nvim_readme'
alias cdeg='cd $SOLO_DIR/envoy-gloo'
alias nveg='cdeg && nvim_readme'
alias cdee='cd $SOLO_DIR/envoy-gloo-ee'
alias nvee='cdee && nvim_readme'
alias cde='cd $SOLO_DIR/../envoyproxy/envoy'
alias nve='cde && nvim_readme'

43
zsh/gitclone.sh Normal file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
url=$1
# make sure we have a valid git url. only works with http/s
regex='^https?://[^/]+/[^/]+/[^/]+(\.git)?$'
if [[ ! $"url" =~ $regex ]]; then
echo "echo \"$url does not match regex\""
exit 1
fi
# turn our url into a repo path
repo="${url#"http://"}"
repo="${repo#"https://"}"
repo="${repo%".git"}"
# get the location where we will clone this repo
repodir="$HOME/src/${repo}"
# get th directory we will need to be in to call the git clone
dir="${repodir%/*}"
# check for existence of git command
if [[ -z $(which git) ]]; then
echo "echo 'git executable not found'"
exit 1
fi
mkdir -p "$dir"
pushd $dir > /dev/null
# perform the git clone and check output
output="$(git clone $url)"
if [[ $? > 0 ]]; then
popd > /dev/null
(rmdir $repodir && rmdir $dir) || true
echo "echo 'git clone operation failed'"
exit 1
fi
# return our pushd command to the calling shell
echo "pushd ${repodir}"