Skip to content

Instantly share code, notes, and snippets.

@skwid138
Last active May 3, 2021
Embed
What would you like to do?

Vim Setup

Vim Package Manager

curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

note: You may be able to skip curling the file as the config should automatically download it for you

  • Create vim-plug config file vim ~/.vim/.vimrc-vim-plug.vim
  • Press i to enter input 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 :wq and press return

  • Create .vimrc file vim ~/.vimrc

  • Press i to 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 :wq and press return

  • 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 :PlugInstall and press return

    note: You may be able to tab complete the command

  • Once the install completes you can quit vim-plug by typing :q and pressing return

  • Finally quit vim itself without saving the file by typing :q and pressing return

    note: You may need to force quit, to do this type :q! and press return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment