Auto install vim plug manager if not installed 🔌

This commit is contained in:
Anas Elgarhy 2022-05-03 16:15:01 +02:00
parent 1289f11180
commit 07306e2a18

View file

@ -8,6 +8,14 @@
:set encoding=UTF-8
:set clipboard+=unnamedplus " Allow nvim to copy/paste from/to the clipboard"
" Install vim-plug if not already installed
if ! filereadable(system('echo -n "${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim"'))
echo "Downloading junegunn/vim-plug to manage plugins..."
silent !mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/
silent !curl "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" > ${XDG_CONFIG_HOME:-$HOME/.config}/nvim/autoload/plug.vim
autocmd VimEnter * PlugInstall
endif
" Plugins
call plug#begin()
Plug 'https://github.com/wakatime/vim-wakatime' " wakatime plugin