diff --git a/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/README.md b/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/README.md new file mode 100644 index 000000000..c2b0a9930 --- /dev/null +++ b/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/README.md @@ -0,0 +1,7 @@ +# snacks.statuscolumn + +Pretty status column + +**Repository:** + +_Note_: This also disables the Heirline based statuscolumn. diff --git a/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/init.lua b/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/init.lua new file mode 100644 index 000000000..87d5d0a10 --- /dev/null +++ b/lua/astrocommunity/bars-and-lines/snacks-statuscolumn/init.lua @@ -0,0 +1,13 @@ +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { statuscolumn = {} }, + specs = { + { + "rebelot/heirline.nvim", + optional = true, + opts = { statuscolumn = false }, + }, + }, +} diff --git a/lua/astrocommunity/cursorline/snacks-words/README.md b/lua/astrocommunity/cursorline/snacks-words/README.md new file mode 100644 index 000000000..5c8e00d76 --- /dev/null +++ b/lua/astrocommunity/cursorline/snacks-words/README.md @@ -0,0 +1,5 @@ +# snacks.words + +Auto-show LSP references and quickly navigate between them + +**Repository:** diff --git a/lua/astrocommunity/cursorline/snacks-words/init.lua b/lua/astrocommunity/cursorline/snacks-words/init.lua new file mode 100644 index 000000000..68746ace5 --- /dev/null +++ b/lua/astrocommunity/cursorline/snacks-words/init.lua @@ -0,0 +1,21 @@ +---@type LazySpec +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { words = { enabled = true } }, + specs = { + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["]r"] = { function() require("snacks").words.jump(vim.v.count1) end, desc = "Next Reference" }, + ["[r"] = { function() require("snacks").words.jump(-vim.v.count1) end, desc = "Prev Reference" }, + }, + }, + }, + }, + { "RRethy/vim-illuminate", enabled = false }, + }, +} diff --git a/lua/astrocommunity/editing-support/snacks-bigfile/README.md b/lua/astrocommunity/editing-support/snacks-bigfile/README.md new file mode 100644 index 000000000..76fee6a35 --- /dev/null +++ b/lua/astrocommunity/editing-support/snacks-bigfile/README.md @@ -0,0 +1,9 @@ +# snacks.bigfile + +`bigfile` adds a new filetype `bigfile` to Neovim that triggers when the file is +larger than the configured size. This automatically prevents things like LSP +and Treesitter attaching to the buffer. + +**Repository:** + +_Note_: This plugin will also disable the build in `large_buf` feature in AstroCore diff --git a/lua/astrocommunity/editing-support/snacks-bigfile/init.lua b/lua/astrocommunity/editing-support/snacks-bigfile/init.lua new file mode 100644 index 000000000..8c76d12a9 --- /dev/null +++ b/lua/astrocommunity/editing-support/snacks-bigfile/init.lua @@ -0,0 +1,12 @@ +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { bigfile = { enabled = true } }, + specs = { + { + "AstroNvim/astrocore", + opts = { features = { large_buf = false } } --[[@as AstroCoreOpts]], + }, + }, +} diff --git a/lua/astrocommunity/git/snacks-lazygit/README.md b/lua/astrocommunity/git/snacks-lazygit/README.md new file mode 100644 index 000000000..2fe65cefa --- /dev/null +++ b/lua/astrocommunity/git/snacks-lazygit/README.md @@ -0,0 +1,5 @@ +# snacks.lazygit + +Automatically configures lazygit with a theme generated based on your Neovim colorscheme and integrate edit with the current neovim instance. + +**Repository:** diff --git a/lua/astrocommunity/git/snacks-lazygit/init.lua b/lua/astrocommunity/git/snacks-lazygit/init.lua new file mode 100644 index 000000000..205866759 --- /dev/null +++ b/lua/astrocommunity/git/snacks-lazygit/init.lua @@ -0,0 +1,29 @@ +---@type LazySpec +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { lazygit = { configure = true } }, + specs = { + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["gg"] = { function() require("snacks").lazygit() end, desc = "Lazygit" }, + ["tl"] = { function() require("snacks").lazygit() end, desc = "Lazygit" }, + ["gf"] = { + function() require("snacks").lazygit.log_file() end, + desc = "Lazygit Current File History", + }, + ["gl"] = { function() require("snacks").lazygit.log() end, desc = "Lazygit Log (cwd)" }, + }, + }, + }, + }, + { + "AstroNvim/astroui", + opts = { lazygit = false } --[[@as AstroUIOpts]], + }, + }, +} diff --git a/lua/astrocommunity/terminal-integration/snacks-terminal/README.md b/lua/astrocommunity/terminal-integration/snacks-terminal/README.md new file mode 100644 index 000000000..bc0ef918d --- /dev/null +++ b/lua/astrocommunity/terminal-integration/snacks-terminal/README.md @@ -0,0 +1,5 @@ +# snacks.terminal + +Create and toggle terminal windows. + +**Repository:** diff --git a/lua/astrocommunity/terminal-integration/snacks-terminal/init.lua b/lua/astrocommunity/terminal-integration/snacks-terminal/init.lua new file mode 100644 index 000000000..835f167e8 --- /dev/null +++ b/lua/astrocommunity/terminal-integration/snacks-terminal/init.lua @@ -0,0 +1,36 @@ +---@type LazySpec +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { words = { enabled = true } }, + specs = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local Snacks = require "snacks" + local maps = opts.mappings + + if vim.fn.executable "node" == 1 then + maps.n["tn"] = { function() Snacks.terminal "node" end, desc = "ToggleTerm node" } + end + local python = vim.fn.executable "python" == 1 and "python" or vim.fn.executable "python3" == 1 and "python3" + if python then + maps.n["tp"] = { function() Snacks.terminal "python" end, desc = "ToggleTerm python" } + end + if vim.fn.executable "btm" == 1 then + maps.n["tb"] = { function() Snacks.terminal "btm" end, desc = "ToggleTerm bottom" } + end + local gdu = vim.fn.has "mac" == 1 and "gdu-go" or "gdu" + if vim.fn.has "win32" == 1 and vim.fn.executable(gdu) ~= 1 then gdu = "gdu_windows_amd64.exe" end + if vim.fn.executable(gdu) == 1 then + maps.n["tu"] = { function() Snacks.terminal { "gdu" } end, desc = "ToggleTerm gdu" } + end + maps.n["th"] = { function() Snacks.terminal() end, desc = "Toggle Terminal" } + maps.n["tf"] = { function() Snacks.terminal() end, desc = "Toggle Terminal Float" } + maps.n["to"] = { function() Snacks.terminal "execute v:count ." end, desc = "Toggle Terminal" } + end, + }, + { "RRethy/vim-illuminate", enabled = false }, + }, +} diff --git a/lua/astrocommunity/utility/snacks-notifier/README.md b/lua/astrocommunity/utility/snacks-notifier/README.md new file mode 100644 index 000000000..58f00ff31 --- /dev/null +++ b/lua/astrocommunity/utility/snacks-notifier/README.md @@ -0,0 +1,5 @@ +# snacks.notifier + +Utility functions to work with Neovim's `vim.notify` + +**Repository:** diff --git a/lua/astrocommunity/utility/snacks-notifier/init.lua b/lua/astrocommunity/utility/snacks-notifier/init.lua new file mode 100644 index 000000000..c0fb64acc --- /dev/null +++ b/lua/astrocommunity/utility/snacks-notifier/init.lua @@ -0,0 +1,39 @@ +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = function(_, opts) + local get_icon = require("astroui").get_icon + return require("astrocore").extend_tbl(opts, { + notifier = { + timeout = 3000, + icons = { + DEBUG = get_icon "Debugger", + ERROR = get_icon "DiagnosticError", + INFO = get_icon "DiagnosticInfo", + TRACE = get_icon "DiagnosticHint", + WARN = get_icon "DiagnosticWarn", + }, + }, + styles = { + notification = { + wo = { wrap = true }, -- Wrap notifications + }, + }, + }) + end, + specs = { + { + "AstroNvim/astrocore", + opts = { + mappings = { + n = { + ["uD"] = { function() require("snacks.notifier").hide() end, desc = "Dismiss notifications" }, + ["fn"] = { function() require("snacks").picker.notifications() end, desc = "Find notifications" }, + }, + }, + }, + }, + { "rcarriga/nvim-notify", enabled = false }, + }, +} diff --git a/lua/astrocommunity/utility/snacks-nvim/README.md b/lua/astrocommunity/utility/snacks-nvim/README.md new file mode 100644 index 000000000..72adfd4da --- /dev/null +++ b/lua/astrocommunity/utility/snacks-nvim/README.md @@ -0,0 +1,14 @@ +# snacks.nvim + +A collection of useful utilities for Neovim + +**Repository:** + +## Features + +- Bigfile support +- Notifier with customizable timeout +- Quickfile support +- Statuscolumn support +- Words support +- Customizable styles for notifications diff --git a/lua/astrocommunity/utility/snacks-nvim/init.lua b/lua/astrocommunity/utility/snacks-nvim/init.lua new file mode 100644 index 000000000..a3089c0f4 --- /dev/null +++ b/lua/astrocommunity/utility/snacks-nvim/init.lua @@ -0,0 +1,44 @@ +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + dependencies = { + { + "AstroNvim/astrocore", + opts = function(_, opts) + local Snacks = require "snacks" + local maps = opts.mappings + + opts.autocmds.snacks_toggle = { + event = "User", + pattern = "VeryLazy", + callback = function() + -- Setup some globals for debugging (lazy-loaded) + _G.dd = function(...) Snacks.debug.inspect(...) end + _G.bt = function() Snacks.debug.backtrace() end + vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option("spell", { name = "Spelling" }):map "us" + Snacks.toggle.option("wrap", { name = "Wrap" }):map "uw" + Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map "uL" + Snacks.toggle.diagnostics():map "ud" + Snacks.toggle.line_number():map "ul" + Snacks.toggle + .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) + :map "uc" + Snacks.toggle.treesitter():map "uT" + Snacks.toggle + .option("background", { off = "light", on = "dark", name = "Dark Background" }) + :map "ub" + Snacks.toggle.inlay_hints():map "uh" + end, + } + maps.n["bd"] = { function() Snacks.bufdelete() end, desc = "Delete Buffer" } + maps.n["gb"] = { function() Snacks.git.blame_line() end, desc = "Git Blame Line" } + maps.n["gB"] = { function() Snacks.gitbrowse() end, desc = "Git Browse" } + maps.n["cR"] = { function() Snacks.rename() end, desc = "Rename File" } + end, + }, + }, +} diff --git a/lua/astrocommunity/utility/snacks-quickfile/README.md b/lua/astrocommunity/utility/snacks-quickfile/README.md new file mode 100644 index 000000000..a3a4a5a3f --- /dev/null +++ b/lua/astrocommunity/utility/snacks-quickfile/README.md @@ -0,0 +1,5 @@ +# snacks.quickfile + +When doing `nvim somefile.txt`, it will render the file as quickly as possible, before loading your plugins. + +**Repository:** diff --git a/lua/astrocommunity/utility/snacks-quickfile/init.lua b/lua/astrocommunity/utility/snacks-quickfile/init.lua new file mode 100644 index 000000000..91111a554 --- /dev/null +++ b/lua/astrocommunity/utility/snacks-quickfile/init.lua @@ -0,0 +1,6 @@ +return { + "folke/snacks.nvim", + priority = 10000, + lazy = false, + opts = { quickfile = {} }, +}