xref: /vim-8.2.3635/src/testdir/setup.vim (revision 89a9c159)
1" Common preparations for running tests.
2
3" Only load this once.
4if 1
5  if exists('s:did_load')
6    finish
7  endif
8  let s:did_load = 1
9endif
10
11" Make sure 'runtimepath' and 'packpath' does not include $HOME.
12set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
13if has('packages')
14  let &packpath = &rtp
15endif
16
17" Only when the +eval feature is present.
18if 1
19  " Make sure the .Xauthority file can be found after changing $HOME.
20  if $XAUTHORITY == ''
21    let $XAUTHORITY = $HOME . '/.Xauthority'
22  endif
23
24  " Avoid storing shell history.
25  let $HISTFILE = ""
26
27  " Make sure $HOME does not get read or written.
28  " It must exist, gnome tries to create $HOME/.gnome2
29  let $HOME = getcwd() . '/XfakeHOME'
30  if !isdirectory($HOME)
31    call mkdir($HOME)
32  endif
33endif
34