You are not logged in.

#1 2008-04-09 15:15:53

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Weird vim behaviour re. path

I have a bin-directory in my home directory for scripts, etc. It is appended to my PATH in a zshrc file (I use zsh). However, when I run vim, this folder is NOT in the path. I assume that is because vim bypasses the zshrc files and only searches the directives in /etc/profile? Is there a way to instruct vim to use my additional path?

Offline

#2 2008-04-09 16:00:02

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Weird vim behaviour re. path

Try adding your bin directory to path in /etc/profile instead of zshrc?

Offline

#3 2008-04-09 17:54:14

dolby
Member
From: 1992
Registered: 2006-08-08
Posts: 1,581

Re: Weird vim behaviour re. path

if you are using a ~ to represent your home directory it wont work. bash can do it but not zsh, i use /home/$USER/bin


There shouldn't be any reason to learn more editor types than emacs or vi -- mg (1)
[You learn that sarcasm does not often work well in international forums.  That is why we avoid it. -- ewaller (arch linux forum moderator)

Offline

#4 2008-04-09 18:02:15

eyolf
Member
From: Copenhagen
Registered: 2005-11-29
Posts: 339
Website

Re: Weird vim behaviour re. path

@fwojciec: hm. Why didn't I think of that? And it won't be overwritten on the next upgrade of filesystem?
@dolby: I have the full path in zshrc. It works in all other circumstances than when I try to call a script from within vim (with :!localscript, e.g.). This is vim running in a terminal, btw, not only gvim. I still don't understand why vim will overrule the path that is loaded in the shell in which it is executed.

Offline

#5 2008-04-09 18:08:58

fwojciec
Member
Registered: 2007-05-20
Posts: 1,411

Re: Weird vim behaviour re. path

eyolf wrote:

@fwojciec: hm. Why didn't I think of that? And it won't be overwritten on the next upgrade of filesystem?

If you make modifications to /etc/profile the future updates of filesystem package will install /etc/profile as /etc/profile.pacnew.
A more elegant way to do this, now that I think of it, would be to create a script called, say, custompath.sh in /etc/profile.d that looks something like this:

export PATH=$PATH:/home/[user]/bin

As long as it is executable /etc/profile will automatically source it on every login -- that way you shouldn't have to worry about filesystem package updates.

Last edited by fwojciec (2008-04-09 18:10:22)

Offline

Board footer

Powered by FluxBB