GithubHelp home page GithubHelp logo

Comments (2)

ervandew avatar ervandew commented on August 26, 2024

Unless I'm miss understanding you, this works as intended. When using <c-p> or <c-n> to start insert completion, both populate the completion popup with the same list of words in the same order, the only difference is that <c-p> highlights the nearest matching word located above the current cursor position, which is the result at the bottom of the completion popup. Without supertab installed, continuing to hit <c-p> will walk up the list to next nearest word above the cursor. I think Bram chose to display the results like this so that a) the completion logic is the same for <c-n> and <c-p>, only the first entry to highlight differs, b) so that the behavior of <c-p> mode is consistent, always moving up the list and c) when starting <c-p> mode you don't have to switch over to using <c-n> to get the next nearest entry, just continue to hit <c-p>.

So, with supertab I wanted to preserve the same behavior. If <c-p> is your default completion method, then <tab> will start it and additional <tab>s will move up the list instead of down so that you don't have to suddenly switch to using <s-tab> to get the next nearest result.

from supertab.

unphased avatar unphased commented on August 26, 2024

Hi @ervandew. I appreciate your explanation (just like you also explained in the Readme). I believe I understand this fully, but I am not 100% sure.

So perhaps my question might really technically be for Bram, but I am hopeful that you know whether it is possible to configure things to my liking. I'm also hopeful that my preference might be shared by others.

  1. The behavior of first highlighting the matching item in the buffer before/above the cursor is absolutely a great default. I had been using supertab for a bit and this basic heuristic appears to account for a lot of its magic! It is such a simple trick to start from the bottom by default, it picks a better starting point almost always. I'd never have thought to try that, so thanks for making this the default for supertab.

I'm used to using other completion plugins, and supertab is the most "low level" one that I have used yet. There is no way I would put up with typing anything more than one tab keystroke (such as two consecutive chords, which I understand is needed for not using a completion plugin?) to prompt completion. Usually I'd prefer the behavior from some completers such as auto-displaying it as you type, but I am definitely taking a liking to the "speak when you're told" demeanor now. Sorry, I digress.

  1. Many of us are understandably pretty used to the completion menu focus starting at the top and moving downward. I have no intrinsic problem with the upward motion, it is different from what i'm used to, but the main usability "problem" if you will is that the point of focus on the screen jumps an inconsistent amount of lines lower on the screen when the completion menu is invoked. The solution to this would be to make all of the behavior exactly the same but reverse the display of the menu. I understand that this is entirely outside of the purview of Supertab, but do you know if configuration exists in vim (or neovim, which, ironically i use with supertab only with nvim, i use coc.nvim when running vim and it handles completion for me) to reverse the results, putting the nearest match above the cursor on the TOP of the menu instead of the bottom? There is a certain elegance to the order of the results matching the scan order of those results... so I also wonder, if reversal of the list isn't possible, then what about displaying that menu ABOVE the cursor instead of below it!?

  2. This is actually off-topic, but I couldn't help myself from adding this question in, even though I know the answer... I really like the minimalism of this plugin but I just wish I could type the initial letters of a symbol and have it prioritize picking it. e.g. my_var_name can get sorted first when I type mvn<tab>. I know this is sort of the purview of a fuzzy completer, which this is not. But having a few simple but highly useful heuristics is a lot less complex compared to full-out fuzzy (which is more of an engine than just a few heuristics). Yes the answer is use a fancier completer plugin. Maybe there's ways with omnicomplete? I don't know much about how the omni thing works yet.

Thanks!

from supertab.

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.