Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if &compatible
- set nocompatible
- endif
- function! s:hint_n_m() abort " {{{
- redir => str
- :marks
- redir END
- echo str
- return 'm' . nr2char(getchar())
- endfunction " }}}
- nnoremap <expr> m <SID>hint_n_m()
- function! s:hint_n_quote() abort " {{{
- redir => str
- :marks
- redir END
- echo str
- return '`' . nr2char(getchar())
- endfunction " }}}
- nnoremap <expr> ` <SID>hint_n_quote()
- nnoremap <expr> ' <SID>hint_n_quote()
- function! s:hint_n_doublequote() abort " {{{
- redir => str
- :registers
- redir END
- echo str
- return '"' . nr2char(getchar())
- endfunction " }}}
- nnoremap <expr> " <SID>hint_n_doublequote()
- let s:compl_key_dict = {
- \ char2nr("\<C-l>"): "\<C-x>\<C-l>",
- \ char2nr("\<C-n>"): "\<C-x>\<C-n>",
- \ char2nr("\<C-p>"): "\<C-x>\<C-p>",
- \ char2nr("\<C-k>"): "\<C-x>\<C-k>",
- \ char2nr("\<C-t>"): "\<C-x>\<C-t>",
- \ char2nr("\<C-i>"): "\<C-x>\<C-i>",
- \ char2nr("\<C-]>"): "\<C-x>\<C-]>",
- \ char2nr("\<C-f>"): "\<C-x>\<C-f>",
- \ char2nr("\<C-d>"): "\<C-x>\<C-d>",
- \ char2nr("\<C-v>"): "\<C-x>\<C-v>",
- \ char2nr("\<C-u>"): "\<C-x>\<C-u>",
- \ char2nr("\<C-o>"): "\<C-x>\<C-o>",
- \ char2nr('s'): "\<C-x>s",
- \ char2nr("\<C-s>"): "\<C-x>s"
- \}
- let s:hint_i_ctrl_x_msg = join([
- \ '<C-l>: While lines',
- \ '<C-n>: keywords in the current file',
- \ "<C-k>: keywords in 'dictionary'",
- \ "<C-t>: keywords in 'thesaurus'",
- \ '<C-i>: keywords in the current and included files',
- \ '<C-]>: tags',
- \ '<C-f>: file names',
- \ '<C-d>: definitions or macros',
- \ '<C-v>: Vim command-line',
- \ "<C-u>: User defined completion ('completefunc')",
- \ "<C-o>: omni completion ('omnifunc')",
- \ "s: Spelling suggestions ('spell')"
- \], "\n")
- function! s:hint_i_ctrl_x() abort " {{{
- echo s:hint_i_ctrl_x_msg
- let c = getchar()
- return get(s:compl_key_dict, c, nr2char(c))
- endfunction " }}}
- inoremap <expr> <C-x> <SID>hint_i_ctrl_x()
Add Comment
Please, Sign In to add comment