Vim setup

Vim is the classic text/code editor, with many cool customizations. If used correctly, it can be the best efficient IDE on your HPC as well.

There are many good Youtube tutorials on how to customize Vim. For example:

Use the following script to install latest version of Vim locally on cluster:

# mkdir
mkdir -p $HOME/local/bin
mkdir -p $HOME/local/share

# configure vim
cd $HOME/src
git clone https://github.com/vim/vim.git; cd vim
./configure --enable-pythoninterp=yes --enable-python3interp=yes
mkdir -p $HOME/local/share/vim
make VIMRUNTIMEDIR=$HOME/local/share/vim
cp ./src/vim $HOME/local/bin/
cp -r ./runtime/* $HOME/local/share/vim/

# configure vim plugins/plugin-manager
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
# now go to Vim and type ":PluginInstall"

# TROUBLESHOOTING for MacOS [still cannot run for YouCompleteMe]:
# see: https://superuser.com/questions/1115159/how-do-i-install-vim-on-osx-with-python-3-support
#cd $HOME/.vim/bundle/YouCompleteMe/ ; python install.py

# vim completes me; better than YouCompleteMe
git clone git://github.com/ajh17/VimCompletesMe.git ~/.vim/pack/vendor/start/VimCompletesMe

In Cedars HPE, the configure step will throw an error about "No Terminal Library Found". Here is how to fix it. First, download the latest (or whichever) version of libncurses: http://ftp.gnu.org/pub/gnu/ncurses/

Then compile it locally, and re-configure vim with LDFLAGS point to it:

cd <path_to_ncurses>
tar xzvf <ncurses>.tar.gz # change the tar command if it is not a tar.gz
cd <ncurses>
./configure --prefix=$HOME/local
make
make install
cd <path_to_vim>
LDFLAGS=-L$HOME/local/lib ./configure --enable-pythoninterp=yes --enable-python3interp=yes # then add any options e.g. --prefix=$HOME/local
make
make install

Last updated