Giter Club home page Giter Club logo

Comments (5)

chew-z avatar chew-z commented on July 24, 2024

I have made it work as I like it with SuperTab without even remapping <Tab> . It took me some time reading through small print in SuperTab docs.

The trick is in setting buffer option in ftplugin/python.vim

let b:SuperTabContextDefaultCompletionType = '<C-x><C-u>'

which is equivalent to remapping <Tab> and makes SuperTab trying to call completition with Completor in Python but retain all other behavior.

For the posterity my .vimrc [all SuperTab options set explicite are default.]

let g:completor_auto_trigger = 0
" Supertab
let g:SuperTabDefaultCompletionType = "<C-p>"
let g:SuperTabDefaultCompletionType = 'context'
let g:SuperTabContextTextOmniPrecedence = ['&completefunc', '&omnifunc']
let g:SuperTabMappingForward = "<Tab>"
let g:SuperTabCrMapping = 1

My question - how to toggle Completor On/Off still remains relevant I think but less urgent.

from completor.vim.

maralla avatar maralla commented on July 24, 2024

You can use this option to allow completion only for specified file types.

To totally disable completion you can use command CompletorDisable, To reenable use CompletorEnable.

from completor.vim.

chew-z avatar chew-z commented on July 24, 2024

Thank you. I have figured that out going through code. I use call completor#enable()

Finally I have removed SuperTab at least for now - too much spaghetti thrown at the wall.

I am really, really enjoying using Completor. Works really nice.

However I am not entirely understanding how it works.

  1. Why completefunc turns out empty so often? Isn't it populated too late?

  2. How do you insert snippets from Ultisnips? I see them on the list but using <Tab> or <Ctrl-Y> or <CR> doesn't do anything. So I use Ultisnips shortcut instead but is it the right way to go?

from completor.vim.

chew-z avatar chew-z commented on July 24, 2024

After some time I like your plugin more and more.

If I may suggest however there could be a buffer version of completor_auto_trigger . That way one could enable automatic completion for certain file types with let b:completor_auto_trigger = 1.
This is different then whitelisting some filetypes.

I also find the logic of completor (with auto_trigger off) a little frustrating. If I got it right from reading code CompletorEnable really comes to calling s:set_events() function which is calling s:on_text_change() and s:on_insert_char_pre().

The completion works only after typing some word (for example let) but if you move cursor to another line and put it on exact same let no completion happens. This is counterintuitive and frustrating. If completor is enabled it should trigger always and have the same efffect on identical words.

And now embarrasing question. What would g:completor_text_omni_trigger regex look like? I couldn't figure that out for thesaurus completion in plain text or markdown.

from completor.vim.

maralla avatar maralla commented on July 24, 2024

Why completefunc turns out empty so often? Isn't it populated too late?

Currently the completion status is tracked from the last completion triggered by inputting some chars. If the cursor moved to a different location with the same completion prefix the status will not change if no char inputted so completion menu may not popup at the right place. So the completion result is cleared after every completion.

How do you insert snippets from Ultisnips? I see them on the list but using <Tab> or <Ctrl-Y> or <CR> doesn't do anything. So I use Ultisnips shortcut instead but is it the right way to go?

The snippets on the completion list are only a reminder to show that there are some utilsnips here. It should be triggered using Ultisnips shortcut.

And now embarrasing question. What would g:completor_text_omni_trigger regex look like? I couldn't figure that out for thesaurus completion in plain text or markdown.

dictionary and thesaurus completions are not supported by completor currently. But you can use vim builtin completions.

from completor.vim.

Related Issues (20)

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.