Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrsh7th/vim-compete
Auto completion plugin for vim/nvim that supports fuzzy match.
https://github.com/hrsh7th/vim-compete
vim vim-plugin
Last synced: 2 months ago
JSON representation
Auto completion plugin for vim/nvim that supports fuzzy match.
- Host: GitHub
- URL: https://github.com/hrsh7th/vim-compete
- Owner: hrsh7th
- Archived: true
- Created: 2020-03-09T03:57:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-02T13:47:02.000Z (over 4 years ago)
- Last Synced: 2024-08-07T18:46:43.460Z (6 months ago)
- Topics: vim, vim-plugin
- Language: Vim script
- Homepage:
- Size: 92.8 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# vim-compete
auto completion engine.
# status
Works but not documented.
# install
### vim-plug
```viml
Plug 'hrsh7th/vim-compete'
```# mapping
#### `(compete-force-refresh)`
Invoke completion ignoring `g: compete_min_length`.
You can mapping as following to confirm or cancel completion with ``/``.
```viml
imap pumvisible() ? compete#close({ 'confirm': v:true }) : "\"
imap pumvisible() ? compete#close({ 'confirm': v:false }) : "\"" or
imap complete_info(['selected']).selected != -1 ? compete#close({ 'confirm': v:true }) : "\"
imap complete_info(['selected']).selected != -1 ? compete#close({ 'confirm': v:false }) : "\"
```If you using pear-tree or lexima.vim, You should care about it.
```viml
" For lexima.vim
imap pumvisible() ? compete#close({ 'confirm': v:true }) : lexima#expand('CR>', 'i')" For pear-tree
imap pumvisible() ? compete#close({ 'confirm': v:true }) : "(PearTreeExpand)"
```# config
### `g:compete_enable = v:true`
Type: boolean
You can disable compete via this value.
### `g:compete_completeopt= 'menu,menuone,noinsert'`
Type: string
You can choose `completeopt` option value
### `g:compete_throttle_time = 200`
Type: number
You can specify delay time to filter items.
### `g:compete_source_wait_time = 200`
Type: number
You can specify delay time to wait incomplete sources.
### `g:compete_linewise_chars = [',', '{']`
Type: string[]
You can specify trigger chars thats will be searched in the current or above lines.
### `g:compete_fuzzy = v:true`
Type: boolean
You can disable fuzzy matching via this value.
### `g:compete_patterns = { ... }`
Type: dict
You can specify keyword patterns per filetype.
The key is filetype and value is vim-regex.### `g:compete_min_length = 1`
Type: number
You can specify the length to starting auto-completion.
# built-in source
### buffer
Priority: -1
Keyword completion.
##### `g:compete_source_buffer_cache_range = 1000`
Type: number
You can specify range to cache keywordss.
If you specify 100, `compete` will cache lines thats in the range of `line('.') - 100` ~ `line('.') + 100`.### file
Priority: 100
Filepath completion.
# feature
### Well handling multi start position
- Multi sources support is easy but does not easy to support multi start positions
- `compete` supports `complete start position` `word pattern position` and `trigger character position`.### Simple fuzzy matching
- `abcde` -> `^\Va\m.\{-}\Vb\m.\{-}\Vc\m.\{-}\Vd\m.\{-}\Ve`### Simple frequency sorting
- Sort frequently selected items.# TODO
- Use golang for filter/sort.