diff --git a/lua/custom/plugins/check.lua b/lua/custom/plugins/check.lua new file mode 100644 index 00000000..368d516a --- /dev/null +++ b/lua/custom/plugins/check.lua @@ -0,0 +1,33 @@ +local function check() + vim.health.report_start() + + if vim.fn.has 'nvim-0.8.0' == 1 then + vim.health.report_ok 'Using Neovim >= 0.8.0' + else + vim.health.report_error 'Neovim >= 0.8.0 is required' + end + + for _, cmd in ipairs { 'git', 'rg', { 'fd', 'fdfind' }, 'lazygit' } do + local name = type(cmd) == 'string' and cmd or vim.inspect(cmd) + local commands = type(cmd) == 'string' and { cmd } or cmd + ---@cast commands string[] + local found = false + + for _, c in ipairs(commands) do + if vim.fn.executable(c) == 1 then + name = c + found = true + end + end + + if found then + vim.health.report_ok(('`%s` is installed'):format(name)) + else + vim.health.report_warn(('`%s` is not installed'):format(name)) + end + end +end + +vim.api.nvim_create_user_command('Check', check, {}) + +return {} diff --git a/lua/custom/plugins/cmp-nvim-lsp.lua b/lua/custom/plugins/cmp-nvim-lsp.lua new file mode 100644 index 00000000..767312c3 --- /dev/null +++ b/lua/custom/plugins/cmp-nvim-lsp.lua @@ -0,0 +1,3 @@ +return { + "hrsh7th/cmp-nvim-lsp", +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua index 07ba4431..1951b490 100644 --- a/lua/custom/plugins/copilot.lua +++ b/lua/custom/plugins/copilot.lua @@ -1,3 +1,12 @@ return { - "github/copilot.vim" -} \ No newline at end of file + "zbirenbaum/copilot.lua", + cmd = "Copilot", + dependencies = { + "github/copilot.vim" + }, + build = ":Copilot auth", + opts = { + suggestion = { enabled = false }, + panel = { enabled = false }, + }, +} diff --git a/lua/custom/plugins/flit.lua b/lua/custom/plugins/flit.lua new file mode 100644 index 00000000..c61e8a29 --- /dev/null +++ b/lua/custom/plugins/flit.lua @@ -0,0 +1,12 @@ +return { + "ggandor/flit.nvim", + keys = function() + ---@type LazyKeys[] + local ret = {} + for _, key in ipairs({ "f", "F", "t", "T" }) do + ret[#ret + 1] = { key, mode = { "n", "x", "o" }, desc = key } + end + return ret + end, + opts = { labeled_modes = "nx" }, +} diff --git a/lua/custom/plugins/health.lua b/lua/custom/plugins/health.lua deleted file mode 100644 index f0b67a60..00000000 --- a/lua/custom/plugins/health.lua +++ /dev/null @@ -1,33 +0,0 @@ -local function health() - vim.health.report_start() - - if vim.fn.has("nvim-0.8.0") == 1 then - vim.health.report_ok("Using Neovim >= 0.8.0") - else - vim.health.report_error("Neovim >= 0.8.0 is required") - end - - for _, cmd in ipairs({ "git", "rg", { "fd", "fdfind" }, "lazygit" }) do - local name = type(cmd) == "string" and cmd or vim.inspect(cmd) - local commands = type(cmd) == "string" and { cmd } or cmd - ---@cast commands string[] - local found = false - - for _, c in ipairs(commands) do - if vim.fn.executable(c) == 1 then - name = c - found = true - end - end - - if found then - vim.health.report_ok(("`%s` is installed"):format(name)) - else - vim.health.report_warn(("`%s` is not installed"):format(name)) - end - end -end - -vim.api.nvim_create_user_command("Health", health, {}) - -return {} diff --git a/lua/custom/plugins/leap.lua b/lua/custom/plugins/leap.lua new file mode 100644 index 00000000..e00ba712 --- /dev/null +++ b/lua/custom/plugins/leap.lua @@ -0,0 +1,17 @@ +return { + "ggandor/leap.nvim", + keys = { + { "s", mode = { "n", "x", "o" }, desc = "Leap forward to" }, + { "S", mode = { "n", "x", "o" }, desc = "Leap backward to" }, + { "gs", mode = { "n", "x", "o" }, desc = "Leap from windows" }, + }, + config = function(_, opts) + local leap = require("leap") + for k, v in pairs(opts) do + leap.opts[k] = v + end + leap.add_default_mappings(true) + vim.keymap.del({ "x", "o" }, "x") + vim.keymap.del({ "x", "o" }, "X") + end, +} diff --git a/lua/custom/plugins/neoconf.lua b/lua/custom/plugins/neoconf.lua new file mode 100644 index 00000000..a1eafcfe --- /dev/null +++ b/lua/custom/plugins/neoconf.lua @@ -0,0 +1 @@ +return { "folke/neoconf.nvim", cmd = "Neoconf", config = true } diff --git a/lua/custom/plugins/neodev.lua b/lua/custom/plugins/neodev.lua new file mode 100644 index 00000000..5e1119ab --- /dev/null +++ b/lua/custom/plugins/neodev.lua @@ -0,0 +1 @@ +return { "folke/neodev.nvim", opts = { experimental = { pathStrict = true } } } diff --git a/lua/custom/plugins/null-ls.lua b/lua/custom/plugins/null-ls.lua new file mode 100644 index 00000000..f6e8c1d4 --- /dev/null +++ b/lua/custom/plugins/null-ls.lua @@ -0,0 +1,18 @@ +return { + "jose-elias-alvarez/null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { "mason.nvim" }, + opts = function() + local nls = require("null-ls") + return { + root_dir = require("null-ls.utils").root_pattern(".null-ls-root", ".neoconf.json", "Makefile", ".git"), + sources = { + nls.builtins.formatting.fish_indent, + nls.builtins.diagnostics.fish, + nls.builtins.formatting.stylua, + nls.builtins.formatting.shfmt, + nls.builtins.diagnostics.flake8, + }, + } + end, +} diff --git a/lua/custom/plugins/todo-comments.lua b/lua/custom/plugins/todo-comments.lua new file mode 100644 index 00000000..c78a0840 --- /dev/null +++ b/lua/custom/plugins/todo-comments.lua @@ -0,0 +1,14 @@ +return { + "folke/todo-comments.nvim", + cmd = { "TodoTrouble", "TodoTelescope" }, + event = { "BufReadPost", "BufNewFile" }, + config = true, + -- stylua: ignore + keys = { + { "]t", function() require("todo-comments").jump_next() end, desc = "Next todo comment" }, + { "[t", function() require("todo-comments").jump_prev() end, desc = "Previous todo comment" }, + { "xt", "TodoTrouble", desc = "Todo (Trouble)" }, + { "xT", "TodoTrouble keywords=TODO,FIX,FIXME", desc = "Todo/Fix/Fixme (Trouble)" }, + { "st", "TodoTelescope", desc = "Todo" }, + }, +} diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000..909b827c --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,33 @@ +return { + "folke/trouble.nvim", + cmd = { "TroubleToggle", "Trouble" }, + opts = { use_diagnostic_signs = true }, + keys = { + { "xx", "TroubleToggle document_diagnostics", desc = "Document Diagnostics (Trouble)" }, + { "xX", "TroubleToggle workspace_diagnostics", desc = "Workspace Diagnostics (Trouble)" }, + { "xL", "TroubleToggle loclist", desc = "Location List (Trouble)" }, + { "xQ", "TroubleToggle quickfix", desc = "Quickfix List (Trouble)" }, + { + "[q", + function() + if require("trouble").is_open() then + require("trouble").previous({ skip_groups = true, jump = true }) + else + vim.cmd.cprev() + end + end, + desc = "Previous trouble/quickfix item", + }, + { + "]q", + function() + if require("trouble").is_open() then + require("trouble").next({ skip_groups = true, jump = true }) + else + vim.cmd.cnext() + end + end, + desc = "Next trouble/quickfix item", + }, + }, +} diff --git a/lua/custom/plugins/vim-repeat.lua b/lua/custom/plugins/vim-repeat.lua new file mode 100644 index 00000000..bfd67423 --- /dev/null +++ b/lua/custom/plugins/vim-repeat.lua @@ -0,0 +1 @@ +return { 'tpope/vim-repeat' } diff --git a/lua/custom/plugins/vim-startuptime.lua b/lua/custom/plugins/vim-startuptime.lua new file mode 100644 index 00000000..1779432b --- /dev/null +++ b/lua/custom/plugins/vim-startuptime.lua @@ -0,0 +1,7 @@ +return { + 'dstein64/vim-startuptime', + cmd = 'StartupTime', + config = function() + vim.g.startuptime_tries = 10 + end, +}