all repos

init.lua @ caf1af9

my nvim config
4 files changed, 53 insertions(+), 54 deletions(-)
fix: make all more "lazy-load"ed
Author: Smirnov Oleksandr ss2316544@gmail.com
Committed at: 2024-07-27 00:12:29 +0300
Parent: 45ba3cb
M lazy-lock.json

@@ -22,6 +22,7 @@ "mini.bufremove": { "branch": "main", "commit": "1ee294a97e091d3cf967974df622c0d887890dc2" },

"mini.splitjoin": { "branch": "main", "commit": "3e92f6764e770ba392325cad3a4497adcada695f" }, "mini.test": { "branch": "main", "commit": "1c4882f339e563d35316d67bb9201bf052d36dfb" }, "neogit": { "branch": "master", "commit": "2b74a777b963dfdeeabfabf84d5ba611666adab4" }, + "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, "neotest-golang": { "branch": "main", "commit": "41cf5e59ca132a5cad599867de3f154429e5c148" }, "neotest-plenary": { "branch": "master", "commit": "dcaf5ed67a9e28a246e9783319e5aa6c9ea1c584" }, "none-ls.nvim": { "branch": "main", "commit": "a8594ef3dabb484adabc0ebbf5800be1b807c9e7" },
M lua/plugins/copilot.lua

@@ -2,7 +2,6 @@ ---@type LazySpec[]

return { { "zbirenbaum/copilot.lua", - dependencies = { "CopilotChat.nvim" }, cmd = "Copilot", build = ":Copilot auth", opts = {

@@ -26,6 +25,7 @@ },

{ "CopilotC-Nvim/CopilotChat.nvim", + dependencies = { "copilot.lua" }, branch = "canary", cmd = { "CopilotChat" }, keys = {
M lua/plugins/neotest.lua

@@ -1,22 +1,19 @@

---@type LazySpec return { "nvim-neotest/neotest", - dev = true, keys = function() - local n = require "neotest" - -- stylua: ignore return { - { "<leader>tn", function() n.run.run() end }, - { "<leader>tt", function() n.run.run(vim.fn.expand "%") end }, - { "<leader>tS", function() n.run.stop() end }, - { "<leader>to", function() n.output.open() end }, - { "<leader>ts", function() n.summary.toggle() end }, - { "<leader>tw", function() n.watch.toggle() end }, - { "]t", function() n.jump.next() end }, - { "[t", function() n.jump.prev() end }, - { "]T", function() n.jump.next {status = "failed"} end }, - { "[T", function() n.jump.prev {status = "failed"} end }, + { "<leader>tn", function() require"neotest".run.run() end }, + { "<leader>tt", function() require"neotest".run.run(vim.fn.expand "%") end }, + { "<leader>tS", function() require"neotest".run.stop() end }, + { "<leader>to", function() require"neotest".output.open() end }, + { "<leader>ts", function() require"neotest".summary.toggle() end }, + { "<leader>tw", function() require"neotest".watch.toggle() end }, + { "]t", function() require"neotest".jump.next() end }, + { "[t", function() require"neotest".jump.prev() end }, + { "]T", function() require"neotest".jump.next { status = "failed" } end }, + { "[T", function() require"neotest".jump.prev { status = "failed" } end }, } end, dependencies = {

@@ -25,38 +22,7 @@ "fredrikaverpil/neotest-golang",

"nvim-neotest/neotest-plenary", "nvim-treesitter", }, - ---@type neotest.Config - ---@diagnostic disable-next-line: missing-fields - opts = { - adapters = function() - return { - require "neotest-plenary", - require "neotest-golang" { - -- go_test_args = { "-count=1", "-timeout=60s" }, - testify_enabled = true, - }, - } - end, - icons = { - expanded = "", - child_prefix = "", - child_indent = "", - final_child_prefix = "", - non_collapsible = "", - collapsed = "", - passed = "", - running = "", - failed = "", - unknown = "", - }, - summary = { - mappings = { - expand = { "l", "h", "<CR>" }, - stop = "s", - }, - }, - }, - init = function() + config = function() vim.diagnostic.config({ virtual_text = { format = function(diagnostic)

@@ -69,5 +35,37 @@ return r

end, }, }, vim.api.nvim_create_namespace "neotest") + + ---@type neotest.Config + ---@diagnostic disable-next-line: missing-fields + require("neotest").setup { + adapters = { + require "neotest-plenary", + require "neotest-golang" { + -- go_test_args = { "-count=1", "-timeout=60s" }, + testify_enabled = true, + }, + }, + icons = { + expanded = "", + child_prefix = "", + child_indent = "", + final_child_prefix = "", + non_collapsible = "", + collapsed = "", + passed = "", + running = "", + failed = "", + unknown = "", + }, + ---@diagnostic disable-next-line: missing-fields + summary = { + ---@diagnostic disable-next-line: missing-fields + mappings = { + expand = { "l", "h", "<CR>" }, + stop = "s", + }, + }, + } end, }
M lua/plugins/telescope.lua

@@ -2,26 +2,26 @@ ---@type LazySpec

return { "nvim-telescope/telescope.nvim", event = "VeryLazy", + cmd = "Telescope", dependencies = { "nvim-telescope/telescope-ui-select.nvim", { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, }, keys = function() - local builtin = require "telescope.builtin" local function grep_string() vim.ui.input({ prompt = "Grep: " }, function(input) - builtin.grep_string { search = input } + require("telescope.builtin").grep_string { search = input } end) end return { - { "<leader>f", builtin.find_files }, - { "<leader>b", builtin.buffers }, - { "<leader>sr", builtin.oldfiles }, - { "<leader>sg", builtin.live_grep }, + { "<leader>f", ":Telescope find_files<cr>" }, + { "<leader>b", ":Telescope buffers<cr>" }, + { "<leader>sr", ":Telescope oldfiles<cr>" }, + { "<leader>sg", ":Telescope live_grep<cr>" }, { "<leader>st", grep_string }, - { "<leader>sd", builtin.diagnostics }, - { "<leader>sh", builtin.help_tags }, + { "<leader>sd", ":Telescope diagnostics<cr>" }, + { "<leader>sh", ":Telescope help_tags<cr>" }, } end, config = function()