style(nvim): improve code readability in community.lua

This commit is contained in:
Prad Nukala committed 2025-10-13 15:18:58 -04:00
1 parent 65b4d2bbc7
commit 2068e2afd4
4 files changed
+99 -65

No files matched your search

+1
View File
@@ -22,6 +22,7 @@ return {
{ import = "astrocommunity.pack.tailwindcss" },
{ import = "astrocommunity.pack.typescript-all-in-one" },
{ import = "astrocommunity.pack.yaml" },
{ import = "astrocommunity.utility.noice-nvim" },
{ import = "astrocommunity.git.octo-nvim" },
{ import = "astrocommunity.bars-and-lines.bufferline-nvim" },
{ import = "astrocommunity.code-runner.overseer-nvim" },
+48
View File
@@ -417,6 +417,54 @@ return {
["<C-e>"] = { "<Cmd>Neotree toggle<CR>", desc = "Open Explorer" },
["<C-c>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" }, -- Modified to save and close buffer
["<C-x>"] = { "<Cmd>w<CR><Cmd>bd<CR>", desc = "Save and close buffer" }, -- Added C-x for visual mode
["D"] = {
function()
-- Yank the visual selection to register v
vim.cmd 'normal! "vy'
local selection = vim.fn.getreg "v"
-- Escape special regex characters
local escaped = vim.fn.escape(selection, [[/\.*$^~[]])
-- Delete all occurrences in the buffer (e flag suppresses errors if no match)
vim.cmd(string.format([[%%s/%s//ge]], escaped))
-- Show notification of what was deleted
vim.notify(string.format("Deleted all occurrences of: %s", selection), vim.log.levels.INFO)
end,
desc = "Delete all occurrences of selected text",
},
["R"] = {
function()
-- Yank the visual selection to register v
vim.cmd 'normal! "vy'
local selection = vim.fn.getreg "v"
-- Escape special regex characters for search pattern
local escaped = vim.fn.escape(selection, [[/\.*$^~[]])
-- Show input prompt using snacks.input
require("snacks").input({
prompt = string.format("Replace '%s' with:", selection),
default = "",
}, function(replacement)
if replacement then
-- Escape special characters for replacement string
local escaped_replacement = vim.fn.escape(replacement, [[/\&~]])
-- Replace all occurrences in the buffer
vim.cmd(string.format([[%%s/%s/%s/ge]], escaped, escaped_replacement))
-- Show notification
vim.notify(
string.format("Replaced '%s' with '%s'", selection, replacement),
vim.log.levels.INFO
)
end
end)
end,
desc = "Replace all occurrences of selected text",
},
},
t = {
["<C-t><C-t>"] = { terminals.mk_toggle, desc = "Taskfile Toggle" },
-4
View File
@@ -110,10 +110,6 @@ if ok_overseer then
}
end
require("inc_rename").setup {
input_buffer_type = "snacks",
}
require("cyberdream").setup {
variant = "default", -- use "light" for the light variant. Also accepts "auto" to set dark or light colors based on the current value of `vim.o.background`
transparent = true,