Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. if &compatible
  2. set nocompatible
  3. endif
  4. let s:compl_key_dict = {
  5. \ char2nr("\<C-l>"): "\<C-x>\<C-l>",
  6. \ char2nr("\<C-n>"): "\<C-x>\<C-n>",
  7. \ char2nr("\<C-p>"): "\<C-x>\<C-p>",
  8. \ char2nr("\<C-k>"): "\<C-x>\<C-k>",
  9. \ char2nr("\<C-t>"): "\<C-x>\<C-t>",
  10. \ char2nr("\<C-i>"): "\<C-x>\<C-i>",
  11. \ char2nr("\<C-]>"): "\<C-x>\<C-]>",
  12. \ char2nr("\<C-f>"): "\<C-x>\<C-f>",
  13. \ char2nr("\<C-d>"): "\<C-x>\<C-d>",
  14. \ char2nr("\<C-v>"): "\<C-x>\<C-v>",
  15. \ char2nr("\<C-u>"): "\<C-x>\<C-u>",
  16. \ char2nr("\<C-o>"): "\<C-x>\<C-o>",
  17. \ char2nr('s'): "\<C-x>s",
  18. \ char2nr("\<C-s>"): "\<C-x>s"
  19. \}
  20.  
  21. let s:hint_i_ctrl_x_msg_lines = [
  22. \ '<C-l>: While lines',
  23. \ '<C-n>: keywords in the current file',
  24. \ "<C-k>: keywords in 'dictionary'",
  25. \ "<C-t>: keywords in 'thesaurus'",
  26. \ '<C-i>: keywords in the current and included files',
  27. \ '<C-]>: tags',
  28. \ '<C-f>: file names',
  29. \ '<C-d>: definitions or macros',
  30. \ '<C-v>: Vim command-line',
  31. \ '<C-u>: User defined completion',
  32. \ '<C-o>: omni completion',
  33. \ 's: Spelling suggestions'
  34. \]
  35. let s:hint_i_ctrl_x_msg = join(s:hint_i_ctrl_x_msg_lines, "\n")
  36.  
  37. function! s:hint_i_ctrl_x() abort " {{{
  38. echo (&lines > len(s:hint_i_ctrl_x_msg_lines)) ? s:hint_i_ctrl_x_msg : join(s:hint_i_ctrl_x_msg_lines[: &lines - 2], "\n")
  39. return get(s:compl_key_dict, getchar(), '')
  40. endfunction " }}}
  41.  
  42. inoremap <silent><expr><C-x> <SID>hint_i_ctrl_x()
Add Comment
Please, Sign In to add comment