Giter Club home page Giter Club logo

Comments (19)

Shatur avatar Shatur commented on August 26, 2024 1

Yes, it works, thank you!
Is it possible to add information about completion source? For example, if I use completion from buffer, it shows [buffer] to the right of the proposed word:
изображение
Something like [spell] or [dictionary]?

Maybe better experience with fuzzy filter such as machakann/asyncomplete-ezfilter.vim.

Thank you, I like it :)

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024 1

Thank you a lot!

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024 1

Your plugin is very useful! I suggest to add this information to the repo readme and submit this plugin to the asyncomplete sources too.

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024 1

Maybe is it possible to add small completion delay to reduce input lag?

Sorry, I don't know how to implement it.

Now I decided to support only grep way because I think it is suitable for this plugin. I have already merged into master.
Please be careful that necessary setting changed from the above comment (#1 (comment)).

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Hello! Please try this branch and setting.
https://github.com/htlsne/asyncomplete-look/tree/spell.

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'spell',
    \ 'whitelist': ['text', 'markdown'],
    \ 'completor': function('asyncomplete#sources#spell#completor'),
    \ })

" if you not set it other way
set spell

I think it is the same completion mechanism as MUcomplete (although I have never used that plugin).

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Maybe better experience with fuzzy filter such as machakann/asyncomplete-ezfilter.vim.

let g:asyncomplete_preprocessor =
  \ [function('asyncomplete#preprocessor#ezfilter#filter')]

let g:asyncomplete#preprocessor#ezfilter#config = {}
let g:asyncomplete#preprocessor#ezfilter#config.spell =
  \ {ctx, items -> ctx.osa_filter(items, 1)}

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Merged into master.

Added in latest version:

Is it possible to add information about completion source? For example, if I use completion from buffer, it shows [buffer] to the right of the proposed word:
Something like [spell] or [dictionary]?

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

After a long use, I began to notice that when using machakann/asyncomplete-ezfilter.vim, Vim starts to work much slower, especially when moving the cursor. Now I use your plugin without it.

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

I was wrong. The problem is in spell completion itself. Input response becomes much slower with it :(
This is especially noticeable when quickly entering a large number of characters. Try entering something likeajsdashdkjahdkjahdkjahskdhakjhsdkjahsdhlkljkl, you will see how your cursor hangs.

I understand that this, most likely, cannot be done faster :(

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

I hear that spellsuggest() is slow.
For provide complete from spell dictionaries, another approach may be preferable.

Try this branch. It grep your dictionary file directly.
https://github.com/htlsne/asyncomplete-look/tree/grep

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'look',
    \ 'whitelist': ['text', 'markdown'],
    \ 'completor': function('asyncomplete#sources#look#completor'),
    \ })

" Find your dictionary path such as /home/<username>/.vim/spell/en.utf-8.add
let g:asc_look_spell_file = /full/path/to/your/en.utf-8.add

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'spell',
    \ 'whitelist': ['text', 'markdown'],
    \ 'completor': function('asyncomplete#sources#spell#completor'),
    \ })

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

Sorry for newbie questions, but where can I find en.utf-8.add file? I using Neovim and have only preinstalled /usr/share/nvim/runtime/spell/en.utf-8.spl and ~/.local/share/nvim/site/spell/ru.utf-8.spl. I tried both, but completion not works.

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Does ~/.config/nvim/spell/en.utf-8.add exists? .add file is plain text file that contains your spell dictionary word.

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

No, the spell directory even not exists.

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Hmm... When you use zg to add a good word, a message like Word 'xxx' added to ~/.config/nvim/spell/en.utf-8.add should be shown. This is .add file.

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

Oh, sorry, I just didn’t add the words :)
I tested it with the following configuration:

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'look',
    \ 'whitelist': ['text', 'markdown'],
    \ 'completor': function('asyncomplete#sources#look#completor'),
    \ })

let g:asc_look_spell_file = '/home/gena/.config/nvim/spell/en.utf-8.add'

au User asyncomplete_setup call asyncomplete#register_source({
    \ 'name': 'spell',
    \ 'whitelist': ['text', 'markdown'],
    \ 'completor': function('asyncomplete#sources#spell#completor'),
    \ })

But it not works, added word plugins not suggested. The file /home/gena/.config/nvim/spell/en.utf-8.add exists and contains plugins.

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

Oh, sorry, I just didn’t add the words :)

I thought "spell dictionaries" means these added words, didn't you mean that...?

But it not works, added word plugins not suggested. The file /home/gena/.config/nvim/spell/en.utf-8.add exists and contains plugins.

Using grep branch, and editing filetype=text or markdown file?

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

I thought "spell dictionaries" means these added words, didn't you mean that...?

I meant auto-completion from the words that I added + words from the standard spell dictionary. The current master branch works in this way.

Using grep branch, and editing filetype=text or markdown file?

Yes, I even checked on both filetypes.

from asyncomplete-look.

hiterm avatar hiterm commented on August 26, 2024

I meant auto-completion from the words that I added + words from the standard spell dictionary. The current master branch works in this way.

If you mean "standard spell dictionary" is same dictionary as z=, all I can do now is current master branch.

grep branch uses your added words + look command dictionary (/usr/share/dict/words). I expect this is faster than master branch (not certainly because speed depends on environments).
It works like this.
Screenshot from 2020-03-12 08-15-11

If you don't like this, I don't have any other idea, sorry. If you like it, I can support to work this.

from asyncomplete-look.

Shatur avatar Shatur commented on August 26, 2024

If you mean "standard spell dictionary" is same dictionary as z=, all I can do now is current master branch.

Yes, I understand :(
Maybe is it possible to add small completion delay to reduce input lag?

grep branch uses your added words + look command dictionary (/usr/share/dict/words). I expect this is faster than master branch (not certainly because speed depends on environments).
It works like this.

Yes, this is nice idea. The spellsuggest() is better, but it's slow when I typing a lot of letters :(

from asyncomplete-look.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.