refactored plugins and configurations

This commit is contained in:
2026-05-19 18:33:44 -06:00
parent 5c35466664
commit 4137b7424d
14 changed files with 550 additions and 563 deletions

View File

@@ -1,29 +1,13 @@
-- Editor enhancements - Snacks explorer configuration
-- Custom keybindings for file explorer (snacks.nvim built into LazyVim)
--
-- LazyVim provides snacks (explorer, picker, lazygit, terminal), native
-- commenting (Neovim 0.10+), and mini.hipatterns for color preview.
-- This file only adds project-specific overrides on top.
return {
{
"nvim-telescope/telescope.nvim",
opts = {
defaults = {
hidden = true,
file_ignore_patterns = {},
},
pickers = {
find_files = {
hidden = true,
no_ignore = true,
no_ignore_parent = true,
},
live_grep = {
additional_args = function()
return { "--hidden", "--no-ignore" }
end,
},
},
},
},
-- Configure snacks.nvim explorer (already included in LazyVim)
-- ─────────────────────────────────────────────────────────────────────────
-- Snacks: explorer + picker tweaks
-- ─────────────────────────────────────────────────────────────────────────
{
"folke/snacks.nvim",
opts = {
@@ -33,27 +17,22 @@ return {
lazygit = {
enabled = true,
},
input = {
enabled = true,
},
picker = {
enabled = true,
ui_select = true,
sources = {
explorer = {
-- Explorer picker configuration
hidden = true,
ignored = true, -- Show files ignored by .gitignore
ignored = true, -- show .gitignore files too
follow_file = true,
-- Custom keymaps within the explorer
win = {
list = {
keys = {
-- Ctrl+Shift+v - Open in vertical split
-- Ctrl+Shift versions (work in Kitty/WezTerm/Alacritty with the right config)
["<C-S-v>"] = { "edit_vsplit", mode = { "n", "i" } },
-- Ctrl+Shift+h - Open in horizontal split
["<C-S-h>"] = { "edit_split", mode = { "n", "i" } },
-- Alternative mappings (in case terminal doesn't send Ctrl+Shift properly)
-- Plain Ctrl fallbacks for terminals that don't transmit
-- the Shift modifier seperately
["<C-v>"] = { "edit_vsplit", mode = { "n", "i" } },
["<C-x>"] = { "edit_split", mode = { "n", "i" } },
},
@@ -64,30 +43,8 @@ return {
},
},
keys = {
-- Ctrl+Shift+e - Toggle explorer
{
"<C-S-e>",
function()
Snacks.explorer()
end,
desc = "Toggle Explorer",
},
-- Alternative binding if terminal doesn't handle Ctrl+Shift
{
"<leader>fe",
function()
Snacks.explorer()
end,
desc = "File Explorer",
},
-- Lazygit
{
"<leader>gg",
function()
Snacks.lazygit()
end,
desc = "Lazygit",
},
-- Optional Lazygit log/file-history shortcuts - LazyVim's <leader>gg
-- already opens lazygit itself.
{
"<leader>gl",
function()
@@ -104,124 +61,29 @@ return {
},
},
},
-- Which-key for keybinding hints
-- ─────────────────────────────────────────────────────────────────────────
-- Which-key: leader-prefix cheat sheet
-- ─────────────────────────────────────────────────────────────────────────
-- Hold <leader> for ~300ms (timeoutlen) and the group menu appears.
{
"folke/which-key.nvim",
opts = {
spec = {
{ "<leader>a", group = "AI" },
{ "<leader>d", group = "Debug/Database" },
{ "<leader>b", group = "Buffer" },
{ "<leader>c", group = "Code" },
{ "<leader>cg", group = "Go" },
{ "<leader>cgp", group = "Profile" },
{ "<leader>d", group = "Debug" },
{ "<leader>D", group = "Database" },
{ "<leader>f", group = "Find" },
{ "<leader>g", group = "Git" },
{ "<leader>t", group = "Terminal" },
},
},
},
-- Color preview for CSS, HTML, etc.
{
"NvChad/nvim-colorizer.lua",
event = { "BufReadPre", "BufNewFile" },
opts = {
filetypes = {
"css",
"scss",
"sass",
"less",
"html",
"javascript",
"typescript",
"javascriptreact",
"typescriptreact",
"vue",
"svelte",
"lua",
"yaml",
"toml",
"conf",
},
user_default_options = {
RGB = true,
RRGGBB = true,
RRGGBBAA = true,
names = true,
rgb_fn = true,
hsl_fn = true,
css = true,
css_fn = true,
mode = "background",
tailwind = false,
sass = { enable = true, parsers = { "css" } },
virtualtext = "",
always_update = true, -- Update color values even if buffer is not focused
},
},
},
-- Better terminal integration
{
"akinsho/toggleterm.nvim",
version = "*",
opts = {
size = function(term)
if term.direction == "horizontal" then
return 15
elseif term.direction == "vertical" then
return vim.o.columns * 0.4
end
end,
open_mapping = [[<c-\>]],
hide_numbers = true,
shade_filetypes = {},
shade_terminals = true,
shading_factor = 2,
start_in_insert = true,
insert_mappings = true,
persist_size = true,
direction = "float",
close_on_exit = true,
shell = vim.o.shell,
float_opts = {
border = "curved",
winblend = 0,
highlights = {
border = "Normal",
background = "Normal",
},
},
},
},
-- Help comment and uncomment lines
{
"numToStr/Comment.nvim",
opts = {
padding = true,
-- LHS of toggle mappings in NORMAL mode
toggler = {
line = "gcc",
block = "gbc",
},
-- LHS of operator-pending mappings in NORMAL and VISUAL
opleader = {
line = "gc",
block = "gb",
},
-- LHS of extra mappings
extra = {
-- Add comment on the line above
above = "gcO",
-- Add comment on the line below
below = "gco",
-- Add comment at the end of line
eol = "gcA",
},
mappings = {
basic = true,
extra = true,
{ "<leader>o", group = "Overseer" },
{ "<leader>s", group = "Search / Symbols" },
{ "<leader>t", group = "Test" },
{ "<leader>T", group = "Terminal" },
{ "<leader>u", group = "UI / Toggle" },
{ "<leader>x", group = "Diagnostics" },
},
},
},