Closed lucobellic closed 5 months ago
@lucobellic hey, option chat_prompt_buf_type = true/false,
is now available in the latest version.
Haven't touched the number/spell/diagnostic. At least numbering is still worth keeping even with prompt buffer (jumping around in normal/visual mode in order to copy something).
Hello,
Is it possible to add an option to set the chat
buftype
toprompt
?Currently, I am setting it using
ftplugin
, and I find it to be a more natural way to interact with the chatbot. This is especially helpful for directly moving to the last line when entering insert mode and triggeringGpChatRespond
upon pressing Enter.example with ftplugin/markdown.lua
```lua local buf = vim.api.nvim_get_current_buf() local win = vim.api.nvim_get_current_win() if require('util.util').is_gp_file(vim.api.nvim_buf_get_name(buf)) then vim.api.nvim_set_option_value('number', false, { win = win }) vim.api.nvim_set_option_value('spell', false, { win = win }) vim.diagnostic.disable(buf) vim.api.nvim_set_option_value('buftype', 'prompt', { buf = buf }) vim.fn.prompt_setcallback(buf, function() vim.api.nvim_command('GpChatRespond') end) vim.fn.prompt_setprompt(buf, '') end ```
I have reviewed the code and documentation but couldn't find this feature. My apologies if the feature already exists.
Edit: corrected code snippet