0

I'm new to using vim and am currently using pathogen to manage my plugins. I've attempted to install autoclose my placing the autoclose.vim file in it's own directory in bundle. I've also added the line

execute pathogen#infect()

to the top of my vimrc file, but when I open a new vim file the plugin doesn't seem to work. Any advice?

My vimrc:

execute pathogen#infect()
filetype plugin indent on
set number
syntax on
set laststatus=2

I'm successfully using vim-airline without issue. I have, however, had difficulty adding new color schemes as well.

  • 2
    What does your .vimrc look like? please post – Archangel33 Apr 26 '16 at 0:02
  • 1
    Oh right I've just edited – castled-rook Apr 26 '16 at 1:48
  • "I've attempted to install autoclose my placing the autoclose.vim file in it's own directory in bundle" How does it look like? – romainl Apr 26 '16 at 5:51
  • In the vim directory there are two directories. Autoload and bundle. In bundle I have three directories. Autoclose, nerdtree and vim-airline (the latter two work fine). In the autoclose bundle I have the file autoclose.vim – castled-rook Apr 26 '16 at 17:05
2

Vim plugins are, traditionally, just a set of files you copy into your ~/.vim/. Since Vim looks for different things in different places (~/.vim/autoload/ for plugins to load on start, ~/.vim/plugin/ for things to load on-demand, etc.), plugins themselves follow the same file hierarchy. On installation, plugins are just copied over your existing ~/.vim/, and everything automatically falls into places.

Plugin managers like Pathogen make installation and deinstallation more convinient by letting the user place the files into different directories (in Pathogen's case, somewhere under ~/.vim/bundle/), but they don't change the layout. Thus, the contents of plugin directories still follow Vim's rules about autoload, plugin and so forth.

So all you need to do is respect these rules and place AutoClose.vim into ~/.vim/bundle/AutoClose/plugin/ directory.

  • Are you saying that I need to have a structure /.vim/bundle/autoclose/plugin/autoclose.vim, instead of /.vim/bundle/autoclose/autoclose.vim? – castled-rook Apr 28 '16 at 22:46
2

I don't know where your autoclose.vim comes from, but let say you use this version.

As Alexander Batischev said, your plugin must be put in the plugin (or autoload) directory.

You should just be fine by running a git clone ... or a copy/paste (inside the bundle folder) if your plugin respect this architecture.

All plugin managers I know works the same way, and thus the plugin architecture should always be the following (not complete):

plugin/          " root
  |- plugin/     " your plugin entry point, run on vim start
  |- autoload/   " delayed plugin files loading
  |- doc/        " your documentation files
  \  ...

Have a look at this and this for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.