I describe this as Fish-like as it is referenced as such by zsh-autocomplete, and I would define it as follows:

The appearance of a (temporary) automatically inserted completion match, that is highlighted in greyscale. Only when accepting the match the cursor position would be affected and normal highlight groups would be applied.

I think this concept of "phantom text" would be a nice extension to the naitive completion options. It would be a means for (future multi-line) completions to be inserted when selected from the menu, without moving the cursor or changing the view state of the window, depending on other completion options. I think this is doable with the asynchronicity these days.

Do you know if there have been efforts made to do this? Do you this is useful?

  • Just FYI, the "fish" that is being referred to in the zsh-autocomplete repo is the friendly interactive shell.
    – Rich
    Commented Jan 16, 2018 at 15:06
  • vim can already place the text during selection. I think your question then is simply to change the highlighting and to not move the cursor?
    – Mass
    Commented Jan 16, 2018 at 16:40
  • @Mass yes. :keepjumps, :noautocmd and :doautocmd could probably be used here. But with multiline completions in the making, the insertion should not affect scrolling or folds. Additionally the undotree should not be affected. I'm not sure how this would affect completion plugins. In fact, I'm not sure what's desirable overall.
    – Bart
    Commented Jan 16, 2018 at 17:50
  • Hi @Bart did you find a solution for this? This would be very useful.
    – lf_araujo
    Commented Jan 29, 2021 at 11:08
  • @lf_araujo I use neovim these days, and I think this could be done with floating windows in stead. At the moment, I'm not so interested, but I'll think about this when I figured out how to combine language servers with native completion methods properly. Lua plugin development got more attention since vimconf, and I think more goodness will be parallel-ized soon.
    – Bart
    Commented Jan 31, 2021 at 16:29


Your Answer

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

Browse other questions tagged or ask your own question.