aboutsummaryrefslogtreecommitdiff
path: root/vim/bundle/tlib_vim/autoload/tlib/map.vim
blob: c1af13f687e91bf0bed40ea41b2dbcc907c7efc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
" map.vim
" @Author:      Tom Link (mailto:micathom AT gmail com?subject=[vim])
" @Website:     http://www.vim.org/account/profile.php?user_id=4037
" @License:     GPL (see http://www.gnu.org/licenses/gpl.txt)
" @Created:     2009-08-23.
" @Last Change: 2009-08-23.
" @Revision:    0.0.4

let s:save_cpo = &cpo
set cpo&vim


" If |pumvisible()| is true, return "\<c-y>". Otherwise return a:key.
" For use in maps like: >
"   imap <expr> <cr> tlib#map#PumAccept("\<cr>")
function! tlib#map#PumAccept(key) "{{{3
    return pumvisible() ? "\<c-y>" : a:key
endf



let &cpo = s:save_cpo
unlet s:save_cpo