Skip to content

Commit

Permalink
feat(neovim): use wtf.nvim
Browse files Browse the repository at this point in the history
  • Loading branch information
olimorris committed Dec 11, 2023
1 parent 2b1e0a1 commit ac902ae
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .config/nvim/lua/plugins/heirline/statusline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,14 @@ local Session = {
},
}

local Wtf = {
condition = function()
return vim.g.wtf_working == true
end,
provider = "󰚩 ",
hl = { fg = "gray" },
}

local Overseer = {
condition = function()
local ok, _ = require("overseer")
Expand Down Expand Up @@ -665,6 +673,7 @@ return {
LspAttached,
-- LspDiagnostics,
{ provider = "%=" },
Wtf,
Overseer,
Dap,
Lazy,
Expand Down
39 changes: 37 additions & 2 deletions .config/nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,48 @@ return {
event = "LspAttach",
opts = {
enable = function()
return vim.bo.filetype ~= "lazy"
return vim.bo.filetype ~= "lazy" and vim.bo.filetype ~= "query"
end,
format = function(diag)
return "" .. diag.message
end,
scope = "line",
toggle_event = { "InsertEnter" },
},
},
{
"piersolenski/wtf.nvim",
dependencies = {
"MunifTanjim/nui.nvim",
},
opts = {
openai_model_id = "gpt-3.5-turbo",
popup_type = "horizontal",
hooks = {
request_started = function()
vim.g.wtf_working = true
end,
request_finished = function()
vim.g.wtf_working = nil
end,
},
},
keys = {
{
"gw",
mode = { "n", "x" },
function()
require("wtf").ai()
end,
desc = "Debug diagnostic with AI",
},
{
mode = { "n" },
"gW",
function()
require("wtf").search()
end,
desc = "Search diagnostic with Google",
},
},
},
{
Expand Down

0 comments on commit ac902ae

Please sign in to comment.