diff --git a/neovim/init.lua b/neovim/init.lua index a4562fa..35b24b4 100644 --- a/neovim/init.lua +++ b/neovim/init.lua @@ -56,16 +56,12 @@ vim.keymap.set('n', 'wq', 'TroubleToggle workspace_diagnostics' -- vim-plug local data_dir = vim.fn.stdpath('data') vim.cmd([[ -" Install vim-plug if not found -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 +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' endif -" Run PlugInstall if there are missing plugins -autocmd VimEnter * if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) - \| PlugInstall --sync | source $MYVIMRC -\| endif +autocmd VimEnter * PlugInstall --sync | source $MYVIMRC ]]) local Plug = vim.fn['plug#']