summaryrefslogtreecommitdiffstats
path: root/src/testdir/setup.vim
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:09:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:09:20 +0000
commit029f72b1a93430b24b88eb3a72c6114d9f149737 (patch)
tree765d5c2041967f9c6fef195fe343d9234a030e90 /src/testdir/setup.vim
parentInitial commit. (diff)
downloadvim-029f72b1a93430b24b88eb3a72c6114d9f149737.tar.xz
vim-029f72b1a93430b24b88eb3a72c6114d9f149737.zip
Adding upstream version 2:9.1.0016.upstream/2%9.1.0016
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/testdir/setup.vim')
-rw-r--r--src/testdir/setup.vim43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/testdir/setup.vim b/src/testdir/setup.vim
new file mode 100644
index 0000000..0e5088a
--- /dev/null
+++ b/src/testdir/setup.vim
@@ -0,0 +1,43 @@
+" Common preparations for running tests.
+
+" Only load this once.
+if 1
+
+ " When using xterm version 377 the response to the modifyOtherKeys status
+ " interferes with some tests. Remove the request from the t_TI termcap
+ " entry.
+ let &t_TI = substitute(&t_TI, "\<Esc>\\[?4m", '', '')
+
+ if exists('s:did_load')
+ finish
+ endif
+ let s:did_load = 1
+endif
+
+" Make sure 'runtimepath' and 'packpath' does not include $HOME.
+set rtp=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after
+if has('packages')
+ let &packpath = &rtp
+endif
+
+" Only when the +eval feature is present.
+if 1
+ " Make sure the .Xauthority file can be found after changing $HOME.
+ if $XAUTHORITY == ''
+ let $XAUTHORITY = $HOME . '/.Xauthority'
+ endif
+
+ " Avoid storing shell history.
+ let $HISTFILE = ""
+
+ " Have current $HOME available as $ORIGHOME. $HOME is used for option
+ " defaults before we get here, and test_mksession checks that.
+ let $ORIGHOME = $HOME
+
+ " Make sure $HOME does not get read or written.
+ " It must exist, gnome tries to create $HOME/.gnome2
+ let $HOME = getcwd() . '/XfakeHOME'
+ if !isdirectory($HOME)
+ call mkdir($HOME)
+ endif
+endif