Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/girishji/ngramview-complete.vim
Next word completion for Vim based on Google Ngrams Viewer.
https://github.com/girishji/ngramview-complete.vim
autocomplete autocomplete-search autocompletion google-ngram-api google-ngram-viewer ngram ngrams vim vim-cmd vim-plugin vim-search vim9-script
Last synced: about 2 months ago
JSON representation
Next word completion for Vim based on Google Ngrams Viewer.
- Host: GitHub
- URL: https://github.com/girishji/ngramview-complete.vim
- Owner: girishji
- License: mit
- Created: 2023-07-23T22:00:21.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-26T08:45:02.000Z (over 1 year ago)
- Last Synced: 2024-08-07T18:45:26.276Z (5 months ago)
- Topics: autocomplete, autocomplete-search, autocompletion, google-ngram-api, google-ngram-viewer, ngram, ngrams, vim, vim-cmd, vim-plugin, vim-search, vim9-script
- Language: Vim Script
- Homepage: https://github.com/girishji/vimcomplete
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## This plugin is superceded by [ngram-complete](https://github.com/girishji/ngram-complete.vim). Please use it instead.
---
# Ngram Completion Based on Google Ngrams Viewer
This plugin is a helper for Vim completion plugin
[Vimcomplete](https://github.com/girishji/vimcomplete). It suggests (completes)
next word based on bigram, trigram and 4-gram word association by querying [Google Ngrams
Viewer](https://books.google.com/ngrams/). No additional packages or databases are required._**Note:** Google ngram queries can be slow and can take over a second. However,
Vim's responsiveness is not affected because queries are asynchronous (`:h job`) and results
are cached. I implemented this out of curiosity but I do not find it very
useful. Your mileage may vary._![image](https://i.imgur.com/HHDt2yh.png)
# Requirements
- Vim >= 9.0
# Installation
Install this plugin after [Vimcomplete](https://github.com/girishji/vimcomplete).
Install using [vim-plug](https://github.com/junegunn/vim-plug).
```
vim9script
plug#begin()
Plug 'girishji/ngram-complete.vim'
plug#end()
```For those who prefer legacy script.
```
call plug#begin()
Plug 'girishji/ngram-complete.vim'
call plug#end()
```Or use Vim's builtin package manager.
# Configuration
Default options are as follows.
```
vim9script
export var options: dict = {
priority: 11, # Higher priority items are shown at the top
maxCount: 10, # Maximum number of next-word items shown
cacheSize: 100, # Each ngram takes up one slot in the cache
}
autocmd VimEnter * g:VimCompleteOptionsSet(options)
```