Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

my gvim settings are all messed up after upgrading to 11.04. When I try to launch gvim I get errors like:

Error detected while processing /home/laptop/.vimrc:
line    1:
E185: Cannot find color scheme railscasts
line   30:
E518: Unknown option: 0{,0},

all my color scheme's and plugins reside under

/usr/share/vim/vim72

I think before 11.04 my .vimrc was not in /home/laptop/.vimrc

what can I do to fix the issue with .vimrc so that it loads and picks up everything from my .vimrc. This .vimrc is same as before but I think just the location got changed or something. I feel crippled without gvim and can't get any work done.

share|improve this question
    
What version of Vim is on 11.04? –  Keith May 11 '11 at 2:26
    
it is vim 7.3. do you think I should put everything from vim72 folder to vim73? –  Omnipresent May 11 '11 at 2:30
    
Yes, exactly. Vim looks in the version specific directories. –  Keith May 11 '11 at 2:58
    
Upgrading software can break up your user specific settings due to small backward incompatibilities. That's why I always do a merge having 3 versions of configs as reference: default config for version1, my custom config from version1, default config from version2. First, I merge 1 into 3, then the differences between 2 and 1 into 3. At the end I get my custom config for version2. Luckily, modern DVCSes make it easy - I have tagged branches for these variations and I merge from one branch into another. –  vtest May 11 '11 at 4:07

1 Answer 1

up vote 2 down vote accepted

First off, your .vimrc file should be in the $HOME directory of whatever user you log in as. Apparently you are now logging in as user 'laptop'. Only you know what user name you used before. Decide which user name you're going to use and put your .vimrc in /home/<user>/.vimrc, where you should replace <user> by your chosen user name.

Next, the reason you lost your customizations is that you apparently put them in /usr/share/vim/vim72. Never do that. Always put your customizations either in /usr/share/vim/vimfiles if they are to be shared among all users on your system or in $HOME/.vim if they are to be used by only you.

One reason for not putting your customizations in /usr/share/vim/vim72 is that any files you change may be overwritten when you update to a new release in the Vim 7.2 series. Another reason is the one you are probably experiencing now. The current version of Vim is 7.3, so your Ubuntu 11.04 upgrade probably installed Vim's runtime files into /usr/share/vim/vim73 and your new version of Vim is looking there, not in /usr/share/vim/vim72.

If you know the names of the files you installed into /usr/share/vim/vim72, simply move them into /usr/share/vim/vimfiles or $HOME/.vim. That should fix your colorscheme problem.

I don't know what might be causing the "unknown option" error. What does line 30 of your .vimrc contain?

share|improve this answer
    
great. thats a good lesson learned. I put everything form vim72 to vimfiles and it seems to be working fine now except that syntax on option is not working. it is giving me error on my vimrc file where that option is mentioned. error is: E484: Can't open file /usr/share/vim/syntax/syntax.vim under the syntax folder syntax.vim file does not exist but snippet.vim does. However, this was working fine with vim72. –  Omnipresent May 11 '11 at 2:53
    
If you did put everything from vim72 to vimfiles, that may have been too much. Let's start with syntax.vim. There should not be a /usr/share/vim/syntax directory. There should be /usr/share/vim/vim72/syntax from your old installation, /usr/share/vim/vim73/syntax from your new installation, and maybe /usr/share/vim/vimfiles/syntax. The last one should be empty unless you've added or modified any syntax files. You should not have a /usr/share/vim/vimfiles/syntax/syntax.vim file as there is never any reason to customize it and your gvim should be using the one for its version. –  garyjohn May 11 '11 at 3:34
    
still not working :( i've made a separate question where I've listed everything out. please take a look –  Omnipresent May 12 '11 at 19:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.