A commandline module of Vital
VimL Shell
Permalink
Failed to load latest commit information.
.ci
autoload/vital/__vital__/Vim
doc
test
.travis.yml
.vintrc.yaml
README.md
appveyor.yml

README.md

vital-Vim-Prompt

Travis CI AppVeyor Version 1.0.0 Support Vim 7.4 or above MIT License Doc

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()