diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 1b9497d..5b11ea0 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,26 +7,26 @@ "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "copilot-lualine": { "branch": "main", "commit": "222e90bd8dcdf16ca1efc4e784416afb5f011c31" }, - "copilot.lua": { "branch": "master", "commit": "b54c05349d406f7af11b150824efa8e4f90015c6" }, + "copilot.lua": { "branch": "master", "commit": "7df55b20b5b653941f0bcff87e559cabb6fafeb0" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "fzy-lua-native": { "branch": "master", "commit": "9d720745d5c2fb563c0d86c17d77612a3519c506" }, "git-blame.nvim": { "branch": "main", "commit": "5c536e2d4134d064aa3f41575280bc8a2a0e03d7" }, - "gitsigns.nvim": { "branch": "main", "commit": "25050e4ed39e628282831d4cbecb1850454ce915" }, + "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, "go.nvim": { "branch": "master", "commit": "0768d79bbebdb1a112a845f9cd6293bfbd544dab" }, "grug-far.nvim": { "branch": "main", "commit": "c995bbacf8229dc096ec1c3d60f8531059c86c1b" }, "guihua.lua": { "branch": "master", "commit": "f8e06bd8a26dee3377d63c2adf1e57cdb58ac474" }, "karen-yank.nvim": { "branch": "main", "commit": "817f50c9464ce557c8f7f8f4d4c8d2f7b81fc40c" }, "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, "leap.nvim": { "branch": "main", "commit": "d7f8ee64155b7790188f17a993390f32577cfb81" }, - "live-preview.nvim": { "branch": "main", "commit": "c1fcf75c5f9c9c01dd392852de44204b60f1b5b1" }, + "live-preview.nvim": { "branch": "main", "commit": "5977060965161f7b3be3166467d03e09d10c68ea" }, "lspsaga.nvim": { "branch": "main", "commit": "3e33a6a6c5d379f3d4fae77fae6b53b762a0a30f" }, "lualine-lsp-progress": { "branch": "master", "commit": "56842d097245a08d77912edf5f2a69ba29f275d7" }, "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "21c5b3ebeaa0412e28096bb0701434c51c1fbf76" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, - "mini.comment": { "branch": "main", "commit": "a0c721115faff8d05505c0a12dab410084d9e536" }, - "mini.pairs": { "branch": "main", "commit": "d5a29b6254dad07757832db505ea5aeab9aad43a" }, - "mini.surround": { "branch": "main", "commit": "88c52297ed3e69ecf9f8652837888ecc727a28ee" }, + "mini.comment": { "branch": "main", "commit": "4677392f091e8b5c18d4b535130220a6d1da4aca" }, + "mini.pairs": { "branch": "main", "commit": "4a014143fcb4e9df26198ccb3ecff3b9e77a048c" }, + "mini.surround": { "branch": "main", "commit": "580e4cb98c5900d9fe743865fb5a5b2178b4ab18" }, "neotest": { "branch": "master", "commit": "ad991822b7076b1d940b33a9d6d0d30416d5df81" }, "neotest-go": { "branch": "main", "commit": "59b50505053f9c45a9febb79e11a56206c3e3901" }, "neotest-python": { "branch": "master", "commit": "e6df4f1892f6137f58135917db24d1655937d831" }, @@ -35,25 +35,25 @@ "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "none-ls.nvim": { "branch": "main", "commit": "01f8e62ea11603e59ad9ff7afcfa94fd183f76d6" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-lspconfig": { "branch": "master", "commit": "a683e0ddf0cf64c6cd689e18ffb480ade3c162b7" }, + "nvim-lspconfig": { "branch": "master", "commit": "bfcc0171a43f22afa61d927ffe9fcb6cb85dc99e" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "6141a40173c6efa98242dc951ed4b6f892c97027" }, "nvim-ufo": { "branch": "main", "commit": "ab3eb124062422d276fae49e0dd63b3ad1062cfc" }, "nvim-web-devicons": { "branch": "master", "commit": "dfbfaa967a6f7ec50789bead7ef87e336c1fa63c" }, - "opencode.nvim": { "branch": "main", "commit": "97c90dd0936c9076cbe78d8f94c7a2d119509d2c" }, + "opencode.nvim": { "branch": "main", "commit": "c3271dee53af4ccb5c072dd807972d4b1e76e7d3" }, "outline.nvim": { "branch": "main", "commit": "2a132953b944561d45b52e4541ebfff71934a742" }, "plenary.nvim": { "branch": "master", "commit": "74b06c6c75e4eeb3108ec01852001636d85a932b" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, - "render-markdown": { "branch": "main", "commit": "5adf0895310c1904e5abfaad40a2baad7fe44a07" }, + "render-markdown": { "branch": "main", "commit": "f422cb5c6855f150e2ddcfaf44e7157b98b34f6a" }, "schema-companion.nvim": { "branch": "main", "commit": "b55ca0d99036950b71344d179af0499d8cfa7719" }, "smart-paste.nvim": { "branch": "main", "commit": "7a461d3d83a6bee199d3f1c0b177f7f3e22fa371" }, "snacks.nvim": { "branch": "main", "commit": "882c996cf28183f4d63640de0b4c02ec886d01f2" }, "statuscol.nvim": { "branch": "main", "commit": "c46172d0911aa5d49ba5f39f4351d1bb7aa289cc" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "b25b749b9db64d375d782094e2b9dce53ad53a40" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "7d324792b7943e4aa16ad007212e6acc6f9fe335" }, + "telescope.nvim": { "branch": "master", "commit": "427b576c16792edad01a92b89721d923c19ad60f" }, "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, - "tree-sitter-manager.nvim": { "branch": "main", "commit": "95f81026390077f8eea9eef6d32ad59d4c3bd3ee" }, + "tree-sitter-manager.nvim": { "branch": "main", "commit": "ae305699da5e97b6cffdd5cc6f6045b1b0bd26ea" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" }, "venv-selector.nvim": { "branch": "main", "commit": "cc4bb3975de8835291f9bb45889e96c6b2795fc4" }, diff --git a/.config/nvim/lua/core/lazy.lua b/.config/nvim/lua/core/lazy.lua index d6ce055..5d07985 100644 --- a/.config/nvim/lua/core/lazy.lua +++ b/.config/nvim/lua/core/lazy.lua @@ -125,9 +125,9 @@ require("lazy").setup({ { "saghen/blink.cmp", version = "*", - dependencies = { - "fang2hou/blink-copilot", - }, + -- dependencies = { + -- "fang2hou/blink-copilot", + -- }, }, -- LSP @@ -217,12 +217,12 @@ require("lazy").setup({ { "mzlogin/vim-markdown-toc" }, -- AI - { - "zbirenbaum/copilot.lua", - cmd = "Copilot", - event = "InsertEnter", - }, - { "AndreM222/copilot-lualine" }, + -- { + -- "zbirenbaum/copilot.lua", + -- cmd = "Copilot", + -- event = "InsertEnter", + -- }, + -- { "AndreM222/copilot-lualine" }, { "nickjvandyke/opencode.nvim", version = "*", -- Latest stable release diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 138022b..30fc391 100644 --- a/.config/nvim/lua/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -41,18 +41,7 @@ require("blink.cmp").setup({ }, }, sources = { - default = { "lsp", "path", "buffer", "copilot" }, - providers = { - copilot = { - name = "copilot", - module = "blink-copilot", - score_offset = 100, - async = true, - opts = { - max_completions = 3, - }, - }, - }, + default = { "lsp", "path", "buffer" }, }, keymap = { diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua index 65789a9..7986922 100644 --- a/.config/nvim/lua/plugins/init.lua +++ b/.config/nvim/lua/plugins/init.lua @@ -1,6 +1,6 @@ require("plugins.snacks") require("plugins.blink") -require("plugins.copilot") +-- require("plugins.copilot") require("plugins.telescope") require("plugins.mini-comment") require("plugins.mini-pairs") diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index b27e7c1..8249cb3 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,67 +1,67 @@ local hide_in_width = function() - return vim.fn.winwidth(0) > 80 + return vim.fn.winwidth(0) > 80 end local diagnostics = { - "diagnostics", - sources = { "nvim_diagnostic" }, - sections = { "error", "warn" }, - symbols = { error = " ", warn = " " }, - colored = false, - always_visible = true, + "diagnostics", + sources = { "nvim_diagnostic" }, + sections = { "error", "warn" }, + symbols = { error = " ", warn = " " }, + colored = false, + always_visible = true, } local diff = { - "diff", - colored = false, - symbols = { added = "+", modified = "", removed = "" }, - cond = hide_in_width, + "diff", + colored = false, + symbols = { added = "+", modified = "", removed = "" }, + cond = hide_in_width, } local lsp_progress = { - "lsp_progress", - display_components = { "spinner" }, - spinner_symbols = { "⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽", "⣾" }, + "lsp_progress", + display_components = { "spinner" }, + spinner_symbols = { "⣷", "⣯", "⣟", "⡿", "⢿", "⣻", "⣽", "⣾" }, } local spaces = function() - local expandtab = vim.api.nvim_get_option_value("expandtab", { buf = 0 }) + local expandtab = vim.api.nvim_get_option_value("expandtab", { buf = 0 }) - local title = "spaces: " - if not expandtab then - title = "tab: " - end + local title = "spaces: " + if not expandtab then + title = "tab: " + end - return title .. vim.api.nvim_get_option_value("shiftwidth", { buf = 0 }) + return title .. vim.api.nvim_get_option_value("shiftwidth", { buf = 0 }) end local venv = function() - local venv = os.getenv("VIRTUAL_ENV") - if venv then - return string.format(" %s", string.match(venv, "[^/]+$")) - end + local venv = os.getenv("VIRTUAL_ENV") + if venv then + return string.format(" %s", string.match(venv, "[^/]+$")) + end - venv = require("venv-selector").get_active_venv() - if venv then - return string.format(" %s", string.match(venv, "[^/]+$")) - end + venv = require("venv-selector").get_active_venv() + if venv then + return string.format(" %s", string.match(venv, "[^/]+$")) + end - return "" + return "" end local get_filetype = function() - local ft = vim.bo.filetype or "" + local ft = vim.bo.filetype or "" - if ft == "yaml" then - local schema = require("schema-companion").get_current_schemas() or "" - if schema == "" then - return ft - end + if ft == "yaml" then + local schema = require("schema-companion").get_current_schemas() or "" + if schema == "" then + return ft + end - return ft .. " (" .. schema:sub(0, 50) .. ")" - else - return ft - end + return ft .. " (" .. schema:sub(0, 50) .. ")" + else + return ft + end end local gitblame = require("gitblame") @@ -71,69 +71,69 @@ vim.g.gitblame_display_virtual_text = 0 vim.g.gitblame_message_template = ", " require("lualine").setup({ - options = { - globalstatus = true, - }, - sections = { - lualine_a = { "mode" }, - lualine_b = { "branch", venv }, - lualine_c = { - diagnostics, - { - "filename", - path = 1, - cond = function() - if - vim.bo.filetype == "snacks_picker_list" - or vim.bo.filetype == "mason" - or vim.bo.filetype == "lazy" - or vim.bo.filetype == "help" - or vim.bo.filetype == "starter" - or vim.bo.filetype == "TelescopePrompt" - or vim.bo.filetype == "noice" - then - return false - end + options = { + globalstatus = true, + }, + sections = { + lualine_a = { "mode" }, + lualine_b = { "branch", venv }, + lualine_c = { + diagnostics, + { + "filename", + path = 1, + cond = function() + if + vim.bo.filetype == "snacks_picker_list" + or vim.bo.filetype == "mason" + or vim.bo.filetype == "lazy" + or vim.bo.filetype == "help" + or vim.bo.filetype == "starter" + or vim.bo.filetype == "TelescopePrompt" + or vim.bo.filetype == "noice" + then + return false + end - return true - end, - }, - { - "copilot", - symbols = { - status = { - icons = { - enabled = " ", - sleep = " ", - disabled = " ", - warning = " ", - unknown = " ", - }, - }, - spinners = require("copilot-lualine.spinners").dots, - }, - }, - lsp_progress, - { - require("noice").api.statusline.mode.get, - cond = require("noice").api.statusline.mode.has, - color = { fg = "#ff9e64" }, - }, - { - require("noice").api.status.search.get, - cond = require("noice").api.status.search.has, - color = { fg = "#c69026" }, - }, - }, - lualine_x = { - { gitblame.get_current_blame_text, cond = gitblame.is_blame_text_available }, - diff, - spaces, - "encoding", - { get_filetype, separator = "" }, - }, - lualine_y = { "progress" }, - lualine_z = { "location" }, - }, - extensions = { "lazy", "mason", "trouble" }, + return true + end, + }, + -- { + -- "copilot", + -- symbols = { + -- status = { + -- icons = { + -- enabled = " ", + -- sleep = " ", + -- disabled = " ", + -- warning = " ", + -- unknown = " ", + -- }, + -- }, + -- spinners = require("copilot-lualine.spinners").dots, + -- }, + -- }, + lsp_progress, + { + require("noice").api.statusline.mode.get, + cond = require("noice").api.statusline.mode.has, + color = { fg = "#ff9e64" }, + }, + { + require("noice").api.status.search.get, + cond = require("noice").api.status.search.has, + color = { fg = "#c69026" }, + }, + }, + lualine_x = { + { gitblame.get_current_blame_text, cond = gitblame.is_blame_text_available }, + diff, + spaces, + "encoding", + { get_filetype, separator = "" }, + }, + lualine_y = { "progress" }, + lualine_z = { "location" }, + }, + extensions = { "lazy", "mason", "trouble" }, }) diff --git a/.config/nvim/lua/plugins/neovim-project.lua b/.config/nvim/lua/plugins/neovim-project.lua index d4368f4..09f1eb8 100644 --- a/.config/nvim/lua/plugins/neovim-project.lua +++ b/.config/nvim/lua/plugins/neovim-project.lua @@ -1,27 +1,27 @@ local projects = function() - local projects_path = vim.fn.expand("~/.config/nvim/neovim-projects.json") - local data = require("util.files").read(projects_path) + local projects_path = vim.fn.expand("~/.config/nvim/neovim-projects.json") + local data = require("util.files").read(projects_path) - if data then - local ok, decoded = pcall(vim.json.decode, data) - return ok and decoded or {} - end + if data then + local ok, decoded = pcall(vim.json.decode, data) + return ok and decoded or {} + end - return {} + return {} end require("neovim-project").setup({ - projects = projects(), - last_session_on_startup = false, - dashboard_mode = false, - filetype_autocmd_timeout = 0, - session_manager_opts = { - autosave_ignore_filetypes = { - "snacks_picker_list", - "trouble", - "grug-far", - "copilot-chat", - "trouble", - }, - }, + projects = projects(), + last_session_on_startup = false, + dashboard_mode = false, + filetype_autocmd_timeout = 0, + session_manager_opts = { + autosave_ignore_filetypes = { + "snacks_picker_list", + "trouble", + "grug-far", + -- "copilot-chat", + "trouble", + }, + }, }) diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index 594c6fa..9c812a3 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -2,7 +2,11 @@ require("snacks").setup({ animate = {}, bigfile = {}, explorer = {}, + input = { + enabled = true, + }, picker = { + enabled = true, sources = { explorer = { hidden = true, @@ -10,8 +14,14 @@ require("snacks").setup({ }, }, actions = { - opencode_send = function(...) - return require("opencode").snacks_picker_send(...) + opencode_send = function(picker) + local items = vim.tbl_map(function(item) + return item.file + and require("opencode").format({ path = item.file, from = item.pos, to = item.end_pos }) + or item.text + end, picker:selected({ fallback = true })) + + require("opencode").prompt(table.concat(items, ", ") .. " ") end, }, win = {