GithubHelp home page GithubHelp logo

Comments (15)

vifon avatar vifon commented on June 4, 2024

It should be possible with a new completer.
A quick and dirty solution: make a copy of the suffix-complete completer (these lines), rename it and set $char_class_before to \s instead of \S. Then use your new completer. You might want to experiment with various sets of options but I've tested this one just now and it worked.

Tell me if you need further assistance or if I may close the issue (or close it yourself).

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

Thanks! Um but it doesn't work if there are spaces between completion candidates. Can I make fuzzy-complete to have such eager behavior?

from autocomplete-all-the-things.

vifon avatar vifon commented on June 4, 2024

Yes, it should work with fuzzy-complete too but I didn't check it. It might be tricky to find the right combination of regexps that won't be too greedy.

What I usually do is abort the completion and add another occurrence of the last part I typed, i.e. /po becomes /popo.

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

ah, good point. I'll use that trick 😄 . Thanks! BTW, can I have empty string trigger completions for every space separated items? Use case pdfcrop /path/to/file /path/to/file . After typing the first path entry, I'd like to auto complete the second one using just one call of fuzzy-complete without any inputs.

from autocomplete-all-the-things.

vifon avatar vifon commented on June 4, 2024

You would need some special character to mark where to stop searching for the text supplied by the user. The completion needs to know what to consider an input. 'fuzzy-complete' takes all characters before the cursor matching \S (all non-whitespace characters), fuzzy-word-complete uses [-\w] (every "word character" and additionally a hyphen). In your case we would need to also read the whitespace characters but then we have no character to stop at unless we add one artificially, for example you could add a dollar sign before your input and then probably remove it manually. In general, $char_class_to_complete is the variable you'd need to tinker with.

I hope to rewrite this plugin at some point to make such modifications easier but it's tough to estimate when I'll have the time to do so.

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

'fuzzy-complete' takes all characters before the cursor matching \S (all non-whitespace characters)

Can we just have a special case for empty inputs?

from autocomplete-all-the-things.

blueyed avatar blueyed commented on June 4, 2024

@amosbird
btw: you can also use pdfcrop /path/to/file{,.new} directly.

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

@blueyed thanks. Um i meant to do in place cropping.

from autocomplete-all-the-things.

blueyed avatar blueyed commented on June 4, 2024

Then pdfcrop /path/to/file{,}, or pdfcrop /path/to/file !#$.. ;) - but enough for the offtopic.

from autocomplete-all-the-things.

vifon avatar vifon commented on June 4, 2024

@amosbird What do you mean by empty inputs?

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

I mean that all characters before the cursor matching \S is empty

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

It's like if I input nothing and start triggering completion, it should match something like ".*"

from autocomplete-all-the-things.

vifon avatar vifon commented on June 4, 2024

What should it complete in such case? Every single whole line?

from autocomplete-all-the-things.

amosbird avatar amosbird commented on June 4, 2024

no, every single items separated by spaces

from autocomplete-all-the-things.

vifon avatar vifon commented on June 4, 2024

Hm, I like this idea. I'll keep it in mind when rewriting the plugin.

from autocomplete-all-the-things.

Related Issues (17)

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.