Merge branch 'master' of https://github.com/jbohanon/.dotfiles
This commit is contained in:
9
.gitconfig
Normal file
9
.gitconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
[user]
|
||||
name = Jacob Bohanon
|
||||
email = jacobbohanon@gmail.com
|
||||
[url "ssh://git@github.com/"]
|
||||
insteadOf = https://github.com/
|
||||
[tag]
|
||||
sort = version:refname
|
||||
[init]
|
||||
defaultBranch = master
|
||||
35
init.sh
Normal file
35
init.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
#Install zsh
|
||||
#Install neovim
|
||||
#Install ripgrep
|
||||
#Install fd
|
||||
sudo add-apt-repository ppa:neovim-ppa/stable
|
||||
sudo apt update && sudo apt install -y zsh neovim ripgrep fd-find fzf
|
||||
#Install oh-my-zsh
|
||||
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
#Install oh-my-zsh plugins
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
#install vim-plug
|
||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
#Clone dotfiles
|
||||
cd ~ && git clone https://github.com/jbohanon/.dotfiles
|
||||
#Make directories & symlinks
|
||||
mkdir $HOME/.config
|
||||
ln -s $HOME/.dotfiles/zsh $HOME/.config/zsh
|
||||
ln -s $HOME/.dotfiles/nvim $HOME/.config/nvim
|
||||
ln -s $HOME/.config/nvim/.vimrc $HOME/.vimrc
|
||||
ln -s $HOME/.config/zsh/.zshrc $HOME/.zshrc
|
||||
#Install powerline-fonts
|
||||
sudo apt install fonts-powerline
|
||||
#Install starship
|
||||
curl -sS https://starship.rs/install.sh | sh
|
||||
#Install mygvm
|
||||
mkdir $HOME/go
|
||||
mkdir -p $HOME/.go/downloads
|
||||
ln -s $HOME/.dotfiles/zsh/mygvm /usr/local/bin/mygvm
|
||||
|
||||
#Install Go
|
||||
mygvm go1.18.6
|
||||
|
||||
#link gitconfig
|
||||
ln -s $HOME/.dotfiles/.gitconfig $HOME/.gitconfig
|
||||
@@ -95,7 +95,7 @@ nnoremap <Leader>fh <cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>
|
||||
nnoremap <Leader>err oif err != nil {<CR>return nil, err<CR>}<CR><esc>kkI<esc>
|
||||
nnoremap <buffer> <silent> <C-[> :GoReferrers<cr>
|
||||
|
||||
nnoremap <Leader>q :bd<CR>
|
||||
nnoremap <Leader>q :bp\|bd #<CR>
|
||||
nnoremap <Leader>w :w<CR>
|
||||
nnoremap <Leader>n :bn<CR>
|
||||
nnoremap <Leader>b :bp<CR>
|
||||
@@ -116,8 +116,10 @@ tnoremap <c-j> <c-\><c-n><c-w><c-j>
|
||||
tnoremap <c-k> <c-\><c-n><c-w><c-k>
|
||||
tnoremap <c-h> <c-\><c-n><c-w><c-h>
|
||||
tnoremap <c-l> <c-\><c-n><c-w><c-l>
|
||||
tnoremap <Esc> <C-\><C-n>
|
||||
nnoremap <Leader>ee :NvimTreeFindFileToggle<cr>
|
||||
nnoremap <Leader>h <cmd>lua require("harpoon.mark").add_file()<cr>
|
||||
nnoremap <c-/> :Commentary<cr>
|
||||
|
||||
vnoremap J :m '>+1<CR>gv=gv
|
||||
vnoremap K :m '<-2<CR>gv=gv
|
||||
@@ -280,3 +282,7 @@ lua <<EOF
|
||||
})
|
||||
})
|
||||
EOF
|
||||
|
||||
lua << EOF
|
||||
require'lspconfig'.pyright.setup{}
|
||||
EOF
|
||||
|
||||
Submodule zsh/.oh-my-zsh deleted from ed411d3ff1
@@ -1,9 +1,9 @@
|
||||
# GO stuff
|
||||
export GOPATH="${HOME}/go"
|
||||
#export GOROOT="$(brew --prefix golang)/libexec"
|
||||
export GOROOT="/usr/local/go"
|
||||
export GOROOT="${HOME}/.go/go"
|
||||
export GOBIN="${GOROOT}/bin"
|
||||
export PATH=${GOPATH}/bin:${GOROOT}/bin:$PATH
|
||||
export GOPRIVATE="github.com/solo-io"
|
||||
export ACK_GINKGO_DEPRECATIONS=1.16.5
|
||||
export GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn
|
||||
export GOLANG_PROTOBUF_REGISTRATION_CONFLICT=ignore
|
||||
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
# Aliases to reach different repos
|
||||
alias cdsi='cd $GOPATH/src/github.com/solo-io'
|
||||
alias cdg='cd $GOPATH/src/github.com/solo-io/gloo'
|
||||
alias nvg='nvim $GOPATH/src/github.com/solo-io/gloo/README.md'
|
||||
alias cdgf='cd $GOPATH/src/github.com/solo-io/gloo-fed'
|
||||
alias nvgf='nvim $GOPATH/src/github.com/solo-io/gloo-fed/README.md'
|
||||
alias cdsp='cd $GOPATH/src/github.com/solo-io/solo-projects'
|
||||
alias nvsp='nvim $GOPATH/src/github.com/solo-io/solo-projects/README.md'
|
||||
alias cdsa='cd $GOPATH/src/github.com/solo-io/solo-apis'
|
||||
alias nvsa='nvim $GOPATH/src/github.com/solo-io/solo-apis/README.md'
|
||||
alias cddp='cd $GOPATH/src/github.com/solo-io/dev-portal'
|
||||
alias nvdp='nvim $GOPATH/src/github.com/solo-io/dev-portal/README.md'
|
||||
alias cdgm='cd $GOPATH/src/github.com/solo-io/gloo-mesh'
|
||||
alias nvgm='nvim $GOPATH/src/github.com/solo-io/gloo-mesh/README.md'
|
||||
alias cdgmui='cd $GOPATH/src/github.com/solo-io/gloo-mesh-ui'
|
||||
alias nvgmui='nvim $GOPATH/src/github.com/solo-io/gloo-mesh-ui/README.md'
|
||||
alias cdgme='cd $GOPATH/src/github.com/solo-io/gloo-mesh-enterprise'
|
||||
alias nvgme='nvim $GOPATH/src/github.com/solo-io/gloo-mesh-enterprise/README.md'
|
||||
alias cdea='cd $GOPATH/src/github.com/solo-io/ext-auth-service'
|
||||
alias nvea='nvim $GOPATH/src/github.com/solo-io/ext-auth-service/README.md'
|
||||
alias cdrl='cd $GOPATH/src/github.com/solo-io/rate-limiter'
|
||||
alias nvrl='nvim $GOPATH/src/github.com/solo-io/rate-limiter/README.md'
|
||||
alias cdsi='cd $HOME/src/github.com/solo-io'
|
||||
alias cdg='cd $HOME/src/github.com/solo-io/gloo'
|
||||
alias nvg='nvim $HOME/src/github.com/solo-io/gloo/README.md'
|
||||
alias cdgf='cd $HOME/src/github.com/solo-io/gloo-fed'
|
||||
alias nvgf='nvim $HOME/src/github.com/solo-io/gloo-fed/README.md'
|
||||
alias cdsp='cd $HOME/src/github.com/solo-io/solo-projects'
|
||||
alias nvsp='nvim $HOME/src/github.com/solo-io/solo-projects/README.md'
|
||||
alias cdsa='cd $HOME/src/github.com/solo-io/solo-apis'
|
||||
alias nvsa='nvim $HOME/src/github.com/solo-io/solo-apis/README.md'
|
||||
alias cddp='cd $HOME/src/github.com/solo-io/dev-portal'
|
||||
alias nvdp='nvim $HOME/src/github.com/solo-io/dev-portal/README.md'
|
||||
alias cdgm='cd $HOME/src/github.com/solo-io/gloo-mesh'
|
||||
alias nvgm='nvim $HOME/src/github.com/solo-io/gloo-mesh/README.md'
|
||||
alias cdgmui='cd $HOME/src/github.com/solo-io/gloo-mesh-ui'
|
||||
alias nvgmui='nvim $HOME/src/github.com/solo-io/gloo-mesh-ui/README.md'
|
||||
alias cdgme='cd $HOME/src/github.com/solo-io/gloo-mesh-enterprise'
|
||||
alias nvgme='nvim $HOME/src/github.com/solo-io/gloo-mesh-enterprise/README.md'
|
||||
alias cdea='cd $HOME/src/github.com/solo-io/ext-auth-service'
|
||||
alias nvea='nvim $HOME/src/github.com/solo-io/ext-auth-service/README.md'
|
||||
alias cdrl='cd $HOME/src/github.com/solo-io/rate-limiter'
|
||||
alias nvrl='nvim $HOME/src/github.com/solo-io/rate-limiter/README.md'
|
||||
|
||||
|
||||
117
zsh/mygvm
Executable file
117
zsh/mygvm
Executable file
@@ -0,0 +1,117 @@
|
||||
#!/bin/bash
|
||||
list_versions() {
|
||||
echo "installed versions:"
|
||||
for i in "$HOME"/.go/go1*; do basename "$i"; done
|
||||
echo ""
|
||||
}
|
||||
|
||||
install_version() {
|
||||
check_valid $1
|
||||
if [[ $valid != 'true' ]]; then
|
||||
echo "invalid version $1"
|
||||
echo "using $(go version)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
fname="$HOME/.go/downloads/$1.$goos-$goarch.tar.gz"
|
||||
|
||||
if [[ ! -f $fname ]]; then
|
||||
curl -Lo $fname https://dl.google.com/go/$1.$goos-$goarch.tar.gz
|
||||
fi
|
||||
cd $HOME/.go/downloads
|
||||
tar -zxf $1.$goos-$goarch.tar.gz
|
||||
mv go/ ../$1
|
||||
check_exists $1
|
||||
link_version $1
|
||||
}
|
||||
|
||||
link_version() {
|
||||
if [[ $exists == 'true' ]]; then
|
||||
ln -sfn $HOME/.go/$1 $HOME/.go/go
|
||||
fi
|
||||
}
|
||||
|
||||
check_valid() {
|
||||
if [[ $1 =~ go1\.[0-9]{1,2}\.[0-9]{1,2} ]]; then
|
||||
valid='true'
|
||||
fi
|
||||
}
|
||||
|
||||
check_exists() {
|
||||
if [[ -d $HOME/.go/$1 ]]; then
|
||||
exists='true'
|
||||
fi
|
||||
}
|
||||
|
||||
remove_version() {
|
||||
check_exists $1
|
||||
if [[ $exists == 'true' ]]; then
|
||||
if [[ $current_link == $1 ]]; then
|
||||
echo "cannot remove version $1 because it is currently in use"
|
||||
else
|
||||
rm -rf $HOME/.go/$1
|
||||
echo "removed version $1"
|
||||
fi
|
||||
else
|
||||
echo "version $1 not installed"
|
||||
fi
|
||||
}
|
||||
|
||||
prompt_install() {
|
||||
echo "$1 not found in $HOME/.go"
|
||||
list_versions
|
||||
check_valid $1
|
||||
|
||||
if [[ $valid == 'true' ]]; then
|
||||
echo "attempt to download and install? [y/n]"
|
||||
read input
|
||||
if [[ $input == 'y' ]]; then
|
||||
install_version $1
|
||||
fi
|
||||
else
|
||||
echo "invalid version $1"
|
||||
echo "using $(go version)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
mkdir -p "$HOME/.go/downloads"
|
||||
current_link=$(basename $(readlink $HOME/.go/go))
|
||||
uname_m=$(uname -m)
|
||||
goarch='amd64'
|
||||
if [[ $uname_m == 'arm64' || $uname_m == 'aarch64' ]]; then
|
||||
goarch='arm64'
|
||||
fi
|
||||
goos='linux'
|
||||
if [[ $(uname) == 'Darwin' ]]; then
|
||||
goos='darwin'
|
||||
fi
|
||||
valid='false'
|
||||
exists='false'
|
||||
|
||||
check_exists $1
|
||||
if [[ $1 == '' ]]; then
|
||||
list_versions
|
||||
elif [[ $1 == 'list' ]]; then
|
||||
list_versions
|
||||
elif [[ $1 == 'remove' ]]; then
|
||||
remove_version $2
|
||||
elif [[ $1 == 'uninstall' ]]; then
|
||||
remove_version $2
|
||||
elif [[ $1 == 'install' ]]; then
|
||||
install_version $2
|
||||
elif [[ $1 == 'use' ]]; then
|
||||
check_exists $2
|
||||
if [[ $exists == true ]]; then
|
||||
link_version $2
|
||||
else
|
||||
prompt_install $2
|
||||
fi
|
||||
elif [[ $exists == 'true' ]]; then
|
||||
link_version $1
|
||||
else
|
||||
prompt_install $1
|
||||
fi
|
||||
|
||||
echo "using $(go version)"
|
||||
|
||||
Reference in New Issue
Block a user