Repository navigation
Local Setup: Vim and git
Hunter Rancourt edited this page Aug 19, 2020
·
1 revision
The Vim plugins used below will add several helpful features to Vim including:
- Changing the git message title text color after the 50th character (following Github's standards)
- Wrap git message body text at 75...ish characters
- Download vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimnote: You may be able to skip curling the file as the config (below) should automatically download it for you
- Create a vim-plug config file
- Run
vim ~/.vim/.vimrc-vim-plug.vim - Press
ito enter Vim's insert mode and paste the following:
" vim-plug info https://github.com/junegunn/vim-plug " Make sure vim-plug is installed if empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd VimEnter * PlugInstall --sync | source $MYVIMRC endif " Specify a directory for plugins call plug#begin('~/.vim/plugged') " Any Valid github url is allowed and you can use shorthand as well " Git Tools - adds git commit message line highlighting up to 50 chars and other useful features Plug 'tpope/vim-fugitive' " Sensible Vim - adds some generally accepted good changes to vim's config Plug 'tpope/vim-sensible' " Initialize plugin system call plug#end()
- Save and close: press escape then
:wqand press return
- Run
- Create a .vimrc file
- Run
vim ~/.vimrc - Press
ito enter input mode and paste the following:
" vim-plug vim plugin/package manager try source ~/.vim/.vimrc-vim-plug.vim catch " file not found or error, fail silently endtry " You may add any other mods you'd like to make here
- Save and close: press escape then
:wqand press return
- Run
- Now open a junk file in vim
vim delete-test(we wont save this) - Now we'll install the plugins from our vim-plug config
- Type
:PlugInstalland press return note: You may be able to tab complete the command
- Type
- Once the install completes you can quit vim-plug by typing
:qand pressing return - Finally quit vim itself without saving the file by typing
:qand pressing return
note: You may need to force quit, to do this type :q! and press return