frankroeder / parrot.nvim

parrot.nvim 🦜 - the plugin that brings stochastic parrots to Neovim. This is a gp.nvim-fork focused on simplicity.
Other
219 stars 14 forks source link

Feature: add template placeholder to add content of all open files #37

Closed frankroeder closed 1 month ago

frankroeder commented 1 month ago

This branch implements the feature to include the content of all open buffers in templates using the placeholder {{multifileconent}}.

An example would be the following hook:

CompleteMultiContext = function(prt, params)
  local template = [[
    I have the following code from {{filename}} and other realted files:

      ```{{filetype}}
      {{multifilecontent}}
  Please look at the following section specifically:
  ```{{filetype}}
  {{selection}}
  ```

  Please finish the code above carefully and logically.
  Respond just with the snippet of code that should be inserted."
]]
local agent = prt.get_command_agent()
prt.Prompt(params, prt.ui.Target.append, agent, nil, template)

end



A pending feature included in this branch is the option to select buffers via fzf-lua.