-- Editor enhancements - Snacks explorer configuration -- Custom keybindings for file explorer (snacks.nvim built into LazyVim) return { -- Configure snacks.nvim explorer (already included in LazyVim) { "folke/snacks.nvim", opts = { explorer = { replace_netrw = true, }, lazygit = { enabled = true, }, picker = { sources = { explorer = { -- Explorer picker configuration hidden = true, ignored = true, -- Show files ignored by .gitignore follow_file = true, -- Custom keymaps within the explorer win = { list = { keys = { -- Ctrl+Shift+v - Open in vertical split [""] = { "edit_vsplit", mode = { "n", "i" } }, -- Ctrl+Shift+h - Open in horizontal split [""] = { "edit_split", mode = { "n", "i" } }, -- Alternative mappings (in case terminal doesn't send Ctrl+Shift properly) [""] = { "edit_vsplit", mode = { "n", "i" } }, [""] = { "edit_split", mode = { "n", "i" } }, }, }, }, }, }, }, }, keys = { -- Ctrl+Shift+e - Toggle explorer { "", function() Snacks.explorer() end, desc = "Toggle Explorer" }, -- Alternative binding if terminal doesn't handle Ctrl+Shift { "fe", function() Snacks.explorer() end, desc = "File Explorer" }, -- Lazygit { "gg", function() Snacks.lazygit() end, desc = "Lazygit" }, { "gl", function() Snacks.lazygit.log() end, desc = "Lazygit Log" }, { "gf", function() Snacks.lazygit.log_file() end, desc = "Lazygit File History" }, }, }, -- Which-key for keybinding hints { "folke/which-key.nvim", opts = { spec = { { "a", group = "AI" }, { "d", group = "Debug/Database" }, { "g", group = "Git" }, { "t", group = "Terminal" }, }, }, }, -- Color preview for CSS, HTML, etc. { "norcalli/nvim-colorizer.lua", event = { "BufReadPre", "BufNewFile" }, config = function() require("colorizer").setup({ "css", "scss", "sass", "less", "html", "javascript", "typescript", "javascriptreact", "typescriptreact", "vue", "svelte", "lua", "yaml", "toml", "conf", }, { -- Default options for all filetypes RGB = true, -- #RGB hex codes RRGGBB = true, -- #RRGGBB hex codes RRGGBBAA = true, -- #RRGGBBAA hex codes names = true, -- "Name" codes like Blue or red rgb_fn = true, -- CSS rgb() and rgba() hsl_fn = true, -- CSS hsl() and hsla() css = true, -- Enable all CSS features css_fn = true, -- Enable all CSS *functions* mode = "background", -- Set the display mode: foreground, background, virtualtext }) end, }, -- 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 = [[]], 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", }, }, }, }, }