Skip to content

Instantly share code, notes, and snippets.

@jjtroberts
Last active January 8, 2022 18:35
Show Gist options
  • Save jjtroberts/3183a452787e96396769c327682be305 to your computer and use it in GitHub Desktop.
Save jjtroberts/3183a452787e96396769c327682be305 to your computer and use it in GitHub Desktop.
Installs iTerm2, Oh My Zsh, Powerlevel, vim plugins
#! /usr/bin/env bash
# Install Homebrew
## Homebrew prereq
xcode-select --install
## Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install iterm2
brew cask install iterm2
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install and Configure Powerlevel10k Zsh Theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc
## Launch iTerm2 to use configuration wizard
### Options: Meslo Nerd font, Rainbow prompt style,
### Changes are applied to ~/.zshrc and/or ~/.p10k.zsh
# Install and Configure Vim Airline an awesome Vim plugin that polishes the status bar
## Install Vim Plug to manage plugins
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
## Install fonts
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts
cat <<EOF >> ~/.vimrc:
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
call plug#end()
let g:airline_powerline_fonts = 1
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
EOF
## Now reopen Vim and type in :PlugInstall and hit Enter.
# Install and Configure Fuzzy search
brew install fzf
## To install useful key bindings and fuzzy completion:
$(brew --prefix)/opt/fzf/install
cat <<EOF >> ~/.zshrc
export FZF_DEFAULT_OPTS='--height=40% --preview="cat {}" --preview-window=right:60%:wrap'
EOF
cat <<EOF >> ~/.vimrc
set rtp+=/usr/local/opt/fzf
EOF
## Save it and relaunch Vim, type in :FZF command in Vim,
## you will now be able to search for the file to edit
# Install Vim Dark Theme
git clone https://github.com/joshdick/onedark.vim.git ~/onedark
cd ~/onedark
mkdir ~/.vim/colors
cp colors/onedark.vim ~/.vim/colors/
cp autoload/onedark.vim ~/.vim/autoload/
cat <<EOF >> ~/.vimrc
colorscheme onedark
syntax on
set number
highlight Normal ctermbg=None
highlight LineNr ctermfg=DarkGrey
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment