This is my vim setup.
Here's how to get started:
- If setting up a new environment:
- Setup Oh My Zsh to make the shell look nice. I tend to like the
ZSH_THEME="bira"
setting. - Install
powerline-fonts
using the instructions linked in that repo. Note that, if using iTerm2, need to set both the Regular font and the Non-ASCII Font in "iTerm > Preferences > Profiles > Text" to use a patched font (Meslo LG M Bold for Powerline), per this issue. - It's nice to use the
z command
. Follow the steup instructions from that repo.
- Setup Oh My Zsh to make the shell look nice. I tend to like the
- Clone this repo.
- Create a symlink in the home directory to the vimrc in this repo using
ln -s /full/path/to/vimrc ~/.vimrc
, and similarly forlatexmkrc
. - Set up neovim:
brew install neovim
andpip3 install neovim-remote
, then add the following lines to your.zshrc
file:export NVIM_LISTEN_ADDRESS=/tmp/nvimserver
andalias vim="nvim -u ~/.vimrc --listen $NVIM_LISTEN_ADDRESS"
- Install needed packages for fzf:
brew install the_silver_searcher fzf
- Install Vundle using
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
- Open vim, and install all packages using:
:VundleInstall
- Install Skim pdf viewer.
- Set up Skim for backwards search for LaTeX: go to Preferences > Sync, then
under PDF-TeX support, choose
Preset: custom
,command: nvr
, and arguments--servername /tmp/nvimserver --remote-silent %file -c %line
The following plugins will be installed by running :VundleInstall
:
- Vundle
- a vim plugin manager
- vim-airline
- Nice-looking status/tab line
- vim-airline-themes
- Themes for vim-airline
- vim-fugitive
- Git plugin for vim
- Allows vim-airline to display git branch info
- vim-colors-solarized
- For a nice vim color scheme
- vimtex
- Easily compile/load pdf/clean directory for Latex
- Note: To compile multi-file project, specify main file using an indicator
file
<name of main file WITHOUT .tex>.latexmain
- This config also depends on Skim PDF viewer. Follow instructions in the above list to make the viewer work nicely with this setup
- I use neovim for my vim editor. To make sure that backwards search works
with Skim, make sure to open nvim listening to a server:
nvim -u ~/.vimrc --listen /tmp/nvimserver
- auto-pairs
- Auto-close parens and such
- supertab
- Light-weight tab completion
- NERDCommenter
- Easily comment lines
- NERDTree
- Display the file tree
- fzf.vim
- Quickly search for files (by typing
<Leader>f
, i.e.\f
) and text (by typing<Leader>a
, i.e.\a
) - Note that this relies on both
fzf
andthe_silver_searcher
being installed through homebrew, as mentioned above.
- Quickly search for files (by typing