19

The main thing missing in my VSCodeVim setup is Ctrl + P and Ctrl + N simple word completion when in insert mode. I have googled extensively on how to set this up, but found nothing that works the way I expect when the ms-vscode.cpptools extension is enabled.

I do not want IntelliSense to interfere with this completion, I just want simple word completion that works in any context (e.g., comments, strings, etc). Here is an example:

int a_very_long_variable_name;

// a_ve

When I've typed a_ve in the comment, Ctrl + P should suggest a_very_long_variable_name (as well as any other word in the document starting with a_ve). Ctrl + N should do the same, except that suggestions should be ordered differently compared to Ctrl + P because Ctrl + N starts looking for matching words after the cursor, not before it.

Is it possible to get this behavior in VSCode with VSCodeVim? When ms-vscode.cpptools is enabled, I do not get suggestions at all when editing comments, not even when I have this in my settings:

    "editor.quickSuggestions": {
        "comments": true
    }
Arnav Thorat
  • 3,078
  • 3
  • 8
  • 33
Bob Builder
  • 393
  • 2
  • 6
  • You can try and open a new issue in VSCodeVim's github repo and see if anyone there will be able to help. – SunnyMonster May 08 '22 at 06:16
  • You could look for "Word Based Suggestions" in the settings. `{"editor.wordBasedSuggestionsMode":"allDocuments","[cpp]":{"editor.wordBasedSuggestions":true},"[c]":{"editor.wordBasedSuggestions":true}}` It should at the very least allow you to autocomplete a_very_long_variable_name in strings or comments. I'd still like a way to separate Intellisense completion (Ctrl+space) and Word based completion (Ctrl+P), though. So your question is still valid. – Eric Duminil Feb 13 '23 at 19:19
  • 2
    Check out https://github.com/rahulsenna/vscode-hippie-completion which is similar, but not perfect. – huyz Feb 15 '23 at 05:09
  • @huyz: Thanks for the hint. What could be better? – Eric Duminil Feb 15 '23 at 12:12

0 Answers0