robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
205a1ce4c7
master
1if exists ( 's:did_load' ) 2" Align Nvim defaults to Vim. 3set commentstring = /*\ %s\ */ 4if g: testname !~ 'test_ins_complete_no_halt\.vim$' 5set complete = .,w,b,u,t,i 6set completeopt = menu,preview 7endif 8set define = ^\\s*#\\s*define 9set diffopt = internal,filler,closeoff,indent-heuristic,inline:char 10set directory ^=. 11set display = 12set fillchars = vert:\|,foldsep:\|,fold:- 13set formatoptions = tcq 14set fsync 15set include = ^\\s*#\\s*include 16set joinspaces 17set jumpoptions = 18set laststatus = 1 19set listchars = eol:$ 20set maxsearchcount = 99 21set mousemodel = extend 22set nohidden nosmarttab noautoindent noautoread 23set nohlsearch noincsearch 24set nrformats = bin,octal,hex 25set sessionoptions += options 26set shelltemp 27set shortmess = filnxtToOS 28set sidescroll = 0 29set startofline 30set switchbuf = 31set tags = ./tags,tags 32set undodir ^=. 33set viewoptions += options 34set wildoptions = 35if has ( 'win32' ) 36set isfname += : 37endif 38if g: testname !~ 'test_mapping\.vim$' 39" Make "Q" behave like normal Ex mode. 40" This does not work for all tests as Nvim only supports Vim Ex mode. 41nnoremap Q 1q:< Cmd>call< SID > ExStart()< CR > 42" Make "gQ" go to Vim Ex mode. 43noremap gQ 1q: 44endif 45endif 46 47" Common preparations for running tests. 48 49" Only load this once. 50if exists ( 's:did_load' ) 51finish 52endif 53let s: did_load = 1 54 55func s: ExStart () 56call feedkeys ( $ "\<Cmd>call{expand('<SID>')}ExMayEnd()\<CR>") 57endfunc 58 59func s: ExMayEnd () 60" When :normal runs out of characters in Vim, the behavior is different in 61" normal Ex mode vs. Vim Ex mode. 62" - In normal Ex mode, "\n" is used. 63" - In Vim Ex mode, Ctrl-C is used. 64" Nvim only supports Vim Ex mode, so emulate the normal Ex mode behavior. 65if state ( 'm' ) == '' && mode ( 1 ) == 'cv' && getcharstr ( 1 ) == "\<C-C>" 66call feedkeys ( "\n" ) 67endif 68endfunc 69 70" Clear Nvim default user commands, mappings and menus. 71comclear 72mapclear 73mapclear ! 74aunmenu * 75tlunmenu * 76autocmd ! nvim.popupmenu 77 78" Undo the 'grepprg' and 'grepformat' setting in _core/defaults.lua. 79set grepprg & grepformat & 80 81" Prevent Nvim log from writing to stderr. 82let $ NVIM_LOG_FILE = exists ( $ NVIM_LOG_FILE ) ? $ NVIM_LOG_FILE : 'Xnvim.log' 83 84" Make sure 'runtimepath' and 'packpath' does not include $HOME. 85set rtp = $VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after 86let & packpath = & rtp 87 88" Avoid storing shell history. 89let $ HISTFILE = "" 90 91" Use default shell on Windows to avoid segfault, caused by TUI 92if has ( 'win32' ) 93let $ SHELL = '' 94let $ TERM = '' 95let & shell = empty ( $ COMSPEC ) ? exepath ( 'cmd.exe' ) : $ COMSPEC 96set shellcmdflag = /s/cshellxquote = \"shellredir = >%s\ 2>&1 97let & shellpipe = & shellredir 98endif 99 100" Detect user modules for language providers 101let $ PYTHONUSERBASE = $ HOME . '/.local' 102if executable ( 'gem' ) 103let $ GEM_PATH = system ( 'gem env gempath' ) 104endif 105 106" Have current $HOME available as $ORIGHOME. $HOME is used for option 107" defaults before we get here, and test_mksession checks that. 108let $ ORIGHOME = $ HOME 109 110if ! exists ( '$XDG_CONFIG_HOME' ) 111let $ XDG_CONFIG_HOME = $ HOME .. '/.config' 112endif 113 114" Make sure $HOME does not get read or written. 115let $ HOME = expand ( getcwd () . '/XfakeHOME' ) 116if ! isdirectory ( $ HOME ) 117call mkdir ( $ HOME ) 118endif 119 120" Use Vim's default color scheme 121colorscheme vim