Why isn't the scripts in my autoload folder being executed in Vim?

Posted by Codemonkey on Super User See other posts from Super User or by Codemonkey
Published on 2013-11-03T05:35:33Z Indexed on 2013/11/03 10:01 UTC
Read the original article Hit count: 745

Filed under:
|

I'm trying to use Pathogen to manage my Vim extensions. My bundle folder looks like this:

.../bundle/
+-- vim-pathogen
¦   +-- autoload
¦       +-- pathogen.vim
+-- vim-smoothscroll
    +-- autoload
        +-- smooth_scroll.vim

And my vimrc file includes this:

let s:root = fnamemodify(resolve(expand(":p")), ":h")

" Initiate pathogen.
exec "source " . s:root . "/vimfiles/bundle/vim-pathogen/autoload/pathogen.vim"
exec pathogen#infect()

My vimrc file is a symlink located in ~ but pointing to a folder inside my Dropbox folder.

This appears to work when I start Vim. Pathogen has added vim-smoothscroll to my runtimepath:

:set runtimepath?
runtimepath=~/Dropbox/Personal/config_sync/vim/vimfiles,~/Dropbox/Personal/config_sync/vim/vimfiles/bundle/vim-p
athogen,~/Dropbox/Personal/config_sync/vim/vimfiles/bundle/vim-smoothscroll,~/.vim,~/vim/share/vim/vimfiles,~/vim/
share/vim/vim74,~/vim/share/vim/vimfiles/after,~/.vim/after

The problem is that the script smooth_scroll.vim hasn't been loaded:

  1: ~/.vimrc
  2: ~/Dropbox/Personal/config_sync/vim/vimfiles/bundle/vim-pathogen/autoload/pathogen.vim
  3: ~/vim/share/vim/vim74/syntax/syntax.vim
  4: ~/vim/share/vim/vim74/syntax/synload.vim
  5: ~/vim/share/vim/vim74/syntax/syncolor.vim
  6: ~/vim/share/vim/vim74/filetype.vim
  7: ~/vim/share/vim/vim74/menu.vim
  8: ~/vim/share/vim/vim74/autoload/paste.vim
  9: ~/Dropbox/Personal/config_sync/vim/vimfiles/colors/codeschool.vim
 10: ~/Dropbox/Personal/config_sync/vim/_vimrc_gui
 11: ~/Dropbox/Personal/config_sync/vim/_vimrc_keybinds
 12: ~/vim/share/vim/vim74/plugin/getscriptPlugin.vim
 13: ~/vim/share/vim/vim74/plugin/gzip.vim
 14: ~/vim/share/vim/vim74/plugin/matchparen.vim
 15: ~/vim/share/vim/vim74/plugin/netrwPlugin.vim
 16: ~/vim/share/vim/vim74/plugin/rrhelper.vim
 17: ~/vim/share/vim/vim74/plugin/spellfile.vim
 18: ~/vim/share/vim/vim74/plugin/tarPlugin.vim
 19: ~/vim/share/vim/vim74/plugin/tohtml.vim
 20: ~/vim/share/vim/vim74/plugin/vimballPlugin.vim
 21: ~/vim/share/vim/vim74/plugin/zipPlugin.vim
 22: ~/vim/share/vim/vim74/syntax/ruby.vim
 23: ~/vim/share/vim/vim74/syntax/vim.vim
 24: ~/vim/share/vim/vim74/syntax/python.vim

Why is that? Loading the script manually works fine.

© Super User or respective owner

Related posts about vim

Related posts about gvim