Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to move my .vimrc file into my .vim folder. I read that a symbolic link would allow vim to be able to find my .vimrc file. So i go,

ln -s ~/.vim/.vimrc ~/.vimrc

But all this seems to do is create a empty .vimrc file in my home folder!!

What is going on?

share|improve this question
add comment

2 Answers 2

You reversed the symlink for creating a .vimrc in ~/.vim. It should be:

ln -s ~/.vimrc ~/.vim/.vimrc

Edit: Try using the absolute location. This is for creating a symlink of /home/username/.vim/.vimrc into /home/username/

ln -s /home/username/.vim/.vimrc /home/username/.vimrc
share|improve this answer
    
Yes but when i do that it gives me an error saying file exists. I moved my vimrc file into .vim already. Now i just want vim to find it when it loads. Is that what symbolic links are for? –  Fawkes5 Dec 31 '12 at 4:05
    
If your vim can't find your .vimrc that is a different issue. You can use a symbolic link to link wherever your current .vimrc is to the proper location. –  sheldonk Dec 31 '12 at 4:06
    
vim assumes that your .vimrc file is in the home directory so you could just leave it where it currently is. –  sheldonk Dec 31 '12 at 4:10
    
I do have a .vimrc file in my ~/.vim directory. I thought that was the whole point of symbolic links. What i want is for VIM, when it starts up, to look for .vimrc in my home directory, follow the symbolic link, and then read the .vimrc file in my ~/.vim directory. I do not want to keep a copy of it in my home directory. What do i have to do? –  Fawkes5 Dec 31 '12 at 4:11
1  
Ah, your initial post said you wanted to move the .vimrc file into the .vim folder. Your initial symlink creates a link from your .vim folder to the home directory. Try using the absolute location. So, ln -s /home/username/.vim/.vimrc /home/username/.vimrc –  sheldonk Dec 31 '12 at 4:19
show 3 more comments

Symbolic links create a link from one location to another. The Wikipedia page on the subject explains it pretty well. From what you're doing, you're trying to create a link from ~/.vim/.vimrc to ~/.vimrc. What has me curious is that your source file is a really weird directory for that file to be in. I expect that it doesn't really exist, and that is why you're coming up with an empty file at the target link.

share|improve this answer
    
Whats so weird about the directory ~/.vim? –  Fawkes5 Dec 31 '12 at 4:07
add comment

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.