tpope / vim-pathogen

pathogen.vim: manage your runtimepath

Home Page:http://www.vim.org/scripts/script.php?script_id=2332

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pathogen doesn't work on Debian Jessie

reynum2 opened this issue · comments

Hello,
I'm on Debian :

$ uname -a
Linux debian-vm 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1+deb8u5 (2015-10-09) x86_64 GNU/Linux
$ lsb_release -a
Distributor ID: Debian
Description:    Debian GNU/Linux 8.2 (jessie)
Release:    8.2
Codename:   jessie

I work with vim 7.4.576

Here what I did to install pathogen :

mkdir ~/.vim/autoload
cd ~/.vim/autoload
curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
mkdir ~/.vim/bundle
cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git #install nerdtree to test
git clone https://github.com/Yggdroot/indentLine.git #install indentline to test again

And Modify the ~/.vimrc file :

execute pathogen#infect()

" 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.
set nocompatible

" 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

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
syntax on
colorscheme delek

" 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)
set number
set tabstop=4
set shiftwidth=4
set expandtab

let g:indentLine_char = '|'
autocmd vimenter * NERDTree

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

I tried to insert set nocompatible before the execute but didn't work
I tried call instead of execute.
I tried many things but nothing worked.

The command :set rtp? reply :

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

I don't have :help (and nothing else by the way) for the installed plugin.
They are not loaded.
With the same procedure nerdtree work on centos on Linux 2.6.32 and vim 7.2

Any ideas ?

Ok I found !

the line

runtime! debian.vim

In .vimrc refer to the file :
/usr/share/vim/vim74/debian.vim
which contains

" Debian system-wide default configuration Vim

set 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

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible    " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start  " more powerful backspacing

" Now we set some defaults for the editor
set history=50      " keep 50 lines of command line history
set ruler       " show the cursor position all the time

" modelines have historically been a source of security/resource
" vulnerabilities -- disable by default, even when 'nocompatible' is set
set nomodeline

" Suffixes that get lower priority when doing tab completion for filenames.
" These are files we are not likely to want to edit or read.
set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.ilg,.inx,.out,.toc

" We know xterm-debian is a color terminal
if &term =~ "xterm-debian" || &term =~ "xterm-xfree86"
  set t_Co=16
  set t_Sf=�[3%dm
  set t_Sb=�[4%dm
endif

" Some Debian-specific things
if has("autocmd")
  " set mail filetype for reportbug's temp files
  augroup debian
    au BufRead reportbug-*      set ft=mail
  augroup END
endif

" Set paper size from /etc/papersize if available (Debian-specific)
if filereadable("/etc/papersize")
  let s:papersize = matchstr(readfile('/etc/papersize', '', 1), '\p*')
  if strlen(s:papersize)
    exe "set printoptions+=paper:" . s:papersize
  endif
endif

if has('gui_running')
  " Make shift-insert work like in Xterm
  map <S-Insert> <MiddleMouse>
  map! <S-Insert> <MiddleMouse>
endif

So the line

set runtimepath=~/...

redefine the vim runtimepath, and in my .vimrc I put the line

execute pathogen#infect()

On the top of the file before the line

runtime! debian.vim

So the runtimepath define by pathogen is erase.

There is two solutions :
Put the line

execute pathogen#infect()

just below the line

runtime! debian.vim

in the .vimrc file. Or comment the line

set runtimepath=~/...

in the /usr/share/vim/vim74/debian.vim file.

That file is already loaded by the system vimrc. You don't need it in your personal vimrc at all.