Shougo / neobundle.vim

Next generation Vim package manager
MIT License
2.29k stars 168 forks source link

Can't find colorscheme when sourcing vimrc file #507

Closed petobens closed 8 years ago

petobens commented 8 years ago

Consider the following minimal vimrc

set nocompatible

let $CLOUD_DIR = expand('$HOME/OneDrive/')
let $DOTVIM = expand('$CLOUD_DIR/vimfiles')
set runtimepath=$DOTVIM,$VIMRUNTIME,$DOTVIM\after

if has('vim_starting')
    execute 'set runtimepath+=' . expand('$DOTVIM/bundle/neobundle')
endif
call neobundle#begin(expand('$DOTVIM/bundle/'))

" Normalize bundle names
let g:neobundle#enable_name_conversion = 1

NeoBundle 'petobens/heraldish', {'frozen' : 1}
NeoBundleFetch 'Shougo/neobundle.vim', {'name' : 'neobundle'}
call neobundle#end()

" Set file type stuff to on
filetype plugin indent on

colorscheme heraldish

Now open GUI Macvim (or terminal Macvim), edit (i.e open) this minimal vimrc file and then run so %. I get the following error

screen shot 2016-05-18 at 14 15 06

When the vimrc file is source the colorscheme is not found. I expect the colorscheme to be found.

petobens commented 8 years ago

I also tried with terminal vim (not macvim) and I get the same error.

Shougo commented 8 years ago

I think "heraldish" plugin is not installed. You must execute :NeoBundleInstall

petobens commented 8 years ago

I think the colorscheme is installed. I tried with the following minimal vimrc:

set nocompatible

let $CLOUD_DIR = expand('$HOME/OneDrive/')
let $DOTVIM = expand('$CLOUD_DIR/vimfiles')
set runtimepath=$DOTVIM,$VIMRUNTIME,$DOTVIM/after

if has('vim_starting')
    execute 'set runtimepath+=' . expand('$DOTVIM/bundle/neobundle')
endif
call neobundle#begin(expand('$DOTVIM/bundle/'))
let g:neobundle#enable_name_conversion = 1
NeoBundle 'petobens/heraldish', {'frozen' : 1}
NeoBundleFetch 'Shougo/neobundle.vim', {'name' : 'neobundle'}
call neobundle#end()

filetype plugin indent on
syntax enable

set termguicolors
if neobundle#is_installed('heraldish')
    colorscheme heraldish
endif

And when I run so % I still get: screen shot 2016-05-21 at 13 07 40

Shougo commented 8 years ago

OK. I get the problem. It is your vimrc error.

set runtimepath=$DOTVIM,$VIMRUNTIME,$DOTVIM/after
if has('vim_starting')
    execute 'set runtimepath+=' . expand('$DOTVIM/bundle/neobundle')
endif

You must not reset 'runtimepath'. The correct is this.

if has('vim_starting')
    set runtimepath=$DOTVIM,$VIMRUNTIME,$DOTVIM/after
    execute 'set runtimepath+=' . expand('$DOTVIM/bundle/neobundle')
endif
petobens commented 8 years ago

Awesome! Thank you so much!!!