Skip to content

Instantly share code, notes, and snippets.

@antiagainst
Last active February 11, 2023 14:19
Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save antiagainst/5b63c39960d875b5d75b to your computer and use it in GitHub Desktop.
Save antiagainst/5b63c39960d875b5d75b to your computer and use it in GitHub Desktop.
Set Up Zsh, Presto, Homebrew, Ruby, Powerline, and Vim on Mac OS X

blog about these tools

Setup Zsh and Prezto

  • Change default shell to Zsh
chsh -s $(which zsh)
  • Clone Presto and install it according to README.md
  • Update ~/.zprofile and ~/.zshrc and commits into forked repo

More on Zsh and Prezto: customize and prompt

Setup Homebrew

  • Install Xcode command line tools
xcode-select --install
  • Download Homebrew installation script
curl -L https://raw.githubusercontent.com/Homebrew/install/master/install > ~/brew.rb
  • Change installation directory to ~/.homebrew
sed -i '' 's/HOMEBREW_PREFIX = .*/HOMEBREW_PREFIX = "#{Dir.home}\/.homebrew".freeze/' ~/brew.rb
# Possibly also change HOMEBREW_REPOSITORY, which is defaulted to /usr/local/Homebrew
# sed -i '' 's/HOMEBREW_REPOSITORY = .*/HOMEBREW_PREFIX = "#{Dir.home}\/Homebrew".freeze/' ~/brew.rb
  • Install
ruby ~/brew.rb
  • Include Homebrew binaries in PATH (make sure ~/.homebrew is searched first)
export PATH=$HOME/.homebrew/bin:$PATH
  • Test everything is right
brew doctor

Setup Ruby

brew install rbenv ruby-build
# rbenv install --list
rbenv install 2.6.1
rbenv global 2.6.1
gem install bundler

Setup Powerline

reference

  • Install Python
brew install python
  • Install Powerline
pip install --user git+git://github.com/Lokaltog/powerline
  • Include Powerline binaries in PATH
export PATH=$HOME/Library/Python/2.7/bin:$PATH
  • Clone powerline fonts and double click the *.otf files in Finder to install patched fonts
  • Add configuration into Zsh, Tmux, and Vim
source /Users/antiagainst/Library/Python/2.7/lib/python/site-packages/powerline/bindings/zsh/powerline.zsh
source /Users/antiagainst/Library/Python/2.7/lib/python/site-packages/powerline/bindings/tmux/powerline.conf
source /Users/antiagainst/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim/plugin/powerline.vim

When see the error error: can't combine user with prefix, exec_prefix/home, or install_(plat)base, check this post.

Setup Vim

reference

  • Install Vim and MacVim
brew install vim --with-python --with-ruby --with-perl
# brew install macvim --env-std --override-system-vim
  • Install Vundle
git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim
  • Open vim and PluginInstall
  • Install YouCompleteMe
brew install cmake
cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment