wettoast4 / micro-editor_wordCompletion

word completion plugin for the micro editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

micro-editor_wordCompletion

word completion plugin for the micro editor

This plugin adds a command to execute word completion. User can select a candidate from words collected from active buffer.

After creating this plugin, I noticed that Tab key autocompletes a word not only in command mode but also in a bufpane. (Ctrl-I possibly work as a Tab key and be available as well)

Usage

  1. Move the cursor to the right edge of a half-finished word.
  2. In command mode (Ctrl-e), enter 'wordCompletion'.
    • If there is only one candidate, the rest of the word is immediately filled.
    • Otherwise, a pane opens at the bottom and shows indexed candidates. Enter one of indexes to choose.
    • You can cancel the completion by pressing Esc key or entering any character other than shown indexes.

Installation

Put the file at the location as below.

'~/.config/micro/plug/wordCompletion/wordCompletion.lua'

Add keybinding (optional)

Add a keybinding in '~/.config/micro/bindings.json' as following example.

Example:

{
    "~~~~": "~~~~",
    "~~~~": "~~~~",
    "CtrlSpace": "command:wordCompletion"
}

About

word completion plugin for the micro editor

License:MIT License


Languages

Language:Lua 100.0%