Home

Awesome

vim-pseudocl: Pseudo-command-line interface

vim-pseudocl implements a command-line interface that mimics the native Vim command-line. It enables writing advanced command-line features with its callback functions.

Usage

pseudocl#start function will start the pseudo-command-line. It returns user-typed string or throws 'exit' on escape key or on interrupt.

try
  let got = pseudocl#start(options)
catch 'exit'
  call pseudocl#render#clear()
  echon 'No input'
endtry

The following table summarizes the dictionary parameter to pseudocl#start function.

Option nameTypeDefaultDescription
promptString':'Command-line prompt in string
promptList['None', ':']Sequence of highlight group and string pairs
highlightStringNoneHighlight group for command-line
inputString''Initial input string
on_changeFuncrefpseudocl#nopCallback function invoked on change (new, old, cursor)
on_unknown_keyFuncrefpseudocl#nopCallback function invoked on unknown key (key, str, cursor)
rendererFuncrefpseudocl#render#echoCommand-line renderer (prompt, line, cursor)
remapDict{}Remap keys
mapBoolean1To use command-line maps or not
historyList[]Command-line history
wordsList[]Words for tab completion

API

Main

Render

Complete

License

MIT