local MP = ... do local ok ok, _G.nixInfo = pcall(require, vim.g.nix_info_plugin_name) if not ok then package.loaded[vim.g.nix_info_plugin_name] = setmetatable({}, { __call = function(_, default) return default end, }) _G.nixInfo = require(vim.g.nix_info_plugin_name) end nixInfo.isNix = vim.g.nix_info_plugin_name ~= nil nixInfo.utils = require(MP:relpath("utils")) nixInfo.lze = setmetatable(require("lze"), getmetatable(require("lzextras"))) function nixInfo.get_nix_plugin_path(name) return nixInfo(nil, "plugins", "lazy", name) or nixInfo(nil, "plugins", "start", name) end end nixInfo.lze.register_handlers({ nixInfo.utils.auto_enable_handler, nixInfo.utils.for_cat_handler, nixInfo.lze.lsp, }) nixInfo.lze.h.lsp.set_ft_fallback(nixInfo.utils.lsp_ft_fallback) nixInfo.lze.load({ { import = MP:relpath("plugins") }, { import = MP:relpath("format") }, { import = MP:relpath("lint") }, { import = MP:relpath("LSPs") }, { "base46", lazy = false, auto_enable = true, event = "VimEnter", after = function(_) require("base46").setup() end, }, { "vim-startuptime", auto_enable = true, cmd = { "StartupTime" }, before = function(_) vim.g.startuptime_event_width = 0 vim.g.startuptime_tries = 10 vim.g.startuptime_exe_path = nixInfo(vim.v.progpath, "progpath") end, }, { "mini.surround", auto_enable = true, event = "DeferredUIEnter", after = function(_) require("mini.surround").setup() end, }, { "nvim-surround", auto_enable = true, event = "DeferredUIEnter", before = function(_) vim.g.nvim_surround_no_mappings = true end, after = function(_) require("nvim-surround").setup({ keymaps = false, }) vim.keymap.set("i", "s", "(nvim-surround-insert)", { desc = "Add a surrounding pair around the cursor (insert mode)", }) vim.keymap.set("i", "S", "(nvim-surround-insert-line)", { desc = "Add a surrounding pair around the cursor, on new lines (insert mode)", }) vim.keymap.set("n", "sa", "(nvim-surround-normal)", { desc = "Add a surrounding pair around a motion (normal mode)", }) vim.keymap.set("n", "saa", "(nvim-surround-normal-cur)", { desc = "Add a surrounding pair around the current line (normal mode)", }) vim.keymap.set("n", "sA", "(nvim-surround-normal-line)", { desc = "Add a surrounding pair around a motion, on new lines (normal mode)", }) vim.keymap.set("n", "sAA", "(nvim-surround-normal-cur-line)", { desc = "Add a surrounding pair around the current line, on new lines (normal mode)", }) vim.keymap.set("x", "S", "(nvim-surround-visual)", { desc = "Add a surrounding pair around a visual selection", }) vim.keymap.set("x", "gS", "(nvim-surround-visual-line)", { desc = "Add a surrounding pair around a visual selection, on new lines", }) vim.keymap.set("n", "sd", "(nvim-surround-delete)", { desc = "Delete a surrounding pair", }) vim.keymap.set("n", "cs", "(nvim-surround-change)", { desc = "Change a surrounding pair", }) vim.keymap.set("n", "cS", "(nvim-surround-change-line)", { desc = "Change a surrounding pair, putting replacements on new lines", }) end, }, }) vim.cmd.colorscheme("matugen")