A readme explaining how to make neovim work fast
improved ai docstring command
3 files changed, +30 -1
+1-1lazy-lock.json
| @@ -17,6 +17,7 @@ | ||
| 17 | 17 | "friendly-snippets": { "branch": "main", "commit": "fc8f183479a472df60aa86f00e295462f2308178" }, |
| 18 | 18 | "gitsigns.nvim": { "branch": "main", "commit": "ee7e50dfbdf49e3acfa416fd3ad3abbdb658582c" }, |
| 19 | 19 | "grug-far.nvim": { "branch": "main", "commit": "631331f9c6611b1a47e887f50b92b7cf450f51e7" }, |
| 20 | + "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, | |
| 20 | 21 | "hydra.nvim": { "branch": "main", "commit": "f3d4822060376cb253d4cc0d5af2c272c28de2a7" }, |
| 21 | 22 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, |
| 22 | 23 | "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, |
| @@ -50,7 +51,6 @@ | ||
| 50 | 51 | "trouble.nvim": { "branch": "main", "commit": "85bedb7eb7fa331a2ccbecb9202d8abba64d37b3" }, |
| 51 | 52 | "ts-comments.nvim": { "branch": "main", "commit": "1bd9d0ba1d8b336c3db50692ffd0955fe1bb9f0c" }, |
| 52 | 53 | "venv-selector.nvim": { "branch": "regexp", "commit": "c677caa1030808a9f90092e522de7cc20c1390dd" }, |
| 53 | - "vim-anyfold": { "branch": "master", "commit": "3ed5d8ccbf0f5031f7c7d2be05aa7ddb4550dc5c" }, | |
| 54 | 54 | "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }, |
| 55 | 55 | "yanky.nvim": { "branch": "main", "commit": "04775cc6e10ef038c397c407bc17f00a2f52b378" } |
| 56 | 56 | } |
+1-0lazyvim.json
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | "lazyvim.plugins.extras.ai.copilot-chat", |
| 5 | 5 | "lazyvim.plugins.extras.coding.luasnip", |
| 6 | 6 | "lazyvim.plugins.extras.coding.yanky", |
| 7 | + "lazyvim.plugins.extras.editor.harpoon2", | |
| 7 | 8 | "lazyvim.plugins.extras.editor.neo-tree", |
| 8 | 9 | "lazyvim.plugins.extras.editor.telescope", |
| 9 | 10 | "lazyvim.plugins.extras.lang.git", |
+28-0lua/plugins/copilot.lua
| @@ -23,6 +23,7 @@ return { | ||
| 23 | 23 | }, |
| 24 | 24 | }, |
| 25 | 25 | }, |
| 26 | + | |
| 26 | 27 | -- chat config |
| 27 | 28 | { |
| 28 | 29 | "CopilotC-Nvim/CopilotChat.nvim", |
| @@ -32,6 +33,13 @@ return { | ||
| 32 | 33 | local user = vim.env.USER or "User" |
| 33 | 34 | user = user:sub(1, 1):upper() .. user:sub(2) |
| 34 | 35 | return { |
| 36 | + prompts = { | |
| 37 | + Docs = { | |
| 38 | + prompt = "Add docstrings that clearly explain parameters and returns with the correct format.", | |
| 39 | + system = "You write good docs.", | |
| 40 | + description = "Add structured, language-aware documentation", | |
| 41 | + }, | |
| 42 | + }, | |
| 35 | 43 | auto_insert_mode = true, |
| 36 | 44 | question_header = " " .. user .. " ", |
| 37 | 45 | answer_header = " Copilot ", |
| @@ -44,6 +52,18 @@ return { | ||
| 44 | 52 | keys = { |
| 45 | 53 | { "<c-s>", "<CR>", ft = "copilot-chat", desc = "Submit Prompt", remap = true }, |
| 46 | 54 | { "<leader>a", "", desc = "+ai", mode = { "n", "v" } }, |
| 55 | + { | |
| 56 | + "<leader>ad", | |
| 57 | + function() | |
| 58 | + local cpc = require("CopilotChat") | |
| 59 | + vim.cmd("normal vaf") | |
| 60 | + cpc.ask( | |
| 61 | + "Add docstrings that clearly explain parameters and returns with the correct indentations using tabs and newlines." | |
| 62 | + ) | |
| 63 | + end, | |
| 64 | + desc = "Add docs to function", | |
| 65 | + mode = "n", | |
| 66 | + }, | |
| 47 | 67 | { |
| 48 | 68 | "<leader>aa", |
| 49 | 69 | function() |
| @@ -82,6 +102,14 @@ return { | ||
| 82 | 102 | desc = "Prompt Actions (CopilotChat)", |
| 83 | 103 | mode = { "n", "v" }, |
| 84 | 104 | }, |
| 105 | + { | |
| 106 | + "<C-a>", | |
| 107 | + "<Esc><C-y>q", | |
| 108 | + ft = "copilot-chat", | |
| 109 | + desc = "Submit and close", | |
| 110 | + mode = { "n", "i" }, | |
| 111 | + remap = true, | |
| 112 | + }, | |
| 85 | 113 | }, |
| 86 | 114 | config = function(_, opts) |
| 87 | 115 | vim.env.OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") |