Skip to content

Instantly share code, notes, and snippets.

@tall3n
Last active March 22, 2019 03:48
Show Gist options
  • Save tall3n/d13f3f4cf8f8a0579a80405c87baa6d7 to your computer and use it in GitHub Desktop.
Save tall3n/d13f3f4cf8f8a0579a80405c87baa6d7 to your computer and use it in GitHub Desktop.
Automatically compiles the latest version of vim and installs go flavored plugins.
echo "Installing Dependencies"
sudo yum install ncurses-devel -y
sudo yum install git -y
sudo yum autoremove -y vim
sudo yum groupinstall -y "Development Tools"
echo "Cloning VIM repo"
git clone https://github.com/vim/vim.git
cd vim/src
echo "Compiling Code"
make -j8
echo "Making VIM Binary"
sudo make install
cp vim /usr/bin
echo "Downloading Plugin Manager"
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo "Removing old vimrc file if exists"
rm ~/.vimrc
echo "call plug#begin('~/.vim/plugged')" >> ~/.vimrc
echo "Plug 'fatih/vim-go'" >> ~/.vimrc
echo "call plug#end()" >> ~/.vimrc
echo "filetype off" >> ~/.vimrc
echo "filetype plugin indent on" >> ~/.vimrc
echo "set number" >> ~/.vimrc
echo "set noswapfile" >> ~/.vimrc
echo "set noshowmode" >> ~/.vimrc
echo "set ts=2 sw=2 sts=2 et" >> ~/.vimrc
echo "set backspace=indent,eol,start" >> ~/.vimrc
echo "\"Map <leader> to comma" >> ~/.vimrc
echo "let mapleader=\",\"" >> ~/.vimrc
echo "if has(\"autocmd\")" >> ~/.vimrc
echo "autocmd FileType go set ts=2 sw=2 sts=2 noet nolist autowrite" >> ~/.vimrc
echo "endif" >> ~/.vimrc
vim +PlugInstall +qa
vim +GoInstallBinaries +qa
cp /usr/bin/vim /usr/bin/vi
echo "Cleaning up...."
rm -rf vim
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment