Awesome
vital-Vim-Prompt
Introductions
This module provides a customizable commandline interface. This implementation focused to provide a simple code. See osyo-manga/vital-over if you want a future rich commandline interface.
Install
Plug 'lambdalisue/vital-Vim-Prompt'
And call the following to bundle this plugin
:Vitalize . +Vim.Prompt
Usage
let s:Prompt = vital#vital#import('Vim.Prompt')
let s:prompt = s:Prompt.new({
\ 'prefix': '# ',
\})
function! s:prompt.keydown(key, char) abort
if a:key ==# "\<F1>"
let self.replace('F1 has pressed')
let self._exit = 1
return 1
endif
return 0
endfunction
function! s:prompt.callback() abort
if get(self, '_exit')
return 1
endif
return 0
endfunction
call s:prompt.start()