view src/testdir/test_mapping.in @ 6999:dc1b678f0e4e v7.4.817

patch 7.4.817 Problem: Invalid memory access in file_pat_to_reg_pat(). Solution: Use vim_isspace() instead of checking for a space only. (Dominique Pelle)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 16:20:05 +0200
parents 5b1eefbf9a53
children c8efa41dd451
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 .


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

test starts here:

a b c d
a b c d