The problem is, your vimrc file is executed before any plugins are loaded. You can check the order of what source files are loaded by issueing the :scriptnames command.
The usual way to fix this problem is to execute the test inside a VimEnter autocommand, something like this:
" do your test here!
You could search the colorscheme file via the runtime path:
if findfile("colors/" .colorscheme .".vim", &rtp) != ""
execute "colorscheme " . colorscheme
Another way is to work with try-catch. Thanks to D. Ben Knoble for the hint. Here is a example from his vimrc:
Checking the output of filter helped diagnose the problem, my vimrc also contained the following line:
" If installed using Homebrew
which referred to a program (fzf) that wasn't installed but also couldn't be installed by vim-plug. Installing it properly fixed the problem.
I cleaned out the installation and pulled the zip of vim-plug and extracted it into the autoload folder in vim82. Before I used the powershell solution.
After that I made a custom plugin folder and gave it read/write permission.
Now it seems to work. Unsure what the issue was but these ae the things that I changed. Also I should have mentioned that I am ...
When you use a separate vimrc through the -u command-line flag, the nocompatible option will not be automatically set, as it is when using the normal user vimrc file.
See :help compatible-default for more details.
You should either add set nocompatible to the top of your alternative vimrc file, or pass Vim the -N command-line option in ...
As posted in the comments:
You have a file where vim-plug wants to create a directory
Create a back up and get it out of the way:
mv ~/.vim/plugged ~/.vim/plugged.bak
Then try again.
Also make sure you own the directory:
sudo chown $USER: ~/.vim
The vim directory can become owned by root if you use sudo vim—the correct technique is to set the ...