lee-shun / asyncomplete-dictionary.vim

Provide words in 'dictionary' autocompletion source for prabirshrestha/asyncomplete.vim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dictionary source for asyncomplete.vim

Provide words in 'dictionary' autocompletion source for prabirshrestha/asyncomplete.vim

Installation

With TOML configulation file

Write following text to your TOML configulation file of dein.vim and execute :call dein#install(). in your Vim.

[[plugins]]
repo = 'koturn/asyncomplete-dictionary.vim'
hook_add = '''
autocmd User asyncomplete_setup call asyncomplete#register_source(
      \ asyncomplete#sources#dictionary#get_source_options({
      \   'name': 'dictionary',
      \   'allowlist': ['*'],
      \   'completor': function('asyncomplete#sources#dictionary#completor')
      \ }))
'''

Without TOML configulation file

Write following code to your .vimrc and execute :call dein#install() in your Vim.

call dein#add('koturn/asyncomplete-dictionary.vim', {
      \ 'hook_add': join([
      \   'autocmd User asyncomplete_setup call asyncomplete#register_source(',
      \   'asyncomplete#sources#dictionary#get_source_options({',
      \     "'name': 'dictionary',",
      \     "'allowlist': ['*'],",
      \     "'completor': function('asyncomplete#sources#dictionary#completor')"
      \   }), ' ')
      \ ], "")
      \})

Write following code to your .vimrc and execute :PlugInstall in your Vim.

Plug 'koturn/vim'

Clone this repository to the package directory of pathogen.

$ git clone https://github.com/koturn/asyncomplete-dictionary.vim ~/.vim/bundle/vim

With packages feature

In the first, clone this repository to the package directory.

$ git clone https://github.com/koturn/asyncomplete-dictionary.vim ~/.vim/pack/koturn/opt/vim

Second, add following code to your .vimrc.

packadd asyncomplete-dictionary.vim

With manual

If you don't want to use plugin manager, put files and directories on ~/.vim/, or %HOME%/vimfiles/ on Windows.

Registration

autocmd User asyncomplete_setup call asyncomplete#register_source(asyncomplete#sources#dictionary#get_source_options({
      \ 'name': 'dictionary',
      \ 'allowlist': ['*'],
      \ 'completor': function('asyncomplete#sources#dictionary#completor'),
      \ }))

Options

Cache level.

let g:asyncomplete_dictionary_cache_level = 2
Cache Level Description
0 Parse all dictionaries specifiled in global and local 'dictionary' every time.
1 (Default) Parse all dictionaries specifiled in global and local 'dictionary' on the first time and cache the words. Don't remake cache as long as global or local value of 'dictionary' is not updated, or dictionary files is not changed, deleted or created.
2 Parse all dictionaries specifiled in global and local 'dictionary' on the first time and cache the words. Don't remake cache.

Required plugins

LICENSE

This software is released under the MIT License, see LICENSE.

About

Provide words in 'dictionary' autocompletion source for prabirshrestha/asyncomplete.vim

License:MIT License


Languages

Language:Vim Script 100.0%