"John Beckett" <[EMAIL PROTECTED]> writes:

> anhnmncb wrote:
>> Sometimes I add a path to $PATH after login (i.e. after 
>> source the .cshrc), and I'm sure I can run that path's 
>> command in console, but when I run vim and use :!cmd, then 
>> vim will prompt the command not found.
>> I have to add that path to $PATH in .cshrc.
>
> In Vim, does the following show the correct PATH?
>
>   :echo $PATH
>   :put =$PATH
>
> The second command will insert it into the current buffer for inspection.

In my .cshrc:

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin
/usr/local/bin $HOME/bin)

---- Then I start a screen session in urxvt and set the path:

$ screen

$ echo $PATH
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/anhnmncb/bin

$ setenv PATH /home/anhnmncb/apps/context/tex/texmf-freebsd/bin:$PATH

$ echo $PATH
/home/anhnmncb/apps/context/tex/texmf-freebsd/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/anhnmncb/bin

$ context foo.tex   <= runs ok.

$ vim

----- now I do it in vim:
:echo $PATH
/home/anhnmncb/apps/context/tex/texmf-freebsd/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/anhnmncb/bin

:!context %
context: Command not found.

:version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Nov  9 2008 09:58:06)
Included patches: 1-6, 8-26, 28-29
Compiled by [EMAIL PROTECTED]
Big version with GTK2 GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent 
+clientserver +clipboard 
+cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope 
+cursorshape +dialog_con_gui +diff 
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi 
+file_in_path +find_in_path +float 
+folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist 
+keymap +langmap +libcall 
+linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname 
+mouse +mouseshape +mouse_dec 
-mouse_gpm -mouse_jsbterm +mouse_netterm +mouse_sysmouse +mouse_xterm 
+multi_byte +multi_lang -mzscheme 
+netbeans_intg -osfiletype +path_extra +perl +postscript +printer -profile 
+python +quickfix +reltime +rightleft
 -ruby +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax 
+tag_binary +tag_old_static 
-tag_any_white -tcl +terminfo +termresponse +textobjects +title +toolbar 
+user_commands +vertsplit +virtualedit 
+visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows 
+writebackup +X11 -xfontset +xim 
+xsmp_interact +xterm_clipboard -xterm_save 
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: cc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -D_THREAD_SAFE 
-I/usr/local/include/gtk-2.0 -I/usr
/local/lib/gtk-2.0/include -I/usr/local/include/atk-1.0 
-I/usr/local/include/cairo -I/usr/local/include/pango-1.0
 -I/usr/local/include -I/usr/local/include/glib-2.0 
-I/usr/local/lib/glib-2.0/include -I/usr/local/include/freety
pe2 -I/usr/local/include/pixman-1 -I/usr/local/include  -O2 
-fno-strict-aliasing -pipe -march=pentium-m -march=pe
ntium-m    -DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H   -I/usr/local
/include  -I/usr/local/lib/perl5/5.8.8/mach/CORE -I/usr/local/include/python2.5 
-D_THREAD_SAFE   
Linking: cc -L/usr/local/lib -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE   
-L/usr/local/lib -o vim   -pthread -L/u
sr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 
-lpangocairo-1.0 -lXext -lXrender -lXinerama 
-lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lcairo -lpangoft2-1.0 
-lpango-1.0 -lfreetype -lz -lfontconfig -lX
fixes -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXt -pthread -ltermlib 
-Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE  
-Wl,-E -L/usr/local/lib 
/usr/local/lib/perl5/5.8.8/mach/auto/DynaLoader/DynaLoader.a 
-L/usr/local/lib/perl5/5.8.8
/mach/CORE -lperl -lutil -L/usr/local/lib/python2.5/config -lpython2.5
-lutil -lm -Wl,--export-dynamic

--------- End

My FreeBSD version:
uname -a
FreeBSD fbsd.hasee.cpu 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Sun Oct 12 
02:07:02 CST 2008     [EMAIL PROTECTED]:/usr/obj/usr/src/sys/HASEE  i386

>
> Of course Vim just asks the operating system to handle '!cmd' so the only 
> issue is
> whether the PATH is inherited by the process started by Vim (I would say 
> "yes").
> First point is to decide if Vim's process has that info.
>
> John
>
>
> >
>
>

-- 
Regards,

  anhnmncb
 gpg key: 44A31344

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to