Skip to content

coward.nvim, or Crab of Wisdom and Rusty Devotion, is intended to be a neovim plugin written in both Rust and Lua for autocomplete word inclusion

Notifications You must be signed in to change notification settings

AshLink95/coward.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neovim LuaJIT Rust

coward.nvim

coward.nvim is a neovim plugin for natural language autocompletion built on Rust. It stands for "Crab of Wisdom and Rusted Devotion".

This plugin also offers a CLI tool for manual addition and inspection as well as 370k+ english words from the get-go.

Dependencies

Implementation

This plugin uses a trie to easily store and access words. This trie is implemented in Rust and, upon loading, accesses a SQLite database where all words are stored. This implementation makes this plugin as fast and bloat-free as possible.

Installation

On any platform, you can run the provided install.py python script to setup this plugin and install its binary. The whole procedure would look something like

git clone https://github.com/AshLink95/coward.nvim.git
cd coward.nvim
./install.py

You will find the file insert_english.txt which I created using the english words repo. That contains all english words. However, You can define the words you want your autocomplete to recognize by adding onto that file. You can even create your own but you have to modify the installation script.

Setup and Configuration

In your nvim-cmp setup, make sure you add {name = 'coward'} to require('cmp').config.sources({...}).

You can setup the maximum items displayed (to 10, for example) by adding the following to your init.lua:

require('coward').setup({ max_items = 10 })

Note that this the default max_items is 10

CLI usage

You can manually inspect your DB by using

./cowardCLI

Once there, you'll know your way around. It's an intuitive CLI tool.

Direct SQLite database manipulation

Keep in mind that this is a SQLite database. You can directly modify elements of the database and the programs will still function as intended. By default, the database is coward.db in the plugin root.

About

coward.nvim, or Crab of Wisdom and Rusty Devotion, is intended to be a neovim plugin written in both Rust and Lua for autocomplete word inclusion

Resources

Stars

Watchers

Forks

Packages

No packages published