Skip to content

Instantly share code, notes, and snippets.

@pwang2
Last active June 10, 2024 18:01
Show Gist options
  • 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
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
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/zsh-evalcache
[ ! -f $HOME/.zshrc ] && echo "source $HOME/.zshrc_shared" > $HOME/.zshrc
nvim +PlugInstall! +qall!
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