view src/testdir/test_mapping.in @ 9735:8037eb704e93 v7.4.2143

commit https://github.com/vim/vim/commit/bc7ce675b2d1c9fb58c067eff3edd59abc30aba4 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Aug 1 22:49:22 2016 +0200 patch 7.4.2143 Problem: A funccal is garbage collected while it can still be used. Solution: Set copyID in all referenced functions. Do not list lambda functions with ":function".
author Christian Brabandt <cb@256bit.org>
date Mon, 01 Aug 2016 23:00:07 +0200
parents c8efa41dd451
children
line wrap: on
line source

Test for mappings and abbreviations

STARTTEST
:so small.vim
:so mbyte.vim
:set encoding=utf-8
: " abbreviations with р (0x80) should work
:inoreab чкпр   vim
GAчкпр 

:" mapping of ctrl-c in Insert mode
:set cpo-=< cpo-=k
:inoremap <c-c> <ctrl-c>
:cnoremap <c-c> dummy
:cunmap <c-c>
GA
TEST2: CTRL-C |A|

:unmap <c-c>
:unmap! <c-c>
:"
:" mapping of ctrl-c in Visual mode
:vnoremap <c-c> :<C-u>$put ='vmap works'
GV
:vunmap <c-c>
:"
:" langmap should not get remapped in insert mode
:inoremap { FAIL_ilangmap
:set langmap=+{ langnoremap
o+
:" Insert-mode expr mapping with langmap
:inoremap <expr> { "FAIL_iexplangmap"
o+
:" langmap should not get remapped in Command-line mode
:cnoremap { FAIL_clangmap
:call append(line('$'), '+')
:cunmap {
:" Command-line mode expr mapping with langmap
:cnoremap <expr> { "FAIL_cexplangmap"
:call append(line('$'), '+')
:cunmap {
:"
:" issue #212 (feedkeys insert mapping at current position)
:nnoremap . :call feedkeys(".", "in")<cr>
:/^a b
0qqdw.ifooqj0@q:unmap .

:" <c-g>U<cursor> works only within a single line
:imapclear
:imap ( ()<c-g>U<left>
G2oki
Test1: text with a (here some more textk.
:" test undo
G2oki
Test2: text wit a (here some more text [und undo]uk.u
:"
:imapclear
:set whichwrap=<,>,[,]
G3o2k
:exe ":norm! iTest3: text with a (parenthesis here\<C-G>U\<Right>new line here\<esc>\<up>\<up>."



:/^test/,$w! test.out
:qa!
ENDTEST

test starts here:

a b c d
a b c d