Instalação do Vim-plug no Ubuntu 16.10

1

Sou um novo usuário do Ubuntu e gostaria de um pouco de ajuda com plugins. De acordo com este site , instalei o comando vim-plug with curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim . Eu também criei o diretório ~/.vim/plugged como sugerido. Até agora eu sei que tenho que instalar meus plugins dentro (em ~/.vimrc file):

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

call plug#end()

É indicado que eu tenha o conteúdo do "Download plug.vim" disponível dentro do diretório 'autoload'.

Pergunta 1: O que é o diretório 'autoload' aqui?

Na verdade, quero instalar o vim-plug para instalar vários plugins como nerdtree . A maneira que eu entendi o procedimento é passar pelo site link , e levar apenas a parte scrooloose/nerdtree para instalar o plugin:

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

Plug 'scrooloose/nerdtree'

call plug#end()

execute :PlugInstall .

Pergunta 2: Alguém poderia me dizer onde eu tenho um problema (se houver)?

    
por muru 15.01.2017 / 23:30

1 resposta

0

Em :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.

Portanto, autoload é um diretório no qual você pode eliminar arquivos que definem funções, e o arquivo só é lido quando a função é chamada pela primeira vez. Isso torna a inicialização mais rápida.

    
por muru 16.01.2017 / 02:44