3 | | " Last modified: 5 April 2003 |
4 | | |
5 | | " Get a good value for $PATH. For example, if teTeX is installed, this |
6 | | " should add the path to tex, pdflatex, etc. |
7 | | " This should only make a difference when vim is started from the Finder or |
8 | | " with open. |
9 | | let $PATH = system("printenv PATH") |
10 | | let $PATH = substitute($PATH, "\<C-J>$", "", "") |
| 3 | " Last modified: 23 February 2004 |
| 5 | " TODO: Is there any way to test whether Vim.app was started from the Finder? |
| 6 | if has("gui_running") |
| 7 | " Get the value of $PATH from a login shell. |
| 8 | " If your shell is not on this list, it may be just because we have not |
| 9 | " tested it. Try adding it to the list and see if it works. If so, |
| 10 | " please post a note to the vim-mac list! |
| 11 | if $SHELL =~ '/\(sh\|csh\|bash\|tcsh\|zsh\)$' |
| 12 | let s:path = system("echo echo VIMPATH'${PATH}' | $SHELL -l") |
| 13 | let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n') |
| 14 | endif |
| 15 | " Change directory on startup. |
| 16 | autocmd VimEnter * if getcwd()=="/" | if strlen(@%) | cd %:p:h | else | cd | endif | endif |