blob: f900f421e200b90630857f211ebb55c1d46977ca [file] [log] [blame]
Bram Moolenaarbdef5182014-10-21 16:22:17 +02001Test for mappings and abbreviations
2
3STARTTEST
4:so small.vim
5:so mbyte.vim
Bram Moolenaar7a373dd2014-10-22 22:09:01 +02006:set encoding=utf-8
Bram Moolenaarbdef5182014-10-21 16:22:17 +02007: " abbreviations with р (0x80) should work
8:inoreab чкпр vim
9GAчкпр
10
Bram Moolenaar50008692015-01-14 16:08:32 +010011:" mapping of ctrl-c in Insert mode
Bram Moolenaar651863c2015-01-14 12:44:41 +010012:set cpo-=< cpo-=k
13:inoremap <c-c> <ctrl-c>
14:cnoremap <c-c> dummy
15:cunmap <c-c>
16GA
17TEST2: CTRL-C |A|
18
Bram Moolenaar50008692015-01-14 16:08:32 +010019:unmap <c-c>
20:unmap! <c-c>
21:"
22:" mapping of ctrl-c in Visual mode
23:vnoremap <c-c> :<C-u>$put ='vmap works'
24GV
25:vunmap <c-c>
26:"
27:" langmap should not get remapped in insert mode
Bram Moolenaarc68c72e2014-12-14 00:43:54 +010028:inoremap { FAIL_ilangmap
29:set langmap=+{ langnoremap
30o+
Bram Moolenaarae94b772015-07-10 17:19:30 +020031:" Insert-mode expr mapping with langmap
Bram Moolenaarc68c72e2014-12-14 00:43:54 +010032:inoremap <expr> { "FAIL_iexplangmap"
33o+
Bram Moolenaarae94b772015-07-10 17:19:30 +020034:" langmap should not get remapped in Command-line mode
35:cnoremap { FAIL_clangmap
36:call append(line('$'), '+')
37:cunmap {
38:" Command-line mode expr mapping with langmap
39:cnoremap <expr> { "FAIL_cexplangmap"
40:call append(line('$'), '+')
41:cunmap {
42:"
Bram Moolenaard7ce7a92015-02-03 16:53:51 +010043:" issue #212 (feedkeys insert mapping at current position)
44:nnoremap . :call feedkeys(".", "in")<cr>
45:/^a b
460qqdw.ifooqj0@q:unmap .
47
Bram Moolenaar8b5f65a2015-09-01 19:26:12 +020048:" <c-g>U<cursor> works only within a single line
49:imapclear
50:imap ( ()<c-g>U<left>
51G2oki
52Test1: text with a (here some more textk.
53:" test undo
54G2oki
55Test2: text wit a (here some more text [und undo]uk.u
56:"
57:imapclear
58:set whichwrap=<,>,[,]
59G3o2k
60:exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>."
61
62
Bram Moolenaarc68c72e2014-12-14 00:43:54 +010063
Bram Moolenaarbdef5182014-10-21 16:22:17 +020064:/^test/,$w! test.out
65:qa!
66ENDTEST
67
68test starts here:
69
Bram Moolenaard7ce7a92015-02-03 16:53:51 +010070a b c d
71a b c d
72