David-Kunz / gen.nvim

Neovim plugin to generate text using LLMs with customizable prompts
The Unlicense
977 stars 62 forks source link

[Question] Access the whole buffer/file content #93

Open muhammad-saleh opened 2 months ago

muhammad-saleh commented 2 months ago

I want to improve the suggestions that I get by providing the current open buffer code to the model, in a hope that the model will have more context and hence provide better suggestions.

How can I do that in a custom prompt? I only see $register but it's for yanked text and not the whole buffer.

David-Kunz commented 1 month ago

Hi @muhammad-saleh , you can highlight the whole buffer (ggVG) and then invoke gen.nvim, or you can invoke it with :%Gen, would that be enough?

muhammad-saleh commented 1 month ago

@David-Kunz It would be great if this happens automatically in the background.