diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 6eab28e..ab232c1 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,23 +1,21 @@ { "LazyVim": { "branch": "main", "commit": "3f034d0a7f58031123300309f2efd3bb0356ee21" }, - "VectorCode": { "branch": "main", "commit": "1056b434a6396b31e96e4100e1e8b5ad31559b18" }, - "avante.nvim": { "branch": "main", "commit": "89a86f0fc197ec9ffb3663a499432f8df4e4b1e5" }, + "avante.nvim": { "branch": "main", "commit": "d76a158b61fc818a5af7b440b6b397f595021686" }, "blink-cmp-copilot": { "branch": "main", "commit": "439cff78780c033aa23cf061d7315314b347e3c1" }, - "blink.cmp": { "branch": "main", "commit": "49f211fe5d729df53df4c042d7c3464cf47d199e" }, + "blink-copilot": { "branch": "main", "commit": "71102fe2fa1616353f8cb315bb8b85db0812a218" }, + "blink.cmp": { "branch": "main", "commit": "cb5e346d9e0efa7a3eee7fd4da0b690c48d2a98e" }, "bookmarks.nvim": { "branch": "main", "commit": "0540d52ba64d0ec7677ec1ef14b3624c95a2aaba" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "5b5e3aef9ad7af84f463d17b5479f06b87d5c429" }, - "conform.nvim": { "branch": "master", "commit": "b1a75324ddf96b7bb84963a297b1ed334db087c0" }, - "copilot.lua": { "branch": "master", "commit": "d661d65b4cab20a5c164f6d9081d91ed324fe4d8" }, + "conform.nvim": { "branch": "master", "commit": "eebc724d12c5579d733d1f801386e0ceb909d001" }, + "copilot.lua": { "branch": "master", "commit": "d92ef312b853f5a8b219683f01c95ae86749da7f" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, "flit.nvim": { "branch": "main", "commit": "1ef72de6a02458d31b10039372c8a15ab8989e0d" }, "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "fzf-lua": { "branch": "main", "commit": "6488ada2f376e47789391dc353b6d91a3f9de6f6" }, - "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, + "fzf-lua": { "branch": "main", "commit": "98fb51f2820ead2f8e3c37a7071d7a113b07e2c1" }, "gp.nvim": { "branch": "main", "commit": "2372d5323c6feaa2e9c19f7ccb537c615d878e18" }, - "grug-far.nvim": { "branch": "main", "commit": "9411a99390014231753bbb7a2afe6886fda99257" }, + "grug-far.nvim": { "branch": "main", "commit": "6ef402861468c6bd987155be17a34ba4291dc1d0" }, "harpoon": { "branch": "harpoon2", "commit": "ed1f853847ffd04b2b61c314865665e1dadf22c7" }, "img-clip.nvim": { "branch": "main", "commit": "08a02e14c8c0d42fa7a92c30a98fd04d6993b35d" }, "inc-rename.nvim": { "branch": "main", "commit": "87ebe7bee0b83d3b6e4f1494c74abed21b318175" }, @@ -25,42 +23,41 @@ "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" }, "leap.nvim": { "branch": "main", "commit": "346a16ef942635a8ca5ff92e603d07e7e8be6cbe" }, - "lualine.nvim": { "branch": "master", "commit": "1517caa8fff05e4b4999857319d3b0609a7f57fa" }, + "lualine.nvim": { "branch": "master", "commit": "834a5817f7e2be22a7062620032d49c600c35fab" }, "luarocks.nvim": { "branch": "main", "commit": "1db9093915eb16ba2473cfb8d343ace5ee04130a" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "1a31f824b9cd5bc6f342fc29e9a53b60d74af245" }, "mason.nvim": { "branch": "main", "commit": "fc98833b6da5de5a9c5b1446ac541577059555be" }, "mini.ai": { "branch": "main", "commit": "e139eb1101beb0250fea322f8c07a42f0f175688" }, "mini.comment": { "branch": "main", "commit": "fb867a9246f9b892cf51a8c84a3f8479cdf1558c" }, - "mini.diff": { "branch": "main", "commit": "06c9fe0e33fbcf41202793550b905d7431dc81fc" }, + "mini.diff": { "branch": "main", "commit": "7e268d0241255abaa07b8aa0ddff028f7315fe21" }, "mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" }, "mini.indentscope": { "branch": "main", "commit": "8af2569a7d7fd37300dfa760e44e71efbbf322fd" }, "mini.move": { "branch": "main", "commit": "4fe4a855fee53c66b0f3255a4b54ddc2ae6b308c" }, "mini.pairs": { "branch": "main", "commit": "69864a2efb36c030877421634487fd90db1e4298" }, "mini.pick": { "branch": "main", "commit": "f95dc0bb9db7124f55b225f544a8719476c64314" }, "mini.surround": { "branch": "main", "commit": "5aab42fcdcf31fa010f012771eda5631c077840a" }, - "minuet-ai.nvim": { "branch": "main", "commit": "feb2ebdff2bae262e400369bad8358b013636d2c" }, - "neo-tree.nvim": { "branch": "main", "commit": "69f798bf9493b84df660ac3c6b2fc03e23956d25" }, + "neo-tree.nvim": { "branch": "main", "commit": "73d63376352ac731379892e27ac7b3d9449148e3" }, "nightfox.nvim": { "branch": "main", "commit": "ba47d4b4c5ec308718641ba7402c143836f35aa9" }, "noice.nvim": { "branch": "main", "commit": "0427460c2d7f673ad60eb02b35f5e9926cf67c59" }, "note.nvim": { "branch": "main", "commit": "7b1089ef0b6f31daa6dc125e4f4d5b27d6e2b5b6" }, "nui.nvim": { "branch": "main", "commit": "8d3bce9764e627b62b07424e0df77f680d47ffdb" }, - "nvim-lint": { "branch": "master", "commit": "81e8ba7655cc4395b1092ef4e1b6e83f54cd54ad" }, - "nvim-lspconfig": { "branch": "master", "commit": "40f120c10ea4b87311175539a183c3b75eab95a3" }, + "nvim-lint": { "branch": "master", "commit": "e7b4ffa6ab763af012e38b21af2c9159f10d2d33" }, + "nvim-lspconfig": { "branch": "master", "commit": "442e077e326ac467daf9cd63e72120fb450a850b" }, "nvim-navic": { "branch": "master", "commit": "8649f694d3e76ee10c19255dece6411c29206a54" }, "nvim-parinfer": { "branch": "master", "commit": "5ca09287ab3f4144f78ff7977fabc27466f71044" }, "nvim-spider": { "branch": "main", "commit": "4bd3221d165da334e57c8e9f38978e0c6f3a1742" }, - "nvim-treesitter": { "branch": "master", "commit": "997288c55253e27f782d991099490f80205d65bf" }, - "nvim-treesitter-context": { "branch": "master", "commit": "93b29a32d5f4be10e39226c6b796f28d68a8b483" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "9937e5e356e5b227ec56d83d0a9d0a0f6bc9cad4" }, + "nvim-treesitter": { "branch": "master", "commit": "205faba1768a6e4c854f156bc6a21a41b242599c" }, + "nvim-treesitter-context": { "branch": "master", "commit": "439789a9a8df9639ecd749bb3286b77117024a6f" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "698b5f805722254bca3c509591c1806d268b6c2f" }, "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, - "nvim-web-devicons": { "branch": "master", "commit": "4c3a5848ee0b09ecdea73adcd2a689190aeb728c" }, + "nvim-web-devicons": { "branch": "master", "commit": "57dfa947cc88cdf1baa2c7e13ed31edddd8fb1d1" }, "outline.nvim": { "branch": "main", "commit": "ae473fb51b7b6086de0876328c81a63f9c3ecfef" }, "overseer.nvim": { "branch": "master", "commit": "72c68aab0358c92f451168b704c411c4a3e3410e" }, "oxocarbon.nvim": { "branch": "main", "commit": "004777819ba294423b638a35a75c9f0c7be758ed" }, "persistence.nvim": { "branch": "main", "commit": "166a79a55bfa7a4db3e26fc031b4d92af71d0b51" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "render-markdown.nvim": { "branch": "main", "commit": "d2285137fa4fbc0b4152cb444008166962b727b5" }, + "render-markdown.nvim": { "branch": "main", "commit": "a615baed85137a8c6fc8e95f5545f64d33f5f384" }, "snacks.nvim": { "branch": "main", "commit": "bc0630e43be5699bb94dadc302c0d21615421d93" }, "sniprun": { "branch": "master", "commit": "151ada2c984aee1feb45c7e3c2abb19f597ecbd0" }, "telescope.nvim": { "branch": "master", "commit": "a4ed82509cecc56df1c7138920a1aeaf246c0ac5" }, diff --git a/nvim/lazyvim.json b/nvim/lazyvim.json index bd4f8c9..12d2115 100644 --- a/nvim/lazyvim.json +++ b/nvim/lazyvim.json @@ -1,6 +1,5 @@ { "extras": [ - "lazyvim.plugins.extras.ai.copilot" ], "install_version": 7, "news": { diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index bf77d37..e28869f 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -49,6 +49,11 @@ map("n", "srf", function() }) end, { desc = "Search n replace in file" }) map("n", "ff", "FzfLua", { desc = "FZF commands" }) +-- tab to accept copilot suggestion +map("i", "", function() + require("copilot.suggestion").accept() +end, { desc = "Accept Copilot suggestion" }) +-- map("i", "M-m", "LLMSuggestion", { desc = "LLM Suggestion" }) -- map("n", "mm", bm.bookmark_toggle) -- add or remove bookmark at current line -- map("n", "mi", bm.bookmark_ann) -- add or edit mark annotation at current line -- map("n", "mc", bm.bookmark_clean) -- clean all marks in local buffer diff --git a/nvim/lua/config/lazy.lua b/nvim/lua/config/lazy.lua index b982834..d4361a1 100644 --- a/nvim/lua/config/lazy.lua +++ b/nvim/lua/config/lazy.lua @@ -13,32 +13,36 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end end vim.opt.rtp:prepend(lazypath) - +local spec = { + -- add LazyVim and import its plugins + { "LazyVim/LazyVim", import = "lazyvim.plugins" }, + -- { import = "lazyvim.plugins.extras.ui.edgy" }, + { import = "lazyvim.plugins.extras.vscode" }, + { import = "lazyvim.plugins.extras.coding.yanky" }, + { import = "lazyvim.plugins.extras.coding.mini-comment" }, + { import = "lazyvim.plugins.extras.editor.fzf" }, + { import = "lazyvim.plugins.extras.editor.harpoon2" }, + { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, + { import = "lazyvim.plugins.extras.ui.treesitter-context" }, + { import = "lazyvim.plugins.extras.lang.elixir" }, + { import = "lazyvim.plugins.extras.editor.inc-rename" }, + { import = "lazyvim.plugins.extras.editor.leap" }, + { import = "lazyvim.plugins.extras.editor.mini-diff" }, + { import = "lazyvim.plugins.extras.editor.mini-move" }, + { import = "lazyvim.plugins.extras.editor.navic" }, + { import = "lazyvim.plugins.extras.editor.outline" }, + { import = "lazyvim.plugins.extras.editor.overseer" }, + { import = "lazyvim.plugins.extras.coding.mini-surround" }, + { import = "lazyvim.plugins.extras.ai.copilot" }, + -- { import = "lazyvim.plugins.extras.test.core" }, + -- import/override with your plugins +} +if vim.loop.os_uname().sysname == "Darwin" then + table.insert(spec, { import = "lazyvim.plugins.extras.ai.copilot" }) +end +table.insert(spec, { import = "plugins" }) require("lazy").setup({ - spec = { - -- add LazyVim and import its plugins - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - -- { import = "lazyvim.plugins.extras.ui.edgy" }, - { import = "lazyvim.plugins.extras.vscode" }, - { import = "lazyvim.plugins.extras.coding.yanky" }, - { import = "lazyvim.plugins.extras.coding.mini-comment" }, - { import = "lazyvim.plugins.extras.editor.fzf" }, - { import = "lazyvim.plugins.extras.editor.harpoon2" }, - { import = "lazyvim.plugins.extras.ui.mini-indentscope" }, - { import = "lazyvim.plugins.extras.ui.treesitter-context" }, - { import = "lazyvim.plugins.extras.lang.elixir" }, - { import = "lazyvim.plugins.extras.editor.inc-rename" }, - { import = "lazyvim.plugins.extras.editor.leap" }, - { import = "lazyvim.plugins.extras.editor.mini-diff" }, - { import = "lazyvim.plugins.extras.editor.mini-move" }, - { import = "lazyvim.plugins.extras.editor.navic" }, - { import = "lazyvim.plugins.extras.editor.outline" }, - { import = "lazyvim.plugins.extras.editor.overseer" }, - { import = "lazyvim.plugins.extras.coding.mini-surround" }, - -- { import = "lazyvim.plugins.extras.test.core" }, - -- import/override with your plugins - { import = "plugins" }, - }, + spec = spec, defaults = { -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup. -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default. diff --git a/nvim/lua/config/options.lua b/nvim/lua/config/options.lua index 429916f..dfebcff 100644 --- a/nvim/lua/config/options.lua +++ b/nvim/lua/config/options.lua @@ -5,3 +5,4 @@ vim.opt.laststatus = 3 vim.g.maplocalleader = "," +vim.diagnostic.config({ virtual_text = true }) diff --git a/nvim/lua/plugins/ai.lua b/nvim/lua/plugins/ai.lua index d12efa7..b90fd5d 100644 --- a/nvim/lua/plugins/ai.lua +++ b/nvim/lua/plugins/ai.lua @@ -7,53 +7,35 @@ return { -- }, -- config = true, -- }, - { - "milanglacier/minuet-ai.nvim", - opts = { - lsp = { - -- enabled_ft = { 'toml', 'lua', 'cpp' }, - -- Enables automatic completion triggering using `vim.lsp.completion.enable` - -- enabled_auto_trigger_ft = { 'ex', 'lua' }, - }, - -- virtualtext = { - -- -- auto_trigger_ft = {}, - -- -- keymap = { - -- -- -- accept whole completion - -- -- accept = "", - -- -- -- accept one line - -- -- accept_line = "", - -- -- -- accept n lines (prompts for number) - -- -- -- e.g. "A-z 2 CR" will accept 2 lines - -- -- accept_n_lines = "", - -- -- -- Cycle to prev completion item, or manually invoke completion - -- -- prev = "", - -- -- -- Cycle to next completion item, or manually invoke completion - -- -- next = "", - -- -- dismiss = "", - -- -- }, - -- }, - provider = "openai_compatible", - request_timeout = 2.5, - throttle = 1500, -- Increase to reduce costs and avoid rate limits - debounce = 600, -- Increase to reduce costs and avoid rate limits - provider_options = { - openai_compatible = { - api_key = "OPENAI_API_KEY", - end_point = "https://api.githubcopilot.com/chat/completions", - model = "gpt-4o", - name = "Copilot", - optional = { - max_tokens = 256, - top_p = 0.9, - provider = { - -- Prioritize throughput for faster completion - sort = "throughput", - }, - }, - }, - }, - }, - }, + -- { + -- "Jacob411/Ollama-Copilot", + -- opts = { + -- model_name = "deepseek-coder:base", + -- stream_suggestion = false, + -- python_command = "python3", + -- filetypes = { "python", "lua", "vim", "markdown" }, + -- ollama_model_opts = { + -- num_predict = 40, + -- temperature = 0.1, + -- }, + -- keymaps = { + -- suggestion = "os", + -- reject = "or", + -- insert_accept = "", + -- }, + -- }, + -- }, + -- { + -- "TabbyML/vim-tabby", + -- lazy = false, + -- dependencies = { + -- "neovim/nvim-lspconfig", + -- }, + -- init = function() + -- vim.g.tabby_agent_start_command = { "npx", "tabby-agent", "--stdio" } + -- vim.g.tabby_inline_completion_trigger = "auto" + -- end, + -- }, -- { -- "Saghen/blink.cmp", -- config = function(_, opts) @@ -82,10 +64,57 @@ return { -- require("blink-cmp").setup(merged_with_opts) -- end, -- }, + -- { + -- "Davidyz/VectorCode", + -- enabled = vim.loop.os_uname().sysname == "Darwin", + -- version = "*", -- optional, depending on whether you're on nightly or release + -- build = "pipx upgrade vectorcode", -- optional but recommended if you set `version = "*"` + -- dependencies = { "nvim-lua/plenary.nvim" }, + -- }, + -- { + -- "huggingface/llm.nvim", + -- opts = { + -- backend = "ollama", + -- model = "codellama:7b-instruct", + -- url = "http://localhost:11434", -- llm-ls uses "/api/generate" + -- -- cf https://github.com/ollama/ollama/blob/main/docs/api.md#parameters + -- request_body = { + -- -- Modelfile options for the model you use + -- options = { + -- temperature = 0.2, + -- top_p = 0.95, + -- }, + -- }, + -- }, + -- }, { - "Davidyz/VectorCode", - version = "*", -- optional, depending on whether you're on nightly or release - build = "pipx upgrade vectorcode", -- optional but recommended if you set `version = "*"` - dependencies = { "nvim-lua/plenary.nvim" }, + "zbirenbaum/copilot.lua", + optional = true, + opts = function() + require("copilot.api").status = require("copilot.status") + return { + suggestion = { + auto_trigger = true, + debounce = 100, + keymap = { + accept = "", + next = "", + prev = "", + dismiss = "", + }, + }, + panel = { + enabled = false, + auto_refresh = true, + keymap = { + jump_next = "", + jump_prev = "", + accept = "", + refresh = "r", + open = "", + }, + }, + } + end, }, } diff --git a/nvim/lua/plugins/completion.lua b/nvim/lua/plugins/completion.lua index 39bb031..519366e 100644 --- a/nvim/lua/plugins/completion.lua +++ b/nvim/lua/plugins/completion.lua @@ -1,11 +1,18 @@ return { + { + "giuxtaposition/blink-cmp-copilot", + enabled = false, + }, { "saghen/blink.cmp", + dependencies = { "fang2hou/blink-copilot" }, opts = { sources = { - -- per_filetype = { - -- codecompanion = { "codecompanion" }, - -- }, + providers = { + copilot = { + module = "blink-copilot", + }, + }, }, }, }, diff --git a/nvim/lua/plugins/plugins.lua b/nvim/lua/plugins/plugins.lua index 72f25ac..5e72d47 100644 --- a/nvim/lua/plugins/plugins.lua +++ b/nvim/lua/plugins/plugins.lua @@ -321,15 +321,6 @@ return { }) end, }, - { - "zbirenbaum/copilot.lua", - opts = { - suggestion = { - enabled = true, - auto_trigger = true, - }, - }, - }, { "robitx/gp.nvim", opts = { @@ -405,25 +396,34 @@ return { event = "VeryLazy", version = false, -- for macos - opts = vim.loop.os_uname().sysname == "Darwin" - and { - provider = "copilot", - copilot = { - -- endpoint = "https://api.githubcopilot.com/chat/completions", - model = "gpt-4o", - -- timeout = 30000, -- timeout in milliseconds - -- temperature = 0, -- adjust if needed - -- max_tokens = 4096, - -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) - }, - } - -- for linux - or { - provider = "openai", - openai = { - model = "gpt-4o", - }, + opts = { + provider = "copilot", + copilot = { + -- endpoint = "https://api.githubcopilot.com/chat/completions", + model = "claude-3.7-sonnet", + -- timeout = 30000, -- timeout in milliseconds + -- temperature = 0, -- adjust if needed + -- max_tokens = 4096, + -- reasoning_effort = "high" -- only supported for reasoning models (o1, etc.) }, + }, + -- for linux + -- or { + -- provider = "openai", + -- -- + -- openai = { + -- model = "gpt-4o", + -- }, + -- -- behaviour = { + -- -- --- ... existing behaviours + -- -- enable_cursor_planning_mode = true, -- enable cursor planning mode! + -- -- }, + -- provider = "ollama", + -- ollama = { + -- endpoint = "http://127.0.0.1:11434", -- Note that there is no /v1 at the end. + -- model = "codellama:7b-instruct", + -- }, + -- }, -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` build = "make", -- build = "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" -- for windows