VSCodeVim: How do I get CTRL+P / CTRL+N non-IntelliSense completion identical to how it works in VIM?
Asked Answered
N

0

21

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
    }
Ningpo answered 21/5, 2021 at 12:43 Comment(4)
You can try and open a new issue in VSCodeVim's github repo and see if anyone there will be able to help.Makalu
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.Jerrold
Check out github.com/rahulsenna/vscode-hippie-completion which is similar, but not perfect.Pyrochemical
@huyz: Thanks for the hint. What could be better?Jerrold

© 2022 - 2024 — McMap. All rights reserved.