Skip to content

Commit

Permalink
feat(chatgpt-nvim): add which-key mappings below <leader>G
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Jun 18, 2024
1 parent 59caac5 commit ec3addf
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lua/astrocommunity/editing-support/chatgpt-nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,36 @@ return {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
{
"AstroNvim/astrocore",
opts = {
mappings = {
n = {
-- G like GPT
["<Leader>G"] = {
name = "🤖ChatGPT",
c = { "<cmd>ChatGPT<CR>", "ChatGPT" },
e = { "<cmd>ChatGPTEditWithInstruction<CR>", "Edit with instruction", mode = { "n", "v" } },
g = { "<cmd>ChatGPTRun grammar_correction<CR>", "Grammar Correction", mode = { "n", "v" } },
t = { "<cmd>ChatGPTRun translate<CR>", "Translate", mode = { "n", "v" } },
k = { "<cmd>ChatGPTRun keywords<CR>", "Keywords", mode = { "n", "v" } },
d = { "<cmd>ChatGPTRun docstring<CR>", "Docstring", mode = { "n", "v" } },
a = { "<cmd>ChatGPTRun add_tests<CR>", "Add Tests", mode = { "n", "v" } },
o = { "<cmd>ChatGPTRun optimize_code<CR>", "Optimize Code", mode = { "n", "v" } },
s = { "<cmd>ChatGPTRun summarize<CR>", "Summarize", mode = { "n", "v" } },
f = { "<cmd>ChatGPTRun fix_bugs<CR>", "Fix Bugs", mode = { "n", "v" } },
x = { "<cmd>ChatGPTRun explain_code<CR>", "Explain Code", mode = { "n", "v" } },
r = { "<cmd>ChatGPTRun roxygen_edit<CR>", "Roxygen Edit", mode = { "n", "v" } },
l = {
"<cmd>ChatGPTRun code_readability_analysis<CR>",
"Code Readability Analysis",
mode = { "n", "v" },
},
},
},
},
},
},
},
opts = {},
}

0 comments on commit ec3addf

Please sign in to comment.