Pathogen doesn't seem to work

868 views
Skip to first unread message

Hashjie

unread,
Feb 4, 2016, 6:54:41 PM2/4/16
to vim_use
Hey everyone, I just installed linux mint and tried installing pathogen on vim.

when I do tree .vim it displays the following:

.vim
├── autoload
│   └── pathogen.vim
└── bundle
├── gruvbox
│   ├── autoload
│   │   ├── airline
│   │   │   └── themes
│   │   │   └── gruvbox.vim
│   │   ├── gruvbox.vim
│   │   └── lightline
│   │   └── colorscheme
│   │   └── gruvbox.vim
│   ├── CHANGELOG.md
│   ├── colors
│   │   └── gruvbox.vim
│   ├── gruvbox_256palette_osx.sh
│   ├── gruvbox_256palette.sh
│   └── README.md
└── nerdtree
├── autoload
│   ├── nerdtree
│   │   └── ui_glue.vim
│   └── nerdtree.vim
├── CHANGELOG
├── doc
│   └── NERD_tree.txt
├── lib
│   └── nerdtree
│   ├── bookmark.vim
│   ├── creator.vim
│   ├── event.vim
│   ├── flag_set.vim
│   ├── key_map.vim
│   ├── menu_controller.vim
│   ├── menu_item.vim
│   ├── nerdtree.vim
│   ├── notifier.vim
│   ├── opener.vim
│   ├── path.vim
│   ├── tree_dir_node.vim
│   ├── tree_file_node.vim
│   └── ui.vim
├── LICENCE
├── nerdtree_plugin
│   ├── exec_menuitem.vim
│   └── fs_menu.vim
├── plugin
│   └── NERD_tree.vim
├── README.markdown
└── syntax
└── nerdtree.vim

18 directories, 33 files

I have the following lines in my .vimrc:
" Enable pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on

Whenever I run vim with vim -u NONE and then use :so ~/.vimrc I'm getting the following errors:
Error detected while processing /home/hylke/.vimrc:
line 2:
E117: Unknown function: pathogen#infect
E15: Invalid expression: pathogen#infect()

This is what's being displayed in my runtimepath:
runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/
vim74,/usr/share/vim/vimfiles/after,/var/lib/vim/addons/after,~/.vim/after

By the looks of it pathogen doesn't get executed at all and my runtimepath isn't being updated with the bundles that it should be. I've tried running NERDTreeFind but that shows me an error telling me the command doesn't exist.
Can anyone think of a reason why this doesn't seem to work?

Erik Falor

unread,
Feb 4, 2016, 10:00:34 PM2/4/16
to vim...@googlegroups.com
On Thu, Feb 04, 2016 at 03:54:40PM -0800, Hashjie wrote:

> Whenever I run vim with vim -u NONE

That's your problem right there. -u skips many of Vim's regular
initializations, including loading [autoloaded] plugins. That is why
Vim does not recognize the function pathogen#infect().

You can see which scripts Vim has loaded with :scriptnames

These help file entries will explain things further:

:help -u
:help --noplugins

--
Erik Falor
Registered Linux User #445632 http://unnovative.net
signature.asc

Nikolay Aleksandrovich Pavlov

unread,
Feb 5, 2016, 2:14:35 AM2/5/16
to vim...@googlegroups.com
2016-02-05 6:00 GMT+03:00 Erik Falor <ewf...@gmail.com>:
> On Thu, Feb 04, 2016 at 03:54:40PM -0800, Hashjie wrote:
>
>> Whenever I run vim with vim -u NONE
>
> That's your problem right there. -u skips many of Vim's regular
> initializations, including loading [autoloaded] plugins. That is why
> Vim does not recognize the function pathogen#infect().

This is not correct. `-u NONE` tells Vim to read no initialization
files, as well as plugins. This will not disable autoloading, so one
*still* may do `:execute pathogen#infect()` after starting Vim or in
e.g. --cmd (it *will* work on that early stage because &runtimepath
would already be initialized to contain ~/.vim and this is *all* one
needs to make autoloading work). But -u NONE will require to do this
explicitly (done by OP by using :so) and will also set &loadplugins to
zero which makes calling pathogen rather pointless.

OP should have different problem, -u NONE is not disabling autoloading
functionality.

I would ask him to check pathogen.vim contents and whether it can be
sourced with explicit `:source ~/.vim/autoload/pathogen.vim`.

>
> You can see which scripts Vim has loaded with :scriptnames
>
> These help file entries will explain things further:
>
> :help -u
> :help --noplugins
>
> --
> Erik Falor
> Registered Linux User #445632 http://unnovative.net
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Hashjie

unread,
Feb 5, 2016, 6:24:05 AM2/5/16
to vim_use
Op vrijdag 5 februari 2016 08:14:35 UTC+1 schreef ZyX:

I'm not exactly sure what I have to check in the contents of my pathogen.vim I've used curl -L to download it from github into my autoload directory so I suspect it to be valid. I'll try to find out if anything is wrong with the file.

I've done a vim -u NONE and after that :source ~/.vim/autoload/pathogen.vim
after that I've typed :scriptnames and the second entry showed me that pathogen.vim was loaded. I ran :execute pathogen#infect() and it didn't show me any errors. However, I still couldn't use NERDTreeFind it said not an editor command. Seems like the errors have dissapeared after sourcing pathogen.vim but it still doesn't seem to recognize any plugins.

Nikolay Aleksandrovich Pavlov

unread,
Feb 5, 2016, 6:29:29 AM2/5/16
to vim...@googlegroups.com
You should not need to source pathogen.vim. But with -u NONE absense
of NERDTreeFind is exactly what you requested: plugins are not loaded.

I also do not know pathogen, but if you run `execute
pathogen#infect()` *after* Vim was started then plugins *are not
loaded by Vim*. VAM in this case sources plugins itself, some other
plugin managers do the same thing AFAIK. But at least VAM in your case
do not load plugins if &loadplugins is false, and it is false with -u
NONE.

Christian Brabandt

unread,
Feb 5, 2016, 6:31:24 AM2/5/16
to vim_use
Hi Hashjie!

On Fr, 05 Feb 2016, Hashjie wrote:

> I'm not exactly sure what I have to check in the contents of my
> pathogen.vim I've used curl -L to download it from github into my
> autoload directory so I suspect it to be valid. I'll try to find out
> if anything is wrong with the file.
>
> I've done a vim -u NONE and after that :source
> ~/.vim/autoload/pathogen.vim after that I've typed :scriptnames and
> the second entry showed me that pathogen.vim was loaded. I ran
> :execute pathogen#infect() and it didn't show me any errors. However,
> I still couldn't use NERDTreeFind it said not an editor command. Seems
> like the errors have dissapeared after sourcing pathogen.vim but it
> still doesn't seem to recognize any plugins.

You probably have to source the file that lives in
nerdtree/plugin/<nerdtree>.vim (or whatever it is called).

If you do NOT use -u NONE check, that your 'rtp' settings include the
nerdtree folder and your :scriptnames command shows that pathogen is
run. That should work and make sure, that all plugin folders from within
the runtimepath setting are sourced on startup.

Best,
Christian


--
Der Aberglaube macht die Gottheit zum Götzen, und der
Götzendiener ist um so gefährlicher, weil er ein Schwärmer ist.
-- Johann Gottfried Herder (Palmbätter)

Hashjie

unread,
Feb 5, 2016, 6:47:53 AM2/5/16
to vim_use
Op vrijdag 5 februari 2016 12:29:29 UTC+1 schreef ZyX:

Okay, so I've started vim regularly and typed :scriptnames and this is what it showed:

1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: /usr/share/vim/vim74/syntax/syntax.vim
4: /usr/share/vim/vim74/syntax/synload.vim
5: /usr/share/vim/vim74/syntax/syncolor.vim
6: /usr/share/vim/vim74/filetype.vim
7: ~/.vimrc
8: ~/.vim/autoload/pathogen.vim
9: /usr/share/vim/vim74/ftoff.vim
10: /usr/share/vim/vim74/syntax/nosyntax.vim
11: /usr/share/vim/vim74/ftplugin.vim
12: /usr/share/vim/vim74/indent.vim
13: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
14: /usr/share/vim/vim74/plugin/gzip.vim
15: /usr/share/vim/vim74/plugin/matchparen.vim
16: /usr/share/vim/vim74/plugin/netrwPlugin.vim
17: /usr/share/vim/vim74/plugin/rrhelper.vim
18: /usr/share/vim/vim74/plugin/spellfile.vim
19: /usr/share/vim/vim74/plugin/tarPlugin.vim
20: /usr/share/vim/vim74/plugin/tohtml.vim
21: /usr/share/vim/vim74/plugin/vimballPlugin.vim
22: /usr/share/vim/vim74/plugin/zipPlugin.vim

:echo &loadplugins displayed 1
I still am unable to use :NERDTreeFind

My pathogen.vim contains the following lines:

" pathogen.vim - path option manipulation
" Maintainer: Tim Pope <http://tpo.pe/>
" Version: 2.4

" Install in ~/.vim/autoload (or ~\vimfiles\autoload).
"
" For management of individually installed plugins in ~/.vim/bundle (or
" ~\vimfiles\bundle), adding `execute pathogen#infect()` to the top of your
" .vimrc is the only other setup necessary.
"
" The API is documented inline below.

if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1

" Point of entry for basic default usage. Give a relative path to invoke
" pathogen#interpose() (defaults to "bundle/{}"), or an absolute path to invoke
" pathogen#surround(). Curly braces are expanded with pathogen#expand():
" "bundle/{}" finds all subdirectories inside "bundle" inside all directories
" in the runtime path.
function! pathogen#infect(...) abort
for path in a:0 ? filter(reverse(copy(a:000)), 'type(v:val) == type("")') : ['bundle/{}']
if path =~# '^\%({\=[$~\\/]\|{\=\w:[\\/]\).*[{}*]'
call pathogen#surround(path)
elseif path =~# '^\%([$~\\/]\|\w:[\\/]\)'
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#surround(path . '/{}')
elseif path =~# '[{}*]'
call pathogen#interpose(path)
else
call s:warn('Change pathogen#infect('.string(path).') to pathogen#infect('.string(path.'/{}').')')
call pathogen#interpose(path . '/{}')
endif
endfor
call pathogen#cycle_filetype()
if pathogen#is_disabled($MYVIMRC)
return 'finish'
endif
return ''
endfunction

" Split a path into a list.
function! pathogen#split(path) abort
if type(a:path) == type([]) | return a:path | endif
if empty(a:path) | return [] | endif
let split = split(a:path,'\\\@<!\%(\\\\\)*\zs,')
return map(split,'substitute(v:val,''\\\([\\,]\)'',''\1'',"g")')
endfunction

" Convert a list to a path.
function! pathogen#join(...) abort
if type(a:1) == type(1) && a:1
let i = 1
let space = ' '
else
let i = 0
let space = ''
endif
let path = ""
while i < a:0
if type(a:000[i]) == type([])
let list = a:000[i]
let j = 0
while j < len(list)
let escaped = substitute(list[j],'[,'.space.']\|\\[\,'.space.']\@=','\\&','g')
let path .= ',' . escaped
let j += 1
endwhile
else
let path .= "," . a:000[i]
endif
let i += 1
endwhile
return substitute(path,'^,','','')
endfunction

" Convert a list to a path with escaped spaces for 'path', 'tag', etc.
function! pathogen#legacyjoin(...) abort
return call('pathogen#join',[1] + a:000)
endfunction

" Turn filetype detection off and back on again if it was already enabled.
function! pathogen#cycle_filetype() abort
if exists('g:did_load_filetypes')
filetype off
filetype on
endif
endfunction

" Check if a bundle is disabled. A bundle is considered disabled if its
" basename or full name is included in the list g:pathogen_blacklist or the
" comma delimited environment variable $VIMBLACKLIST.
function! pathogen#is_disabled(path) abort
if a:path =~# '\~$'
return 1
endif
let sep = pathogen#slash()
let blacklist =
\ get(g:, 'pathogen_blacklist', get(g:, 'pathogen_disabled', [])) +
\ pathogen#split($VIMBLACKLIST)
if !empty(blacklist)
call map(blacklist, 'substitute(v:val, "[\\/]$", "", "")')
endif
return index(blacklist, fnamemodify(a:path, ':t')) != -1 || index(blacklist, a:path) != -1
endfunction

" Prepend the given directory to the runtime path and append its corresponding
" after directory. Curly braces are expanded with pathogen#expand().
function! pathogen#surround(path) abort
let sep = pathogen#slash()
let rtp = pathogen#split(&rtp)
let path = fnamemodify(a:path, ':s?[\\/]\=$??')
let before = filter(pathogen#expand(path), '!pathogen#is_disabled(v:val)')
let after = filter(reverse(pathogen#expand(path, sep.'after')), '!pathogen#is_disabled(v:val[0:-7])')
call filter(rtp, 'index(before + after, v:val) == -1')
let &rtp = pathogen#join(before, rtp, after)
return &rtp
endfunction

" For each directory in the runtime path, add a second entry with the given
" argument appended. Curly braces are expanded with pathogen#expand().
function! pathogen#interpose(name) abort
let sep = pathogen#slash()
let name = a:name
if has_key(s:done_bundles, name)
return ""
endif
let s:done_bundles[name] = 1
let list = []
for dir in pathogen#split(&rtp)
if dir =~# '\<after$'
let list += reverse(filter(pathogen#expand(dir[0:-6].name, sep.'after'), '!pathogen#is_disabled(v:val[0:-7])')) + [dir]
else
let list += [dir] + filter(pathogen#expand(dir.sep.name), '!pathogen#is_disabled(v:val)')
endif
endfor
let &rtp = pathogen#join(pathogen#uniq(list))
return 1
endfunction

let s:done_bundles = {}

" Invoke :helptags on all non-$VIM doc directories in runtimepath.
function! pathogen#helptags() abort
let sep = pathogen#slash()
for glob in pathogen#split(&rtp)
for dir in map(split(glob(glob), "\n"), 'v:val.sep."/doc/".sep')
if (dir)[0 : strlen($VIMRUNTIME)] !=# $VIMRUNTIME.sep && filewritable(dir) == 2 && !empty(split(glob(dir.'*.txt'))) && (!filereadable(dir.'tags') || filewritable(dir.'tags'))
silent! execute 'helptags' pathogen#fnameescape(dir)
endif
endfor
endfor
endfunction

command! -bar Helptags :call pathogen#helptags()

" Execute the given command. This is basically a backdoor for --remote-expr.
function! pathogen#execute(...) abort
for command in a:000
execute command
endfor
return ''
endfunction

" Section: Unofficial

function! pathogen#is_absolute(path) abort
return a:path =~# (has('win32') ? '^\%([\\/]\|\w:\)[\\/]\|^[~$]' : '^[/~$]')
endfunction

" Given a string, returns all possible permutations of comma delimited braced
" alternatives of that string. pathogen#expand('/{a,b}/{c,d}') yields
" ['/a/c', '/a/d', '/b/c', '/b/d']. Empty braces are treated as a wildcard
" and globbed. Actual globs are preserved.
function! pathogen#expand(pattern, ...) abort
let after = a:0 ? a:1 : ''
if a:pattern =~# '{[^{}]\+}'
let [pre, pat, post] = split(substitute(a:pattern, '\(.\{-\}\){\([^{}]\+\)}\(.*\)', "\\1\001\\2\001\\3", ''), "\001", 1)
let found = map(split(pat, ',', 1), 'pre.v:val.post')
let results = []
for pattern in found
call extend(results, pathogen#expand(pattern))
endfor
elseif a:pattern =~# '{}'
let pat = matchstr(a:pattern, '^.*{}[^*]*\%($\|[\\/]\)')
let post = a:pattern[strlen(pat) : -1]
let results = map(split(glob(substitute(pat, '{}', '*', 'g')), "\n"), 'v:val.post')
else
let results = [a:pattern]
endif
let vf = pathogen#slash() . 'vimfiles'
call map(results, 'v:val =~# "\\*" ? v:val.after : isdirectory(v:val.vf.after) ? v:val.vf.after : isdirectory(v:val.after) ? v:val.after : ""')
return filter(results, '!empty(v:val)')
endfunction

" \ on Windows unless shellslash is set, / everywhere else.
function! pathogen#slash() abort
return !exists("+shellslash") || &shellslash ? '/' : '\'
endfunction

function! pathogen#separator() abort
return pathogen#slash()
endfunction

" Convenience wrapper around glob() which returns a list.
function! pathogen#glob(pattern) abort
let files = split(glob(a:pattern),"\n")
return map(files,'substitute(v:val,"[".pathogen#slash()."/]$","","")')
endfunction

" Like pathogen#glob(), only limit the results to directories.
function! pathogen#glob_directories(pattern) abort
return filter(pathogen#glob(a:pattern),'isdirectory(v:val)')
endfunction

" Remove duplicates from a list.
function! pathogen#uniq(list) abort
let i = 0
let seen = {}
while i < len(a:list)
if (a:list[i] ==# '' && exists('empty')) || has_key(seen,a:list[i])
call remove(a:list,i)
elseif a:list[i] ==# ''
let i += 1
let empty = 1
else
let seen[a:list[i]] = 1
let i += 1
endif
endwhile
return a:list
endfunction

" Backport of fnameescape().
function! pathogen#fnameescape(string) abort
if exists('*fnameescape')
return fnameescape(a:string)
elseif a:string ==# '-'
return '\-'
else
return substitute(escape(a:string," \t\n*?[{`$\\%#'\"|!<"),'^[+>]','\\&','')
endif
endfunction

" Like findfile(), but hardcoded to use the runtimepath.
function! pathogen#runtime_findfile(file,count) abort
let rtp = pathogen#join(1,pathogen#split(&rtp))
let file = findfile(a:file,rtp,a:count)
if file ==# ''
return ''
else
return fnamemodify(file,':p')
endif
endfunction

" Section: Deprecated

function! s:warn(msg) abort
echohl WarningMsg
echomsg a:msg
echohl NONE
endfunction

" Prepend all subdirectories of path to the rtp, and append all 'after'
" directories in those subdirectories. Deprecated.
function! pathogen#runtime_prepend_subdirectories(path) abort
call s:warn('Change pathogen#runtime_prepend_subdirectories('.string(a:path).') to pathogen#infect('.string(a:path.'/{}').')')
return pathogen#surround(a:path . pathogen#slash() . '{}')
endfunction

function! pathogen#incubate(...) abort
let name = a:0 ? a:1 : 'bundle/{}'
call s:warn('Change pathogen#incubate('.(a:0 ? string(a:1) : '').') to pathogen#infect('.string(name).')')
return pathogen#interpose(name)
endfunction

" Deprecated alias for pathogen#interpose().
function! pathogen#runtime_append_all_bundles(...) abort
if a:0
call s:warn('Change pathogen#runtime_append_all_bundles('.string(a:1).') to pathogen#infect('.string(a:1.'/{}').')')
else
call s:warn('Change pathogen#runtime_append_all_bundles() to pathogen#infect()')
endif
return pathogen#interpose(a:0 ? a:1 . '/{}' : 'bundle/{}')
endfunction

if exists(':Vedit')
finish
endif

let s:vopen_warning = 0

function! s:find(count,cmd,file,lcd)
let rtp = pathogen#join(1,pathogen#split(&runtimepath))
let file = pathogen#runtime_findfile(a:file,a:count)
if file ==# ''
return "echoerr 'E345: Can''t find file \"".a:file."\" in runtimepath'"
endif
if !s:vopen_warning
let s:vopen_warning = 1
let warning = '|echohl WarningMsg|echo "Install scriptease.vim to continue using :V'.a:cmd.'"|echohl NONE'
else
let warning = ''
endif
if a:lcd
let path = file[0:-strlen(a:file)-2]
execute 'lcd `=path`'
return a:cmd.' '.pathogen#fnameescape(a:file) . warning
else
return a:cmd.' '.pathogen#fnameescape(file) . warning
endif
endfunction

function! s:Findcomplete(A,L,P)
let sep = pathogen#slash()
let cheats = {
\'a': 'autoload',
\'d': 'doc',
\'f': 'ftplugin',
\'i': 'indent',
\'p': 'plugin',
\'s': 'syntax'}
if a:A =~# '^\w[\\/]' && has_key(cheats,a:A[0])
let request = cheats[a:A[0]].a:A[1:-1]
else
let request = a:A
endif
let pattern = substitute(request,'/\|\'.sep,'*'.sep,'g').'*'
let found = {}
for path in pathogen#split(&runtimepath)
let path = expand(path, ':p')
let matches = split(glob(path.sep.pattern),"\n")
call map(matches,'isdirectory(v:val) ? v:val.sep : v:val')
call map(matches,'expand(v:val, ":p")[strlen(path)+1:-1]')
for match in matches
let found[match] = 1
endfor
endfor
return sort(keys(found))
endfunction

command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Ve :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vedit :execute s:find(<count>,'edit<bang>',<q-args>,0)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vopen :execute s:find(<count>,'edit<bang>',<q-args>,1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vsplit :execute s:find(<count>,'split',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vvsplit :execute s:find(<count>,'vsplit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vtabedit :execute s:find(<count>,'tabedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vpedit :execute s:find(<count>,'pedit',<q-args>,<bang>1)
command! -bar -bang -range=1 -nargs=1 -complete=customlist,s:Findcomplete Vread :execute s:find(<count>,'read',<q-args>,<bang>1)

" vim:set et sw=2 foldmethod=expr foldexpr=getline(v\:lnum)=~'^\"\ Section\:'?'>1'\:getline(v\:lnum)=~#'^fu'?'a1'\:getline(v\:lnum)=~#'^endf'?'s1'\:'=':

I'm still quite new to vim entirely, what would be the next step to check?

Hashjie

unread,
Feb 5, 2016, 6:57:35 AM2/5/16
to vim_use
Op vrijdag 5 februari 2016 12:31:24 UTC+1 schreef Christian Brabandt:
Something like: set rtp+=$HOME/.vim/bundle/*
is this the way to make sure it has all plugins in the runtimepath?
Sorry for being such a newb...
If I run vim regularly then :set runtimepath? doesn't display the nerdtree folder.
Should I also do something like source $HOME/.vim/bundle/* in my vimrc?

Christian Brabandt

unread,
Feb 5, 2016, 6:58:30 AM2/5/16
to vim_use
Hi Hashjie!

On Fr, 05 Feb 2016, Hashjie wrote:

So it does not show anything below ~/.vim/bundle
That is most certainly wrong. What is your runtimepath setting?
:set rtp?

Best,
Christian

--
Abschied ist die innigste Weise menschlichen Zusammenseins.
-- Hans Kudszus

Christian Brabandt

unread,
Feb 5, 2016, 7:00:07 AM2/5/16
to vim_use
Hi Hashjie!

On Fr, 05 Feb 2016, Hashjie wrote:

> Op vrijdag 5 februari 2016 12:31:24 UTC+1 schreef Christian Brabandt:
> > On Fr, 05 Feb 2016, Hashjie wrote:
> > > I'm not exactly sure what I have to check in the contents of my
> > > pathogen.vim I've used curl -L to download it from github into my
> > > autoload directory so I suspect it to be valid. I'll try to find out
> > > if anything is wrong with the file.
> > >
> > > I've done a vim -u NONE and after that :source
> > > ~/.vim/autoload/pathogen.vim after that I've typed :scriptnames and
> > > the second entry showed me that pathogen.vim was loaded. I ran
> > > :execute pathogen#infect() and it didn't show me any errors. However,
> > > I still couldn't use NERDTreeFind it said not an editor command. Seems
> > > like the errors have dissapeared after sourcing pathogen.vim but it
> > > still doesn't seem to recognize any plugins.
> >
> > You probably have to source the file that lives in
> > nerdtree/plugin/<nerdtree>.vim (or whatever it is called).
> >
> > If you do NOT use -u NONE check, that your 'rtp' settings include the
> > nerdtree folder and your :scriptnames command shows that pathogen is
> > run. That should work and make sure, that all plugin folders from within
> > the runtimepath setting are sourced on startup.
>
> Something like: set rtp+=$HOME/.vim/bundle/*

You should not have to do this manually.

> is this the way to make sure it has all plugins in the runtimepath?
> Sorry for being such a newb...

Yes, that is what pathogen is supposed to do.

> If I run vim regularly then :set runtimepath? doesn't display the nerdtree folder.
> Should I also do something like source $HOME/.vim/bundle/* in my vimrc?

No, that's why you have pathogen. Can you show your .vimrc file please?

Best,
Christian


--
Vollkommenheit kann mit Disproportion bestehen, Schönheit
allein mit Proportion.
-- Goethe, Maximen und Reflektionen, Nr. 1198

Hashjie

unread,
Feb 5, 2016, 7:08:30 AM2/5/16
to vim_use
Op vrijdag 5 februari 2016 13:00:07 UTC+1 schreef Christian Brabandt:
The first two lines I recently added, and :NERDTreeFind seems to work. However it doesn't respond to any input now. I guess this has something to do with my runtimepath not having nerdtree in it.

My vimrc looks as followed:

set rtp+=$HOME/.vim/bundle/nerdtree
so $HOME/.vim/bundle/nerdtree/plugin/NERD_tree.vim

" execute pathogen
execute pathogen#infect()

" enable syntax
syntax on

" enable filetype plugin
filetype plugin indent on

" enable line numbers
set number

" Use 256 colours
set t_Co=256

" Splitting screens
nnoremap ,h <C-w>s
nnoremap ,v <C-w>v
nnoremap ,, <C-w><C-w>

" Mouse support
set mouse=a

" Some other configs
set tabstop=4
set autoindent
set shiftwidth=4
set shiftround
set showmatch
set ignorecase
set smartcase
set encoding=utf-8
set smarttab
set hlsearch
set incsearch
set history=1000
set undolevels=1000
set visualbell
set noerrorbells
set backspace=indent,eol,start
set background=dark
autocmd InsertEnter * set cul
autocmd InsertLeave * set nocul

" Nerdtree toggling
nmap <C-p> :NERDTreeToggle<CR>
map <F3> :NERDTreeFind<CR>
let g:NERDTreeMapActivateNode="<F3>"
let g:NERDTreeMapPreview="<F4>"
let g:NERDTreeShowHidden=1
" All system-wide defaults are set in $VIMRUNTIME/debian.vim and sourced by
" the call to :runtime you can find below. If you wish to change any of those
" settings, you should do it in this file (/etc/vim/vimrc), since debian.vim
" will be overwritten everytime an upgrade of the vim packages is performed.
" It is recommended to make changes after sourcing debian.vim since it alters
" the value of the 'compatible' option.

" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

" Uncomment the next line to make Vim more Vi-compatible
" NOTE: debian.vim sets 'nocompatible'. Setting 'compatible' changes numerous
" options, so any other options should be set AFTER setting 'compatible'.
"set compatible

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
" au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
" filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd " Show (partial) command in status line.
"set showmatch " Show matching brackets.
"set ignorecase " Do case insensitive matching
"set smartcase " Do smart case matching
"set incsearch " Incremental search
"set autowrite " Automatically save before commands like :next and :make
"set hidden " Hide buffers when they are abandoned
"set mouse=a " Enable mouse usage (all modes)

" Source a global configuration file if available
if filereadable("/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif

:set rtp? shows me the following:

runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vi
m/addons/after,~/.vim/after

Christian Brabandt

unread,
Feb 5, 2016, 7:31:01 AM2/5/16
to vim_use
Hi Hashjie!

On Fr, 05 Feb 2016, Hashjie wrote:

> The first two lines I recently added, and :NERDTreeFind seems to work. However it doesn't respond to any input now. I guess this has something to do with my runtimepath not having nerdtree in it.
>
> My vimrc looks as followed:
>
> set rtp+=$HOME/.vim/bundle/nerdtree
> so $HOME/.vim/bundle/nerdtree/plugin/NERD_tree.vim

You should not need those.

> " execute pathogen
> execute pathogen#infect()
>
> " enable syntax
> syntax on
>
> " enable filetype plugin
> filetype plugin indent on
[...]
>
> :set rtp? shows me the following:
> runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vi
> m/addons/after,~/.vim/after

That looks correct. However your runtimepath setting hasn't been
changed. I don't know, why pathogen would not do it. Does it work with
this line:
call pathogen#infect('bundle/{}')

If this does not work, I suggest opening a ticket at the pathogen
plugin. To me everything looks correct and it should just work™

Best,
Christian
--
Der Tag gehört dem Irrtum und dem Fehler, die Zeitreihe dem
Erfolg und dem Gelingen.
-- Goethe, Maximen und Reflektionen, Nr. 690

Hashjie

unread,
Feb 5, 2016, 7:39:52 AM2/5/16
to vim_use
Op vrijdag 5 februari 2016 13:31:01 UTC+1 schreef Christian Brabandt:
Thanks for all the help, I removed the first two unnecessary lines and changed execute pathogen#infect() into call pathogen#infect('bundle/{}') but this didn't seem to work aswell. I'll do as you suggested and submit a ticket at pathogen. Hopefully someone can help me get it working there, else I would have to use vundle instead. Perhaps vundle does work for me.

Ben Fritz

unread,
Feb 5, 2016, 11:38:24 AM2/5/16
to vim_use
On Friday, February 5, 2016 at 6:08:30 AM UTC-6, Hashjie wrote:
>
> " This line should not be removed as it ensures that various options are
> " properly set to work with the Vim-related packages available in Debian.
> runtime! debian.vim
>
> [snip]

>
> " Source a global configuration file if available
> if filereadable("/etc/vim/vimrc.local")
> source /etc/vim/vimrc.local
> endif
>

I suspect these may be giving you problems. Do these modify the
runtimepath at all? Does your configuration start working if you comment
these lines out? What's in those files?

> :set rtp? shows me the following:
>
> runtimepath=~/.vim,/var/lib/vim/addons,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/var/lib/vi
> m/addons/after,~/.vim/after

Try again with ":verbose set rtp?" to see who set it last.

Erik Falor

unread,
Feb 5, 2016, 11:52:59 AM2/5/16
to vim...@googlegroups.com
On Fri, Feb 05, 2016 at 10:14:31AM +0300, Nikolay Aleksandrovich Pavlov wrote:
> 2016-02-05 6:00 GMT+03:00 Erik Falor <ewf...@gmail.com>:
> > On Thu, Feb 04, 2016 at 03:54:40PM -0800, Hashjie wrote:
> >
> >> Whenever I run vim with vim -u NONE
> >
> > That's your problem right there. -u skips many of Vim's regular
> > initializations, including loading [autoloaded] plugins. That is why
> > Vim does not recognize the function pathogen#infect().
>
> This is not correct. `-u NONE` tells Vim to read no initialization
> files, as well as plugins. This will not disable autoloading, so one
> *still* may do `:execute pathogen#infect()` after starting Vim or in
> e.g. --cmd (it *will* work on that early stage because &runtimepath
> would already be initialized to contain ~/.vim and this is *all* one
> needs to make autoloading work). But -u NONE will require to do this
> explicitly (done by OP by using :so) and will also set &loadplugins to
> zero which makes calling pathogen rather pointless.
>
> OP should have different problem, -u NONE is not disabling autoloading
> functionality.

You're right, Nikolay. -u NONE is not disabling the autoload feature.

What I've found is that -u NONE, among other things, sets
'compatible', which precludes pathogen from defining its functions.
Near the beginning of pathogen.vim is this stanza:

if exists("g:loaded_pathogen") || &cp
finish
endif
let g:loaded_pathogen = 1

This is why pathogen#infect() isn't recognized: its definition was
never seen by Vim.

Hashjie, in order to use pathogen.vim along with -u NONE, you must
take several manual steps after Vim has loaded. I've found that this
sequence works with my setup:

$ vim -u NONE
:set nocompatible loadplugins
:so ~/.vim/autoload/pathogen.vim
:call pathogen#infect()
:runtime! plugin/*.vim

Then you can see with :scriptnames that your plugins under .vim/bundle
are loaded. However, when I do this I get several warnings and errors.

I'm sure that you have your reasons to combine -u NONE with Pathogen,
but it seems like a lot of extra work to me!
signature.asc

Nikolay Aleksandrovich Pavlov

unread,
Feb 5, 2016, 12:05:40 PM2/5/16
to vim...@googlegroups.com
And `set nocompatible` with `-u NONE` is not needed when using `-u
NONE -N`. But this line is not needed at all because it can be
replaced with `-u NORC -N`.

> :so ~/.vim/autoload/pathogen.vim

This should not be needed.

> :call pathogen#infect()
> :runtime! plugin/*.vim

If this is needed then `set loadplugins` should not change anything, I
do not see pathogen checking this setting.

>
> Then you can see with :scriptnames that your plugins under .vim/bundle
> are loaded. However, when I do this I get several warnings and errors.
>
> I'm sure that you have your reasons to combine -u NONE with Pathogen,
> but it seems like a lot of extra work to me!

I would say that -u NONE is usually used for testing or for finding
minimal failing example needed for bug reports. If this is the case I
would recomment using `-N -u <(<<< $'call pathogen#infect()') --cmd
'set runtimepath=~/.vim'`: this should disable all plugins, except
pathogen and bundles.

>
> --
> Erik Falor
> Registered Linux User #445632 http://unnovative.net
>
Reply all
Reply to author
Forward
0 new messages