vim-pseudocl


Ⅰ. 插件描述

Pseudo-command-line (experimental)

Ⅱ. 基本信息

创建日期:  2014-02-16
使用用户:  96
Github星:  17
插件作者:  Junegunn Choi

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'junegunn/vim-pseudocl'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'junegunn/vim-pseudocl'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'junegunn/vim-pseudocl'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/junegunn/vim-pseudocl

Ⅳ. 文档说明

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

  • pseudocl#start()

Render

  • pseudocl#render#echo()

    • pseudocl#render#echo_prompt()
    • pseudocl#render#echo_line()
  • pseudocl#render#clear()

Complete

  • pseudocl#complete#extract_words()

License

MIT

添加新评论