robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

zeertzjqtest(old): map `gQ` to `1q:` (#41025)205a1ce4c7

master
3.1 KiB121 linesraw
1if exists('s:did_load')
2  " Align Nvim defaults to Vim.
3  set commentstring=/*\ %s\ */
4  if g:testname !~ 'test_ins_complete_no_halt\.vim$'
5    set complete=.,w,b,u,t,i
6    set completeopt=menu,preview
7  endif
8  set define=^\\s*#\\s*define
9  set diffopt=internal,filler,closeoff,indent-heuristic,inline:char
10  set directory^=.
11  set display=
12  set fillchars=vert:\|,foldsep:\|,fold:-
13  set formatoptions=tcq
14  set fsync
15  set include=^\\s*#\\s*include
16  set joinspaces
17  set jumpoptions=
18  set laststatus=1
19  set listchars=eol:$
20  set maxsearchcount=99
21  set mousemodel=extend
22  set nohidden nosmarttab noautoindent noautoread
23  set nohlsearch noincsearch
24  set nrformats=bin,octal,hex
25  set sessionoptions+=options
26  set shelltemp
27  set shortmess=filnxtToOS
28  set sidescroll=0
29  set startofline
30  set switchbuf=
31  set tags=./tags,tags
32  set undodir^=.
33  set viewoptions+=options
34  set wildoptions=
35  if has('win32')
36    set isfname+=:
37  endif
38  if 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.
41    nnoremap Q 1q:<Cmd>call<SID>ExStart()<CR>
42    " Make "gQ" go to Vim Ex mode.
43    noremap gQ 1q:
44  endif
45endif
46
47" Common preparations for running tests.
48
49" Only load this once.
50if exists('s:did_load')
51  finish
52endif
53let s:did_load = 1
54
55func s:ExStart()
56  call 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.
65  if state('m') == '' && mode(1) == 'cv' && getcharstr(1) == "\<C-C>"
66    call feedkeys("\n")
67  endif
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')
93  let $SHELL = ''
94  let $TERM = ''
95  let &shell = empty($COMSPEC) ? exepath('cmd.exe') : $COMSPEC
96  set shellcmdflag=/s/c shellxquote=\" shellredir=>%s\ 2>&1
97  let &shellpipe = &shellredir
98endif
99
100" Detect user modules for language providers
101let $PYTHONUSERBASE = $HOME . '/.local'
102if executable('gem')
103  let $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')
111  let $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)
117  call mkdir($HOME)
118endif
119
120" Use Vim's default color scheme
121colorscheme vim