0

I'm pretty new to Vim/gVim and am probably doing something wrong. What I want to do is completely reload my configuration (like a restart), but while gVim is running (keep the current session). Here are the steps I take and their result:

  1. Start gVim → No error

  2. :so $MYVIMRC → No error

  3. :so $MYGVIMRC
    Error detected while processing ~\.gvimrc:
    line    1:
    E185: Cannot find color scheme 'kolor'
    

When I do step 3 before step 2 I don't get any error, but what if I want to source the files multiple times in the same session? Do I have to unload them first somehow, or do I have to save the session, restart gVim and reload the session again each time?


~/.gvimrc:

set runtimepath=$HOME/.vim,$VIMRUNTIME,$HOME/.vim/after
execute pathogen#infect()

~/.gvimrc:

colorscheme kolor

~/.vim/autoload/pathogen.vim

~/.vim/bundle/vim-kolor/colors/kolor.vim


Vim 7.4, patches 1-2054
Windows & Xubuntu

2

There is an easy solution for this problem. Try and move the kolor.vim file to the ~/.vim/colors . Also, you don't really need to do changes to the runtime path. Vundles does it automatically for you. Seems because you manually modified your runtime path set runtimepath=$HOME/.vim,$VIMRUNTIME,$HOME/.vim/after , it is confusing Vim. set rtp+=~/.vim/bundle/Vundle.vim

Let me know if it fixes your problem. One good rule for thumb is to not put anything in your .vimrc file that you don't fully understand.

  • Having the add-on(s) in the default location works fine, just not with pathogen (and maybe other managers). However if I do set runtimepath+=... instead of set runtimepath=... it works too. Though when I copy the default runtimepath and set that (with =) plus mine (with +=) in .vimrc it doesn't work. So I guess vim doesn't like the runtimepath to completely be reset. I wanted to exclude the vimfiles directories that are set for windows and exactly define where vim should look for files and not get problems with other directorys that might contain junk files. – 816-8055 Aug 1 '16 at 8:36

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.