0

I have looked for similar questions but I was quite surprised to not find anything similar... either I am the first person on this planet to have this issue, or I have searched using bad keywords.

Anyway, I use vim's autocomplete function (<C-n>) a lot to write python scripts. However, in the list of suggested words, there are also words that I previously used in comments, for example:

huge list of suggestion

here, many words suggested by vim (e.g. polymorphism, please, possible, etc.) are part of comments. In this way, the list of suggestions becomes very quickly long and confusing. I would like to remove from the list of suggestions words that were previusly typed in comments, and only keep the other ones. How can I achieve this?

4
  • No, there is no way to do that unless you write your own completion function.
    – romainl
    Commented Jan 9, 2023 at 16:02
  • Thanks for your comment @romainl. So how do people do? They just accept a kilometric list of suggested words?
    – Tropilio
    Commented Jan 9, 2023 at 16:20
  • 1
    I don't know what people do, but I never trigger completion after one letter, precisely because it would be a largely irrelevant mess. Two or three characters is a good rule of thumb, IMO. I am not sure what, exactly, you wanted to complete in your screenshot (you didn't mention it) but pressing <C-n> would give you 3 suggestions after ph, 10 after pr, 2 after po, etc. which is a lot more manageable than the potential 26*x suggestions you would get after p. Note that starting completion after a few letter is a very common UX pattern for the same reason.
    – romainl
    Commented Jan 9, 2023 at 17:18
  • 1
    Alternatively, you could switch to a smarter completion method that only suggests the members of the specific object you are interested in, but that's a matter for a Google session, not for this question/comment thread.
    – romainl
    Commented Jan 9, 2023 at 17:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.