Skip to content

jpaulogg/vis-ins-completion

Repository files navigation

Vis insert completion

Basic insert mode completion for the vis editor. Works in insert and replace modes and supports multiple selections.

Complete Methods

  • line completion:
    • mapped to <C-x><C-l>
  • character completion:
    • mapped to <C-Up> and <C-Down>
    • in vim this is mapped to <C-E> and <C-Y>
    • need some improvements, specially to handle multi-byte characters.
  • dictionary completion:
    • mapped to <C-x><C-k>
    • dictionary must be a new-line separated list of items.
    • wl.sh is a helper that reads from stdin and prints a new-line separated list of words/WORDS to stdout
    • default dictionary path: ~/.local/share/dict/{syntax}.
    • syntaxes names are the same defined by the filetype.lua plugin
  • keyword completion:
    • mapped to <C-n>. Note that this will overwrite standard word completion mapping
    • this method combine the output of shell commands in the completeopts table.
    • the default behaviour is to combine word completion and dictionary completion.

Configuration

You can set some options from init.lua file or from your visrc.lua:

Installation

Each script can be instaled separetaly. For example:

mkdir -p ~/.config/vis/plugins
cd ~/.config/vis/plugins
curl -O https://raw.githubusercontent.com/jpaulogg/vis-ins-completion/master/complete-dict.lua
echo 'require("plugins/complete-dict")' >> ../visrc.lua

To install all scripts:

mkdir -p ~/.config/vis/plugins
cd ~/.config/vis/plugins
git clone https://github.com/jpaulogg/vis-ins-completion
echo 'require("plugins/vis-ins-completion")' >> ../visrc.lua

About

Basic insert mode completion for the vis editor.

Topics

Resources

Stars

Watchers

Forks

Languages