Linux Ubuntu Vim - navigate to symlink/link directory?

2

Hey guys can you help me with some issues on how to navigate through links to the directory or file it points to through the command line?

If i try to 'cd' into them it says they are not directories which of course they aren't its just a file but I can click that file (some of them) in the file browser (not through terminal)

For example there is a .vim folder in my home directory which I cannot 'cd' into it also when you install Ubuntu there is a Examples folder on the desktop and a link to that from you home directory. I cannot navigate it through the command line.

I'm trying to install some vim plugins which should go into the .vim folder but it's not a folder...it's a file which I can open up in a text editor. However most sites say to put scripts in sub folders inside .vim folder... i'm really confused with this, any help? I can't do 'mkdir' either if i do 'mkdir .vim' it says directory already exists....

iQ

Posted 2009-11-13T22:45:37.403

Reputation:

what do you have in that .vim file? vim reads configuration from the file .vimrc, .vim should be a directory. I suggest you rename .vim to something else and create the directory .vim – solarc – 2010-03-19T20:39:42.247

Answers

2

If your symlink is named for example 'zapo':

  :cd `readlink zapo`

does what you want. The backticks tell vim to run that external program; man readlink explains the Unix readlink command.

Alex Martelli

Posted 2009-11-13T22:45:37.403

Reputation: 1 298

.desktop files are not symlinks. They are special files used by Gnome to launch programs (in this case Nautilus pointing to the Examples dir). You can't cd into it. – solarc – 2010-03-19T20:43:02.663

thank you, i tried that it seems to work although it takes me back to my home directory and not the link. In ubuntu there is a Examples folder on the desktop with a link on the home directory. its called 'Examples' when viewing from the file browser but its called 'examples.desktop' when doing 'ls -al' I can click that on the file browser fine but if I do the above command it takes me back to my home directory – None – 2009-11-13T23:09:50.427

So what does readlink examples.desktop say when you run it from a shell prompt? My ubuntu installation has no such symlink, so I can't check! – Alex Martelli – 2009-11-13T23:11:17.723

If i do 'readlink examples.desktop' it doesn't do anything and if I do 'readling -e examples.desktop' it says /home/myuser/examples.desktop – None – 2009-11-13T23:18:10.440