How to retain i_CTRL+p i_CTRL+n and use them to select a completion option #2149
cskeeters
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just wanted to share two options that allow a user to use this plugin and keep the builtin
i_CTRL+pandi_CTRL+n(which I can't live without) and doesn't resort to the arrow keys.Considering I often want to retype keywords or variable names that are close to the cursor, I find the old functionality provided by
i_CTRL+pand sometimesi_CTRL+nmore useful for producing code quickly than LSP assisted autocompletion, especially when I'm familiar with the code base. It's like a CPU L1 cache hit as what you're looking for is likely on the previous line. It's the fastest because you typically only need to type one or two letters before triggering the completion accurately and little to no visual scanning is involved. However, LSP assisted autocompletion is cool and useful when you're referencing functions in other files, or language builtins when your working in a language your not used to. Turns out you can and I will document two ways that I like.One way to do this is by using the
super-tabpreset and removing the<C-p>and<C-n>key bindings. Also, if my cursor is at the end of the bottom of the screen, I don't like it when the menu covers the text in the lines above it as that henders my ability to scan quickly to determine the number of characters I may need to type before triggeringi_CTRL+p. This does both.Note
This is not a complete working config. It's only a skeleton to show the relevant options.
Trying this, it doesn't strike me as that bad.
<C-e><Tab>can be used to input indentation. However, according to @tjdevries "you are wrong to use anything other than the default" 😄. So I have this other solution that uses thedefaultpreset.It hides the popup menu by default, which keeps the hover window out of the way if you're glancing to look at what variables might conflict with standard
i_CTRL+pwhich I like, and it enablesghost_textwhich is good enough for some cases and lets me know that there are options to view. Without the menu open,i_CTRL+pandi_CTRL+nwork normally. Once you hit<C-Space>, the menu opens and<C-n>and<C-p>change the selection in the menu.Beta Was this translation helpful? Give feedback.
All reactions