Note that there are some explanatory texts on larger screens.

plurals
  1. POWord / Code Completion in VIM
    text
    copied!<p>I know that I can get word completion through <code>CTRL+N</code> &amp; <code>CTRL+P</code> and code completion through omnifunc with <code>CTRL+X</code> <code>CTRL+O</code>. I additionally tried <a href="http://www.vim.org/scripts/script.php?script_id=1643" rel="noreferrer"><strong>Supertab</strong></a> (very nice), because I'm used to TAB-completion. That all worked all right. I would like to see possible matches while I'm typing, so I also tried <a href="http://www.vim.org/scripts/script.php?script_id=1879" rel="noreferrer">autocomplpop.vim</a>, witch does just that.</p> <p>What I like to accomplish though, would be a combination of both together with a little twist: I would like to see suggestions pop up as I type (just like with <code>autocompop</code>) but when I use <code>TAB</code> <em>the word should be expanded <strong>only</strong> to the largest common match</em>:</p> <pre><code>foo bar testor booze test baz teter te&lt;TAB&gt; </code></pre> <p>After I type <code>te</code> in the 2nd line, the popup should suggest <code>test</code>, <code>teter</code> and <code>testor</code>.</p> <p>When I press <code>TAB</code>, it should do nothing, because there is no more common ground than <code>te</code>. After I typed an additional <code>s</code> and press <code>TAB</code>, it should expand <code>tes</code> to <code>test</code> (because it is the smallest common ground) and to <code>testor</code> after a 2nd <code>TAB</code>.</p> <p><strong>Edit</strong>: I try to be more clear...</p> <ul> <li><strong><code>te&lt;TAB&gt;</code></strong> <ul> <li>should do nothing because "we" don't know if a 't' (te<em>t</em>er) or an 's' (te<em>s</em>t, te<em>s</em>tor) should follow. </li> </ul></li> <li><strong><code>tes&lt;TAB&gt;</code></strong> <ul> <li>should expand to <code>test</code> (because that works for both - test and testor - and teter is no longer a possible match). </li> </ul></li> <li><strong><code>test&lt;TAB&gt;</code></strong> <ul> <li>should expand to <code>testor</code> (only possible match).</li> </ul></li> </ul> <p>Well, the suggestions popup is just bonus, but I really would love to see the <code>TAB</code> behavior. Hope I don't get to esoteric here and you can help me out with some script-tricks or plugins to tame VIM to do just that.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload