1

I'm a new user of Ubuntu, and I'd like a little bit of help with plugins. According to this website, I installed vim-plug with curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim command. I have also created the directory ~/.vim/plugged as suggested. So far I know I have to install my plugins inside (in ~/.vimrc file):

call plug#begin('~/.vim/plugged')

call plug#end()

It is indicated I have to make the content of "Download plug.vim" available inside the 'autoload' directory.

Question 1: What is the 'autoload' directory here?

In fact, I want to install vim-plug to install several plugins like nerdtree. The way I understand the procedure is to go over the website https://github.com/scrooloose/nerdtree, and take only the part scrooloose/nerdtree to install the plugin :

call plug#begin('~/.vim/plugged')

Plug 'scrooloose/nerdtree'

call plug#end()

then execute :PlugInstall.

Question 2: Could anyone be able to tell me where do I have an issue (if there are)?

1
  • "Could anyone be able to tell me where do I have an issue (if there are)?" That's now how this site works. You identify the issue and ask how to solve it.
    – muru
    Jan 16, 2017 at 1:45

1 Answer 1

0

From :h autoload:

AUTOMATICALLY LOADING FUNCTIONS 
                                                        autoload-functions
When using many or large functions, it's possible to automatically define them
only when they are used.  There are two methods: with an autocommand and with
the "autoload" directory in 'runtimepath'.

...

Using an autoload script 
                                                        autoload E746
This is introduced in the user manual, section 41.15.

Using a script in the "autoload" directory is simpler, but requires using
exactly the right file name.  A function that can be autoloaded has a name
like this: 

        :call filename#funcname()

When such a function is called, and it is not defined yet, Vim will search the
"autoload" directories in 'runtimepath' for a script file called
"filename.vim".  For example "~/.vim/autoload/filename.vim".  That file should
then define the function like this: 

        function filename#funcname()
           echo "Done!"
        endfunction

The file name and the name used before the # in the function must match
exactly, and the defined function must have the name exactly as it will be
called.

So, autoload is a directory where you can drop files that define functions, and the file is only read when the function is called for the first time. This makes startup faster.

You must log in to answer this question.