hrsh7th / nvim-compe

Auto completion Lua plugin for nvim
MIT License
1.28k stars 54 forks source link

Inline suggestiong like fish shell #472

Closed IndianBoy42 closed 2 years ago

IndianBoy42 commented 3 years ago

Is your feature request related to a problem? Please describe.

Not a problem just a suggestion based on a autocomplete visual style I like from fish shell

Describe the solution you'd like

Fish shell implements a kind of 'inline' suggestions, wherein the first completion is showed as dull text after the cursor, the user can hit to get that completion, and then hit it again to get the full list.

I think something similar to the first part could be implemented using virtual text from neovim. Plus some configuration and keymaps to choose when to expand the full completion list, when to accept the first suggestion, when to cycle completion in virtual without opening the completion list, etc

Describe alternatives you've considered

The current completion popup window works fine, and should be the default for parity with other IDE, but this behaviour could be a more sleek and less visually disruptive way of presenting autocompletions for some people

Additional context

An example from the fish shell website image

hrsh7th commented 3 years ago

It's interesting.

I have some random questions about it.

  1. should it work if the cursor on the middle of the line?
  2. should it work with completion pum or exclusive?
  3. how to confirm the suggestion? (CR or Tab or both? some cases it will be annoying)
IndianBoy42 commented 3 years ago
  1. I think yes, although then the question is can/should we push the remaining text to the side or overlap. The former feels better to me

  2. I think it can be with both or exclusive. An option could be the pum only comes up when you ask for it but the inline hint is immediately available

  3. I guess it would be configurable but either TAB, or feel like reasonable keys. Fish uses , vscode uses tab

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: hrsh7th @.> Sent: Wednesday, July 14, 2021 2:20:08 PM To: hrsh7th/nvim-compe @.> Cc: Anshuman MEDHI @.>; Author @.> Subject: Re: [hrsh7th/nvim-compe] Inline suggestiong like fish shell (#472)

It's interesting.

I have some random questions about it.

  1. should it work if the cursor on the middle of the line?
  2. should it work with completion pum or exclusive?
  3. how to confirm the suggestion? (CR or Tab or both? some cases it will be annoying)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fhrsh7th%2Fnvim-compe%2Fissues%2F472%23issuecomment-879625160&data=04%7C01%7Camedhi%40connect.ust.hk%7C92d0768adf9b4ac73a1a08d9468f6f1e%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637618404130086759%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=JsVy3TOpJnKMuW3N4opNDK3K1r%2Bp0I2XWqBmcjM2pLE%3D&reserved=0, or unsubscribehttps://apc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABNUNQJOB5FILVLSVIAM7TDTXUUBRANCNFSM5AINICBQ&data=04%7C01%7Camedhi%40connect.ust.hk%7C92d0768adf9b4ac73a1a08d9468f6f1e%7C6c1d415239d044ca88d9b8d6ddca0708%7C1%7C0%7C637618404130096717%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=4K4CRiQ789i28Qs1Hd0xWRyF4tVcW6NEWsl8l3eNK4I%3D&reserved=0.

hrsh7th commented 3 years ago

I will investigate what VSCode does about it. I think the GitHub Copilot is a good reference implementation.

hrsh7th commented 3 years ago

VSCode has GhostText feature. It seems to different from completion.

FOSSilizedDaemon commented 3 years ago

I would also love this.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Shougo commented 3 years ago

The feature is already implemented in nvim-cmp. So it should be closed.

IndianBoy42 commented 3 years ago

Where can I find it in documentation?

hrsh7th commented 3 years ago

@IndianBoy42 You can use https://github.com/hrsh7th/nvim-cmp#experimentalghost_text-type-boolean

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.