My .vimrc uses pathogen by doing
execute pathogen#infect()
However if I set up a new computer and haven't installed pathogen with
mkdir -p ~/.vim/autoload ~/.vim/bundle && \
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
Then every time I go to edit a file I get a message about pathogen not working (and then I can edit the file).
I'd like my .vimrc call to execute pathogen#infect be dependent on ~/.vim/autoload actually existing.
In shell scripting I would do something like
if test -f ~/.vim/autoload
execute pathogen#infect()
fi
but of course that gives undefined method test. .vimrc uses a different syntax like having " instead of # for comments and for a conditional I don't know what the right format is.
What format I would use for a .vimrc file?