diff --git a/lua/astrocommunity/debugging/nvim-dap-view/README.md b/lua/astrocommunity/debugging/nvim-dap-view/README.md new file mode 100644 index 000000000..085952e3a --- /dev/null +++ b/lua/astrocommunity/debugging/nvim-dap-view/README.md @@ -0,0 +1,5 @@ +# nvim-dap-view + +minimalistic nvim-dap-ui alternative + +**Repository:** diff --git a/lua/astrocommunity/debugging/nvim-dap-view/init.lua b/lua/astrocommunity/debugging/nvim-dap-view/init.lua new file mode 100644 index 000000000..d10c59340 --- /dev/null +++ b/lua/astrocommunity/debugging/nvim-dap-view/init.lua @@ -0,0 +1,28 @@ +return { + "igorlfs/nvim-dap-view", + lazy = true, + opts = {}, + specs = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local maps = opts.mappings + maps.n["d"] = vim.tbl_get(opts, "_map_sections", "d") + maps.n["dE"] = { function() require("dap-view").add_expr() end, desc = "Add expression" } + maps.n["du"] = { function() require("dap-view").toggle() end, desc = "Toggle Debugger UI" } + end, + }, + { + "mfussenegger/nvim-dap", + optional = true, + dependencies = "igorlfs/nvim-dap-view", + opts = function() + local dap, dap_view = require "dap", require "dap-view" + dap.listeners.after.event_initialized.dapview_config = function() dap_view.open() end + dap.listeners.before.event_terminated.dapview_config = function() dap_view.close() end + dap.listeners.before.event_exited.dapview_config = function() dap_view.close() end + end, + }, + { "rcarriga/nvim-dap-ui", enabled = false }, + }, +} diff --git a/lua/astrocommunity/editing-support/conform-nvim/init.lua b/lua/astrocommunity/editing-support/conform-nvim/init.lua index ce95b0deb..fac758698 100644 --- a/lua/astrocommunity/editing-support/conform-nvim/init.lua +++ b/lua/astrocommunity/editing-support/conform-nvim/init.lua @@ -33,6 +33,7 @@ return { mappings = { n = { ["lf"] = { function() vim.cmd.Format() end, desc = "Format buffer" }, + ["lc"] = { function() vim.cmd.ConformInfo() end, desc = "Conform information" }, ["uf"] = { function() if vim.b.autoformat == nil then diff --git a/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua b/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua index 3439cd1fb..27c59dc08 100644 --- a/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua +++ b/lua/astrocommunity/editing-support/copilotchat-nvim/init.lua @@ -25,7 +25,6 @@ return { dependencies = { { "zbirenbaum/copilot.lua" }, { "nvim-lua/plenary.nvim" }, - { "nvim-telescope/telescope.nvim" }, { "AstroNvim/astrocore", ---@param opts AstroCoreOpts @@ -71,9 +70,14 @@ return { -- Helper function to create mappings local function create_mapping(action_type, selection_type) return function() - require("CopilotChat.integrations.telescope").pick(require("CopilotChat.actions")[action_type] { - selection = require("CopilotChat.select")[selection_type], - }) + local fzf_ok = pcall(require, "fzf-lua") + local snacks_ok = pcall(require, "snacks") + + require("CopilotChat.integrations." .. (fzf_ok and "fzflua" or snacks_ok and "snacks" or "telescope")).pick( + require("CopilotChat.actions")[action_type] { + selection = require("CopilotChat.select")[selection_type], + } + ) end end diff --git a/lua/astrocommunity/fuzzy-finder/fzf-lua/init.lua b/lua/astrocommunity/fuzzy-finder/fzf-lua/init.lua index 32a0300d6..c98cae787 100644 --- a/lua/astrocommunity/fuzzy-finder/fzf-lua/init.lua +++ b/lua/astrocommunity/fuzzy-finder/fzf-lua/init.lua @@ -13,7 +13,9 @@ return { local maps = opts.mappings maps.n["lD"] = { function() require("fzf-lua").diagnostics_document() end, desc = "Search diagnostics" } - if maps.n.gd then maps.n.gd[1] = function() require("fzf-lua").lsp_definitions() end end + if maps.n.gd then + maps.n.gd[1] = function() require("fzf-lua").lsp_definitions { jump_to_single_result = true } end + end if maps.n.gI then maps.n.gI[1] = function() require("fzf-lua").lsp_implementations() end end if maps.n["lR"] then maps.n["lR"][1] = function() require("fzf-lua").lsp_references() end end if maps.n.gy then maps.n.gy[1] = function() require("fzf-lua").lsp_typedefs() end end @@ -63,5 +65,20 @@ return { end, }, }, - opts = { "default-title" }, + opts = { + "default-title", + keymap = { + builtin = { + true, + [""] = "preview-page-down", + [""] = "preview-page-up", + }, + fzf = { + true, + ["ctrl-d"] = "preview-page-down", + ["ctrl-u"] = "preview-page-up", + ["ctrl-q"] = "select-all+accept", + }, + }, + }, } diff --git a/lua/astrocommunity/fuzzy-finder/snacks-picker/README.md b/lua/astrocommunity/fuzzy-finder/snacks-picker/README.md new file mode 100644 index 000000000..d533e50d5 --- /dev/null +++ b/lua/astrocommunity/fuzzy-finder/snacks-picker/README.md @@ -0,0 +1,5 @@ +# snacks.picker + +Snacks now comes with a modern fuzzy-finder to navigate the Neovim universe. + +**Repository:** diff --git a/lua/astrocommunity/fuzzy-finder/snacks-picker/init.lua b/lua/astrocommunity/fuzzy-finder/snacks-picker/init.lua new file mode 100644 index 000000000..defac63d7 --- /dev/null +++ b/lua/astrocommunity/fuzzy-finder/snacks-picker/init.lua @@ -0,0 +1,119 @@ +return { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { picker = { ui_select = true } }, + specs = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local maps = opts.mappings + local astro = require "astrocore" + maps.n["f"] = vim.tbl_get(opts, "_map_sections", "f") + if vim.fn.executable "git" == 1 then + maps.n["g"] = vim.tbl_get(opts, "_map_sections", "g") + maps.n["gb"] = { function() require("snacks").picker.git_branches() end, desc = "Git branches" } + maps.n["gc"] = { + function() require("snacks").picker.git_log() end, + desc = "Git commits (repository)", + } + maps.n["gC"] = { + function() require("snacks").picker.git_log { current_file = true, follow = true } end, + desc = "Git commits (current file)", + } + maps.n["gt"] = { function() require("snacks").picker.git_status() end, desc = "Git status" } + end + maps.n["f"] = { function() require("snacks").picker.resume() end, desc = "Resume previous search" } + maps.n["f'"] = { function() require("snacks").picker.marks() end, desc = "Find marks" } + maps.n["fl"] = { + function() require("snacks").picker.lines() end, + desc = "Find lines", + } + maps.n["fa"] = { + function() require("snacks").picker.files { dirs = { vim.fn.stdpath "config" }, desc = "Config Files" } end, + desc = "Find AstroNvim config files", + } + maps.n["fb"] = { function() require("snacks").picker.buffers() end, desc = "Find buffers" } + maps.n["fc"] = { function() require("snacks").picker.grep_word() end, desc = "Find word under cursor" } + maps.n["fC"] = { function() require("snacks").picker.commands() end, desc = "Find commands" } + maps.n["ff"] = { + function() + require("snacks").picker.files { + hidden = vim.tbl_get((vim.uv or vim.loop).fs_stat ".git" or {}, "type") == "directory", + } + end, + desc = "Find files", + } + maps.n["fF"] = { + function() require("snacks").picker.files { hidden = true, ignored = true } end, + desc = "Find all files", + } + maps.n["fg"] = { function() require("snacks").picker.git_files() end, desc = "Find git files" } + maps.n["fh"] = { function() require("snacks").picker.help() end, desc = "Find help" } + maps.n["fk"] = { function() require("snacks").picker.keymaps() end, desc = "Find keymaps" } + maps.n["fm"] = { function() require("snacks").picker.man() end, desc = "Find man" } + if astro.plugin_opts("snacks.nvim").notifier then + maps.n["fn"] = + { function() require("snacks").picker.notifications() end, desc = "Find notifications" } + end + maps.n["fo"] = { function() require("snacks").picker.recent() end, desc = "Find old files" } + maps.n["fO"] = + { function() require("snacks").picker.recent { filter = { cwd = true } } end, desc = "Find old files (cwd)" } + maps.n["fr"] = { function() require("snacks").picker.registers() end, desc = "Find registers" } + maps.n["fs"] = { function() require("snacks").picker.smart() end, desc = "Find buffers/recent/files" } + maps.n["ft"] = { function() require("snacks").picker.colorschemes() end, desc = "Find themes" } + if vim.fn.executable "rg" == 1 then + maps.n["fw"] = { function() require("snacks").picker.grep() end, desc = "Find words" } + maps.n["fW"] = { + function() require("snacks").picker.grep { hidden = true, ignored = true } end, + desc = "Find words in all files", + } + end + maps.n["lD"] = { function() require("snacks").picker.diagnostics() end, desc = "Search diagnostics" } + maps.n["ls"] = { function() require("snacks").picker.lsp_symbols() end, desc = "Search symbols" } + end, + }, + { + "folke/todo-comments.nvim", + optional = true, + dependencies = { "folke/snacks.nvim" }, + specs = { + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["fT"] = { + function() + if not package.loaded["todo-comments"] then -- make sure to load todo-comments + require("lazy").load { plugins = { "todo-comments.nvim" } } + end + require("snacks").picker.todo_comments() + end, + desc = "Todo Comments", + }, + }, + }, + }, + }, + }, + }, + { + "nvim-neo-tree/neo-tree.nvim", + optional = true, + opts = { + commands = { + find_in_dir = function(state) + local node = state.tree:get_node() + local path = node.type == "file" and node:get_parent_id() or node:get_id() + require("snacks").picker.files { cwd = path } + end, + }, + window = { mappings = { F = "find_in_dir" } }, + }, + }, + { "nvim-telescope/telescope.nvim", enabled = false }, + { "stevearc/dressing.nvim", opts = { select = { enabled = false } } }, + }, +} diff --git a/lua/astrocommunity/markdown-and-latex/markview-nvim/init.lua b/lua/astrocommunity/markdown-and-latex/markview-nvim/init.lua index f0fe17b4e..02e24a8e7 100644 --- a/lua/astrocommunity/markdown-and-latex/markview-nvim/init.lua +++ b/lua/astrocommunity/markdown-and-latex/markview-nvim/init.lua @@ -15,7 +15,9 @@ return { end, }, opts = { - hybrid_modes = { "n" }, - headings = { shift_width = 0 }, + preview = { + hybrid_modes = { "n" }, + headings = { shift_width = 0 }, + }, }, } diff --git a/lua/astrocommunity/media/cord-nvim/README.md b/lua/astrocommunity/media/cord-nvim/README.md index 96eebc167..cb0d34910 100644 --- a/lua/astrocommunity/media/cord-nvim/README.md +++ b/lua/astrocommunity/media/cord-nvim/README.md @@ -1,5 +1,5 @@ # cord.nvim -🚀 Discord Rich Presence plugin for Neovim written in Rust +🚀 Discord Rich Presence for Neovim **Repository:** diff --git a/lua/astrocommunity/media/cord-nvim/init.lua b/lua/astrocommunity/media/cord-nvim/init.lua index addbfa618..983485b21 100644 --- a/lua/astrocommunity/media/cord-nvim/init.lua +++ b/lua/astrocommunity/media/cord-nvim/init.lua @@ -1,6 +1,7 @@ return { "vyfor/cord.nvim", - build = vim.fn.has "win32" == 0 and "./build" or ".\\build", + version = "^2", + build = ":Cord update", event = "VeryLazy", opts = { editor = { @@ -8,7 +9,7 @@ return { tooltip = "An aesthetically pleasing and feature-rich Neovim configuration", }, buttons = { - { label = "View Repository", url = "git" }, + { label = "View Repository", url = function(opts) return opts.repo_url end }, { label = "View AstroNvim", url = "https://astronvim.com" }, }, }, diff --git a/lua/astrocommunity/pack/bash/init.lua b/lua/astrocommunity/pack/bash/init.lua index 4135dc810..bcedae453 100644 --- a/lua/astrocommunity/pack/bash/init.lua +++ b/lua/astrocommunity/pack/bash/init.lua @@ -45,7 +45,16 @@ return { optional = true, opts = { formatters_by_ft = { - sh = { "shfmt" }, + sh = { "shfmt", "shellcheck" }, + }, + }, + }, + { + "mfussenegger/nvim-lint", + optional = true, + opts = { + linters_by_ft = { + sh = { "shellcheck" }, }, }, }, diff --git a/lua/astrocommunity/pack/rust/init.lua b/lua/astrocommunity/pack/rust/init.lua index 936549e40..20478fbca 100644 --- a/lua/astrocommunity/pack/rust/init.lua +++ b/lua/astrocommunity/pack/rust/init.lua @@ -20,6 +20,13 @@ local pack = { rust_analyzer = { settings = { ["rust-analyzer"] = { + files = { + excludeDirs = { + ".direnv", + ".git", + "target", + }, + }, check = { command = "clippy", extraArgs = {