Enhancing Vim’s Powers on MacOS
Let’s face it, raw VIM tastes like rotten coffee. This article pumps up the VIM juices on your iTerm terminal and makes your terminal adorable. Let’s get started…
The steps will walk you through installing Maximum Awesome which installs MacVim along with Color Themes. The later steps install additional themes from flazz/vim-colorschemes as well as the VIM Airline Plugin Theme.
Step #1: Install Maximum Awesome
First switch to your home directory (i.e. /Users/username ) and clone it there.
# Go to home directory
cd ~
# Clone maximum-awesome
git clone https://github.com/square/maximum-awesome.git
# Install it
cd maximum-awesome
rakeThis will take sometime to finish, go for a break.
“rake” command failing?
You might need to uninstall vim since maximum awesome is trying to install macvim and is finding existing files it can’t overwrite. Uninstall vim and run the rake command again will get it resolved.
Step #2: Download the VIM Color Schemes Collection
Go to maximum-awesome directory and clone the vim-colorschemes github repository
# Go to home directory
cd ~
git clone https://github.com/flazz/vim-colorschemes
mv vim-colorschemes/colors maximum-awesome/vim/.
rm -rf vim-colorschemesNow the `~/.vim/colors` folder is ready.
Step #3: Select a color scheme
My favorite color scheme is named madeofcode . You can browse the colors folder you just copied in Step#3 and select a color scheme that suits you.
To set a color scheme open ~/.vimrc.local for editing and on line 13 fill-in your color scheme:
vim ~/.vimrc.local
# Edit line 13
13: colorscheme madeofcode
# Now save the file using :wqStep #4: Install the VIM Airline Plugin
I prefer to install VIM Airlines Plugin manually and directly from github to avoid any security issues.
# Download it first
cd ~
git clone https://github.com/vim-airline/vim-airline.git
# Copy the necessary files to .vim directories
mv vim-airlines/autoload/* ~/.vim/autoload/.
mv vim-airlines/plugin/* ~/.vim/plugin/.
# Remove the temp git clone
rm -rf vim-airlinesStep #5: Install the powerline font for VIM Airline to look great
cd ~
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fontsStep #6: Open your VIM and enjoy your new VIM status bar
Step #7: Know how to use the VIM plugins, most importantly `NERDTree`
maximum-awesome comes packed with useful VIM plugins located in the file ~/.vim/bundle/nerdtree To utilize it while in Vim, run :NERDTree or use the shortcut key ,d.
Step #8: Know what you installed
maximum-awesome creates the following symbolic links to integrate with vim:
.vim -> /Users/myusername/Library/maximum-awesome/vim
.vimrc -> /Users/myusername/Library/maximum-awesome/vimrc
.vimrc.bundles -> /Users/myusername/Library/maximum-awesome/vimrc.bundles
That’s it, now you no longer need to be embarrassed from your terminal’s dull look when sharing the screen with your coworkers. Enjoy!
References
(1) MacOS Setup Guide - VIM
https://sourabhbajaj.com/mac-setup/Vim/README.html
(2) Configure iTerm2 and Vim like a Pro
https://medium.com/@jeantimex/how-to-configure-iterm2-and-vim-like-a-pro-on-macos-e303d25d5b5c
(3) Github Project - Maximum Awesome
https://github.com/square/maximum-awesome
(4) Github Project - VIM Airline Plugin
https://github.com/vim-airline/vim-airline
(5) Github Project - Powerline Fonts
https://github.com/powerline/fonts
(6) GitHub Project - VIM Color Schemes (has my favorite 'madeofcode' vim theme)
https://github.com/flazz/vim-colorschemes