{ pkgs, ... }: { plugins.oil = { enable = true; settings = { keymaps = { "q" = "actions.close"; }; columns = [ "icon" "permissions" "size" "mtime" ]; }; }; extraPlugins = [ pkgs.vimPlugins.snacks-nvim ]; extraConfigLua = /* lua */ '' local Snacks = require("snacks"); local filter_lsp_definitions = function(item) if item.file:match("/react/ts5.0/") or item.file:match("react.d.ts") then return false end return true end Snacks.setup({ bigfile = { enabled = true }, bufdelete = { enabled = true }, git = { enabled = true }, indent = { enabled = true }, input = { enabled = true }, notifier = { enabled = true }, picker = { enabled = true, prompt = "λ ", layout = { preset = "ivy" }, }, statuscolumn = { enabled = true }, }) ''; keymaps = [ # Git { key = "gb"; action.__raw = "function() Snacks.git.blame_line() end"; options.desc = "Show git blame for current line"; } # Picker { key = "."; action.__raw = "function() Snacks.picker.files({ hidden = true }) end"; options.desc = "Files"; } { key = ""; action.__raw = "function() Snacks.picker.git_files() end"; options.desc = "Git files"; } # Find { key = "fr"; action.__raw = "function() Snacks.picker.recent() end"; options.desc = "Recent"; } { key = "fp"; action.__raw = "function() Snacks.picker.projects() end"; options.desc = "Projects"; } { key = "bb"; action.__raw = "function() Snacks.picker.buffers() end"; options.desc = "List buffers"; } { key = "bd"; action.__raw = "function() Snacks.bufdelete() end"; options.desc = "Delete buffer"; } { key = "bD"; action.__raw = "function() Snacks.bufdelete.all() end"; options.desc = "Delete all buffers"; } { key = "bo"; action.__raw = "function() Snacks.bufdelete.other() end"; options.desc = "Delete other buffers"; } # Search { key = "ss"; action.__raw = "function() Snacks.picker.grep() end"; options.desc = "Grep"; } { mode = [ "n" "x" ]; key = "sw"; action.__raw = "function() Snacks.picker.grep_word() end"; options.desc = "Visual selection or word"; } { key = "su"; action.__raw = "function() Snacks.picker.undo() end"; options.desc = "Undo History"; } # Diagnostics { key = "td"; action.__raw = "function() Snacks.picker.diagnostics_buffer() end"; options.desc = "Buffer Diagnostics"; } { key = "ta"; action.__raw = "function() Snacks.picker.diagnostics() end"; options.desc = "Diagnostics"; } # LSP { key = "gd"; action.__raw = "function() Snacks.picker.lsp_definitions({ filter = { filter = filter_lsp_definitions } }) end"; options.desc = "Goto Definition"; } { key = "gD"; action.__raw = "function() Snacks.picker.lsp_declarations() end"; options.desc = "Goto Declaration"; } { key = "grr"; action.__raw = "function() Snacks.picker.lsp_references() end"; options = { desc = "References"; nowait = true; }; } { key = "gI"; action.__raw = "function() Snacks.picker.lsp_implementations() end"; options.desc = "Goto Implementation"; } { key = "gy"; action.__raw = "function() Snacks.picker.lsp_type_definitions() end"; options.desc = "Goto T[y]pe Definition"; } # Notifications and highlights { key = "on"; action.__raw = "function() Snacks.notifier.show_history() end"; options.desc = "Open notification history"; } { key = "oh"; action.__raw = "function() Snacks.picker.highlights() end"; options.desc = "List highlights"; } { key = "n"; action = "Oil"; options.desc = "Opens file explorer"; } ]; }