summaryrefslogtreecommitdiff
path: root/autoload/deoplete/mapping.vim
diff options
context:
space:
mode:
Diffstat (limited to 'autoload/deoplete/mapping.vim')
-rw-r--r--autoload/deoplete/mapping.vim41
1 files changed, 41 insertions, 0 deletions
diff --git a/autoload/deoplete/mapping.vim b/autoload/deoplete/mapping.vim
new file mode 100644
index 0000000..ad191c1
--- /dev/null
+++ b/autoload/deoplete/mapping.vim
@@ -0,0 +1,41 @@
+"=============================================================================
+" FILE: mapping.vim
+" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
+" License: MIT license
+"=============================================================================
+
+function! deoplete#mapping#_init() abort "{{{
+ inoremap <silent> <Plug>(deoplete_start_complete)
+ \ <C-r>=deoplete#mapping#_do_complete(g:deoplete#_context)<CR>
+ inoremap <silent> <Plug>(deoplete_auto_refresh)
+ \ <C-r>=deoplete#mapping#refresh()<CR>
+endfunction"}}}
+
+function! deoplete#mapping#_do_complete(context) abort "{{{
+ if b:changedtick == get(a:context, 'changedtick', -1)
+ \ && mode() ==# 'i'
+ call complete(a:context.complete_position + 1, a:context.candidates)
+ endif
+
+ return ''
+endfunction"}}}
+function! deoplete#mapping#_set_completeopt() abort "{{{
+ if exists('g:deoplete#_saved_completeopt')
+ return
+ endif
+ let g:deoplete#_saved_completeopt = &completeopt
+ set completeopt-=longest
+ set completeopt+=menuone
+ set completeopt-=menu
+ if &completeopt !~# 'noinsert\|noselect'
+ set completeopt+=noselect
+ endif
+endfunction"}}}
+function! deoplete#mapping#_rpcnotify_wrapper(sources) abort "{{{
+ call rpcrequest(g:deoplete#_channel_id,
+ \ 'deoplete_manual_completion_begin',
+ \ deoplete#init#_context('Manual', a:sources))
+ return ''
+endfunction"}}}
+
+" vim: foldmethod=marker