From be00da9268e11cbbaf45a24511ee21f77bd2536a Mon Sep 17 00:00:00 2001 From: don philipe Date: Wed, 19 Feb 2025 11:21:28 +0100 Subject: [PATCH] Custom nvim gen command adding https schema --- .config/nvim/lua/plugins/gen.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.config/nvim/lua/plugins/gen.lua b/.config/nvim/lua/plugins/gen.lua index 393eff1..eb799b6 100644 --- a/.config/nvim/lua/plugins/gen.lua +++ b/.config/nvim/lua/plugins/gen.lua @@ -9,5 +9,18 @@ return { model = vars["model"], host = vars["host"], port = vars["port"], + https = vars["https"], + show_prompt = true, + debug = false, + + -- https://github.com/David-Kunz/gen.nvim/issues/116 + command = function(options) + local body = { model = options.model, stream = true } + local schema = "http" + if options.https then + schema = "https" + end + return "curl --silent --no-buffer -X POST " .. schema .. "://" .. options.host .. ":" .. options.port .. "/api/chat -d $body" + end, }}, }