Skip to content

Instantly share code, notes, and snippets.

@pwang2
Last active January 31, 2024 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwang2/12874b6589adfa9ea8c3008fe4c7fc27 to your computer and use it in GitHub Desktop.
Save pwang2/12874b6589adfa9ea8c3008fe4c7fc27 to your computer and use it in GitHub Desktop.
linux init
if [ $UID -eq 0 ]; then
echo "*****************************************************"
echo "$(tput setaf 1)DO NOT RUN AS sudo $(tput sgr 0)"
echo "*****************************************************"
exit 1
fi
ZPLUGINS=$HOME/.oh-my-zsh/custom/plugins
BREW=/home/linuxbrew/.linuxbrew
HAS_MAC=$(uname -a | grep -c Darwin)
sudo mkdir -p $BREW
sudo chown $USER:$GROUPS $BREW
sudo chmod -R 2755 $BREW
if [ ! -d $BREW/Homebrew ]; then
git clone --depth=1 https://github.com/Homebrew/brew $BREW/Homebrew
mkdir -p $BREW/bin
ln -s $BREW/Homebrew/bin/brew $BREW/bin
fi
export PATH=$BREW/bin:$PATH
brew install neovim autojump gist tmux git curl jq nodejs
pip3 install --upgrade --user pynvim
nvim +PlugInstall! +qall!
if [ $HAS_MAC -eq 0 ]; then
curl -sLo $HOME/.hammerspoon/init.lua --create-dirs https://gist.github.com/pwang2/97cdc931eca56d465705a48fe2891e74/raw
brew install --cask macs-fan-control alt-tab dozer hammperspoon alacritty
mkdir -p $HOME/.hammerspoon/Spoons && cd $_
curl -sSLO https://github.com/Hammerspoon/Spoons/raw/master/Spoons/SpoonInstall.spoon.zip
unzip SpoonInstall.spoon.zip
rm SpoonInstall.spoon.zip
else
git config --global core.editor vi
curl -sLo $HOME/.tmux.conf https://gist.github.com/pwang2/e177f57f2bb4a28ed9c4ffd9c37a8edb/raw
curl -sLo $HOME/.zshrc_shared https://gist.github.com/pwang2/4920754877b23edd296a3ccda0b808d2/raw
curl -sLo $HOME/.config/nvim/init.lua --create-dirs https://gist.github.com/pwang2/d3c6cdf14d4495b5b34e36e4b4ebf537/raw
curl -sLo $HOME/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
[ ! -d $ZPLUGINS/zsh-autosuggestions ] && git clone --depth=1 https://github.com/zsh-users/zsh-autosuggestions.git $ZPLUGINS/zsh-autosuggestions
[ ! -d $ZPLUGINS/zsh-syntax-highlighting ] && git clone --depth=1 https://github.com/zsh-users/zsh-syntax-highlighting.git $ZPLUGINS/zsh-syntax-highlighting
[ ! -d $ZPLUGINS/zsh-vi-mode ] && git clone --depth=1 https://github.com/jeffreytse/zsh-vi-mode $ZPLUGINS/zsh-vi-mode
[ ! -d $ZPLUGINS/zsh-evalcache ] && git clone --depth=1 https://github.com/mroth/evalcache $ZPLUGINS/evalcache
[ ! -f $HOME/.zshrc ] && echo "source $HOME/.zshrc_shared" > $HOME/.zshrc
fi
sudo chsh -s $(which zsh) $USER
#GistID: 12874b6589adfa9ea8c3008fe4c7fc27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment