From 68e14167052fe66c6e5affb6e8b389b0b0cfd2d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Doma=C5=84ski?= Date: Fri, 27 Feb 2026 13:36:47 +0100 Subject: [PATCH] bump --- .config/nvim/init.lua | 1 + .config/nvim/lazy-lock.json | 52 ++++----- .config/nvim/lua/config/autocmds.lua | 49 +++++++++ .config/nvim/lua/config/options.lua | 5 +- .config/nvim/lua/plugins/ai.lua | 157 ++++++++++++++------------- .config/nvim/lua/plugins/lsp.lua | 142 +----------------------- .config/nvim/lua/plugins/ui.lua | 2 +- .zshrc | 3 + 8 files changed, 166 insertions(+), 245 deletions(-) diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index bba220d..9f7f572 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,4 +1,5 @@ require("config.options") +require("config.lsp") require("config.lazy") require("config.keymaps") require("config.autocmds") diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 6a44987..8d7a252 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,43 +1,45 @@ { + "99": { "branch": "master", "commit": "6a64e0b2f4c7f1e3911db1f8318e5d7c68cb8dff" }, "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, - "LuaSnip": { "branch": "master", "commit": "ccf25a5452b8697a823de3e5ecda63ed3d723b79" }, + "LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" }, + "claudecode.nvim": { "branch": "main", "commit": "aa9a5cebebdbfa449c1c5ff229ba5d98e66bafed" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dressing.nvim": { "branch": "master", "commit": "2d7c2db2507fa3c4956142ee607431ddb2828639" }, - "flutter-tools.nvim": { "branch": "main", "commit": "69db9cdac65ce536e20a8fc9a83002f007cc049c" }, - "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, + "flutter-tools.nvim": { "branch": "main", "commit": "677cc07c16e8b89999108d2ebeefcfc5f539b73c" }, + "gitsigns.nvim": { "branch": "main", "commit": "9f3c6dd7868bcc116e9c1c1929ce063b978fa519" }, "harpoon": { "branch": "master", "commit": "1bc17e3e42ea3c46b33c0bbad6a880792692a1b3" }, - "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, - "lazy.nvim": { "branch": "main", "commit": "f0f5bbb9e5bfae5e6468f9359ffea3d151418176" }, - "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" }, - "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, - "mini.indentscope": { "branch": "main", "commit": "e9fa0714fc753e1e737940577904e553ee340903" }, - "mini.nvim": { "branch": "main", "commit": "ee4a4a4abed25e3d108d985b0553c5271f2f71aa" }, - "neo-tree.nvim": { "branch": "main", "commit": "146408d801da2e9d917ca275f86b788fe612df85" }, - "noice.nvim": { "branch": "main", "commit": "5099348591f7d3ba9e547b1e631c694c65bbe0b9" }, + "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "6c4830e37743b060d13c9269394176aea6a0fbc8" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.indentscope": { "branch": "main", "commit": "065c7713fb4cd0124fe1462f15f27feeb8b04406" }, + "mini.nvim": { "branch": "main", "commit": "577d2dcb558efce1518c45a76345e01bf346c8e8" }, + "neo-tree.nvim": { "branch": "main", "commit": "ba6871d15528e36657d19a3112cc1697c59da19a" }, + "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "7a2c97cccd60abc559344042fefb1d5a85b3e33b" }, - "nvim-cmp": { "branch": "main", "commit": "cf22c9e32512de3be1fd6b65fd25e3aabead4d8b" }, + "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, + "nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "e25994a1c2373784364852cd904cb39b6d75f227" }, + "nvim-lspconfig": { "branch": "master", "commit": "ab5139c99df944479e5a26495a37840fcbb1d512" }, "nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" }, "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-treesitter-context": { "branch": "master", "commit": "ec308c7827b5f8cb2dd0ad303a059c945dd21969" }, + "nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" }, "nvim-treesitter-textobjects": { "branch": "master", "commit": "5ca4aaa6efdcc59be46b95a3e876300cfead05ef" }, - "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, + "nvim-web-devicons": { "branch": "master", "commit": "16d919d768b5bc2921bd7d5a4ee76f158f7ea1c0" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, "symbols-outline.nvim": { "branch": "master", "commit": "564ee65dfc9024bdde73a6621820866987cbb256" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, - "telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" }, - "todo-comments.nvim": { "branch": "main", "commit": "411503d3bedeff88484de572f2509c248e499b38" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "transparent.nvim": { "branch": "main", "commit": "8ac59883de84e9cd1850ea25cf087031c5ba7d54" }, - "trouble.nvim": { "branch": "main", "commit": "d7494d8bc563f8ae8b3f35d78c7478cf842b0ab9" }, - "undotree": { "branch": "master", "commit": "0f1c9816975b5d7f87d5003a19c53c6fd2ff6f7f" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, + "undotree": { "branch": "master", "commit": "d8f99084d98c32f651860eb0baaf89759f91debc" }, "vim-ditto": { "branch": "master", "commit": "c21f0e2f651e0ae87788390dca2fb97af7fb8fcf" }, "vim-illuminate": { "branch": "master", "commit": "0d1e93684da00ab7c057410fecfc24f434698898" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }, - "window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" }, - "windsurf.vim": { "branch": "main", "commit": "a8d47ec54fe82df920b2545559f767003e8a7f8d" } + "window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" } } diff --git a/.config/nvim/lua/config/autocmds.lua b/.config/nvim/lua/config/autocmds.lua index bb9e39a..99040c3 100644 --- a/.config/nvim/lua/config/autocmds.lua +++ b/.config/nvim/lua/config/autocmds.lua @@ -2,10 +2,59 @@ vim.o.updatetime = 250 vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]] +-- autocomplete +local completion_timer = nil + +local function get_buffer_keywords(prefix) + local matches = {} + local seen = {} + for _, buf in ipairs(vim.api.nvim_list_bufs()) do + if vim.api.nvim_buf_is_loaded(buf) then + for _, line in ipairs(vim.api.nvim_buf_get_lines(buf, 0, -1, false)) do + for word in line:gmatch("[%w_]+") do + if word ~= prefix and word:sub(1, #prefix) == prefix and not seen[word] then + seen[word] = true + table.insert(matches, word) + end + end + end + end + end + return matches +end + +vim.api.nvim_create_autocmd("TextChangedI", { + callback = function() + if completion_timer then + completion_timer:stop() + end + completion_timer = vim.uv.new_timer() + completion_timer:start(150, 0, vim.schedule_wrap(function() + if vim.fn.pumvisible() == 1 or vim.api.nvim_get_mode().mode ~= "i" then + return + end + local col = vim.api.nvim_win_get_cursor(0)[2] + local line = vim.api.nvim_get_current_line() + local prefix = line:sub(1, col):match("[%w_]+$") + if not prefix or #prefix < 2 then + return + end + local matches = get_buffer_keywords(prefix) + if #matches > 0 then + vim.fn.complete(col - #prefix + 1, matches) + end + end)) + end, +}) + if not os.getenv("NVIM_LSP_OMIT_DIR") then vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("lsp", { clear = true }), callback = function(args) + -- enable completion + vim.lsp.completion.enable(true, args.data.client_id, args.buf, { autotrigger = true }) + + -- autoformat, if not disabled if not os.getenv("NVIM_LSP_NO_AUTOFMT") then vim.api.nvim_create_autocmd("BufWritePre", { buffer = args.buf, diff --git a/.config/nvim/lua/config/options.lua b/.config/nvim/lua/config/options.lua index b86670b..3ca80d8 100644 --- a/.config/nvim/lua/config/options.lua +++ b/.config/nvim/lua/config/options.lua @@ -1,14 +1,15 @@ vim.g.mapleader = " " vim.g.maplocalleader = "\\" vim.g.autoformat_enabled = true -vim.g.cmp_enabled = true +-- vim.g.cmp_enabled = true vim.g.icons_enabled = true local opt = vim.opt opt.autowrite = true -- Enable auto write opt.clipboard = "unnamedplus" -- Sync with system clipboard -opt.completeopt = "menu,menuone,noselect" +opt.complete = ".,w,b,u,t,i" -- Make autocompletion behave like in an IDE +opt.completeopt = "menu,menuone,noselect,popup" opt.confirm = true -- Confirm to save changes before exiting modified buffer opt.cursorline = true -- Enable highlighting of the current line opt.expandtab = true -- Use spaces instead of tabs diff --git a/.config/nvim/lua/plugins/ai.lua b/.config/nvim/lua/plugins/ai.lua index 2bb524d..7c62fe7 100644 --- a/.config/nvim/lua/plugins/ai.lua +++ b/.config/nvim/lua/plugins/ai.lua @@ -1,81 +1,84 @@ return { - { - 'Exafunction/windsurf.vim', - event = 'BufEnter', - config = function() - -- Change '' here to any keycode you like. - vim.keymap.set('i', '', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](1) end, - { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](-1) end, - { expr = true, silent = true }) - vim.keymap.set('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }) - end - }, -- { - -- "yetone/avante.nvim", - -- -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` - -- -- ⚠️ must add this setting! ! ! - -- build = vim.fn.has("win32") ~= 0 - -- and "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" - -- or "make", - -- event = "VeryLazy", - -- version = false, -- Never set this value to "*"! Never! - -- ---@module 'avante' - -- ---@type avante.Config - -- opts = { - -- -- add any opts here - -- -- this file can contain specific instructions for your project - -- instructions_file = "avante.md", - -- -- for example - -- provider = "ollama", - -- providers = { - -- ollama = { - -- -- endpoint = "http://192.168.10.237:11434", - -- endpoint = "http://127.0.0.1:8080", - -- -- model = "qwen2.5-coder:32b", - -- model = "qwen2.5-coder:7b", - -- -- model = "codellama:7b-code", - -- }, - -- } - -- }, - -- dependencies = { - -- "nvim-lua/plenary.nvim", - -- "MunifTanjim/nui.nvim", - -- --- The below dependencies are optional, - -- "nvim-mini/mini.pick", -- for file_selector provider mini.pick - -- "nvim-telescope/telescope.nvim", -- for file_selector provider telescope - -- "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions - -- "ibhagwan/fzf-lua", -- for file_selector provider fzf - -- "stevearc/dressing.nvim", -- for input provider dressing - -- "folke/snacks.nvim", -- for input provider snacks - -- "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons - -- "zbirenbaum/copilot.lua", -- for providers='copilot' - -- { - -- -- support for image pasting - -- "HakonHarnes/img-clip.nvim", - -- event = "VeryLazy", - -- opts = { - -- -- recommended settings - -- default = { - -- embed_image_as_base64 = false, - -- prompt_for_file_name = false, - -- drag_and_drop = { - -- insert_mode = true, - -- }, - -- -- required for Windows users - -- use_absolute_path = true, - -- }, - -- }, - -- }, - -- { - -- -- Make sure to set this up properly if you have lazy=true - -- 'MeanderingProgrammer/render-markdown.nvim', - -- opts = { - -- file_types = { "markdown", "Avante" }, - -- }, - -- ft = { "markdown", "Avante" }, - -- }, - -- }, + -- 'Exafunction/windsurf.vim', + -- event = 'BufEnter', + -- config = function() + -- -- Change '' here to any keycode you like. + -- vim.keymap.set('i', '', function() return vim.fn['codeium#Accept']() end, { expr = true, silent = true }) + -- vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](1) end, + -- { expr = true, silent = true }) + -- vim.keymap.set('i', '', function() return vim.fn['codeium#CycleCompletions'](-1) end, + -- { expr = true, silent = true }) + -- vim.keymap.set('i', '', function() return vim.fn['codeium#Clear']() end, { expr = true, silent = true }) + -- vim.keymap.set('i', '', function() return vim.fn['codeium#Toggle']() end, { expr = true, silent = true }) + -- end -- }, + { + "coder/claudecode.nvim", + dependencies = { "folke/snacks.nvim" }, + config = true, + keys = { + { "a", nil, desc = "AI/Claude Code" }, + { "ac", "ClaudeCode", desc = "Toggle Claude" }, + { "af", "ClaudeCodeFocus", desc = "Focus Claude" }, + { "ar", "ClaudeCode --resume", desc = "Resume Claude" }, + { "aC", "ClaudeCode --continue", desc = "Continue Claude" }, + { "am", "ClaudeCodeSelectModel", desc = "Select Claude model" }, + { "ab", "ClaudeCodeAdd %", desc = "Add current buffer" }, + { "as", "ClaudeCodeSend", mode = "v", desc = "Send to Claude" }, + { + "as", + "ClaudeCodeTreeAdd", + desc = "Add file", + ft = { "NvimTree", "neo-tree", "oil", "minifiles", "netrw" }, + }, + -- Diff management + { "aa", "ClaudeCodeDiffAccept", desc = "Accept diff" }, + { "ad", "ClaudeCodeDiffDeny", desc = "Deny diff" }, + }, + }, + { + "ThePrimeagen/99", + config = function() + local _99 = require("99") + local cwd = vim.uv.cwd() + local basename = vim.fs.basename(cwd) + + _99.setup({ + provider = _99.Providers.ClaudeCodeProvider, + -- provider = _99.Providers.OpenCodeProvider, + logger = { + level = _99.DEBUG, + path = "/tmp/" .. basename .. ".99.debug", + print_on_error = true, + }, + tmp_dir = "/tmp", + completion = { + custom_rules = { + "scratch/custom_rules/", + }, + files = { + enabled = true, + max_file_size = 102400, -- bytes, skip files larger than this + max_files = 5000, -- cap on total discovered files + exclude = { ".env", ".env.*", "node_modules", ".git", ".venv" }, + }, + -- source = "cmp", + }, + md_files = { + "AGENT.md", + "CLAUDE.md", + }, + }) + vim.keymap.set("v", "9v", function() + _99.visual() + end) + vim.keymap.set("n", "9x", function() + _99.stop_all_requests() + end) + vim.keymap.set("n", "9s", function() + _99.search() + end) + end, + }, } diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index eac9cfb..d20d153 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua @@ -1,145 +1,7 @@ return { { - "hrsh7th/nvim-cmp", - event = "InsertEnter", - dependencies = { - { "L3MON4D3/LuaSnip" }, - }, - config = function() - local cmp = require("cmp") - - cmp.setup({ - completion = { - completeopt = "menu,menuone", - }, - mapping = { - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Insert, - select = true, - }, - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif require("luasnip").expand_or_jumpable() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif require("luasnip").jumpable(-1) then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end, { - "i", - "s", - }), - }, - sources = { - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "buffer" }, - { name = "nvim_lua" }, - { name = "path" }, - }, - }) - end, - }, - -- LSP - { - "neovim/nvim-lspconfig", - cmd = "LspInfo", - event = { "BufReadPre", "BufNewFile" }, - dependencies = { - { "hrsh7th/cmp-nvim-lsp" }, - { "williamboman/mason-lspconfig.nvim" }, - { "williamboman/mason.nvim" }, - }, - config = function() - configs = { - pylsp = { - settings = { - pylsp = { - plugins = { - mypy = { enabled = true }, - black = { enabled = true }, - isort = { enabled = true, profile = "black" }, - }, - }, - }, - }, - ruff = { - init_options = { - settings = { - configuration = "~/.config/nvim/configs/ruff.toml", - organizeImports = false, - showSyntaxErrors = false, - } - } - }, - pyright = { - settings = { - pyright = { - disableOptimizeImports = true, - }, - python = { - analysis = { - typeCheckingMode = "basic", - autoImportCompletions = false, - } - } - } - }, - kotlin_lsp = { - on_attach = function(client, bufnr) - local disabled = { - "documentFormattingProvider", - "documentRangeFormattingProvider", - } - for _, cap in ipairs(disabled) do - client.server_capabilities[cap] = false - end - end, - }, - } - - for k, v in pairs(configs) do - vim.lsp.config(k, v) - end - - vim.lsp.enable({ - "lua_ls", - "gopls", - "pyright", - "ruff", - "ts_ls", - "kotlin_lsp" - }) - require('mason').setup({}) - require('mason-lspconfig').setup({ - -- Replace the language servers listed here - -- with the ones you want to install - ensure_installed = { - "lua_ls", - "gopls", - "pyright", - "ruff", - "ts_ls", - "kotlin_lsp" - }, - }) - end + "mason-org/mason.nvim", + opts = {} }, { "folke/trouble.nvim", diff --git a/.config/nvim/lua/plugins/ui.lua b/.config/nvim/lua/plugins/ui.lua index bb58e10..56cc24e 100644 --- a/.config/nvim/lua/plugins/ui.lua +++ b/.config/nvim/lua/plugins/ui.lua @@ -186,7 +186,7 @@ return { override = { ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, + -- ["cmp.entry.get_documentation"] = true, }, hover = { enabled = false }, signature = { enabled = false }, diff --git a/.zshrc b/.zshrc index 77ec4f5..6727118 100755 --- a/.zshrc +++ b/.zshrc @@ -232,3 +232,6 @@ if [ -f "$HOME/.config/.env" ]; then fi export STM32_PRG_PATH=/Applications/STMicroelectronics/STM32Cube/STM32CubeProgrammer/STM32CubeProgrammer.app/Contents/MacOs/bin + +# opencode +export PATH=/Users/doman/.opencode/bin:$PATH