- 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 should automatically download it for you
- Create vim-plug config file
vim ~/.vim/.vimrc-vim-plug.vim - Press
ito 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
:wqand press return -
Create .vimrc file
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 -
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 returnnote: You may be able to tab complete the command
-
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 returnnote: You may need to force quit, to do this type
:q!and press return