-- Set up globals {{{ do local nixvim_globals = { mallocalleader = " ", mapleader = " " } for k, v in pairs(nixvim_globals) do vim.g[k] = v end end -- }}} -- Set up options {{{ do local nixvim_options = { autoindent = false, backspace = { "indent", "eol", "start" }, cindent = true, cinkeys = "0{,0},0),0],:,!^F,o,O,e", completeopt = { "menuone", "noselect", "noinsert" }, confirm = true, cursorline = true, encoding = "utf-8", expandtab = true, fileencoding = "utf-8", foldcolumn = "0", foldenable = true, foldlevel = 99, foldlevelstart = 99, formatexpr = "v:lua.require('conform').formatexpr()", grepformat = "%f:%l:%c:%m", grepprg = "rg --vimgrep", hidden = true, hlsearch = true, ignorecase = true, incsearch = true, laststatus = 3, mouse = "a", number = true, pumheight = 0, relativenumber = true, ruler = true, scrolloff = 10, sessionoptions = { "buffers", "curdir", "tabpages", "winsize", "help", "globals", "skiprtp", "folds" }, shiftwidth = 4, showmode = false, showtabline = 0, signcolumn = "yes", smartcase = true, smartindent = false, smarttab = true, softtabstop = 4, splitbelow = true, splitright = true, tabstop = 4, termguicolors = true, timeoutlen = 50, undodir = "/home/lab/smchurla/.vim/undo", undofile = true, undolevels = 10000, winblend = 30, } for k, v in pairs(nixvim_options) do vim.opt[k] = v end end -- }}} vim.loader.enable() require("lazy").setup({ dev = { path = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins", patterns = { "." }, fallback = false, }, spec = { { "catppuccin", config = function(_, opts) require("catppuccin").setup(opts) vim.cmd([[ let $BAT_THEME = "catppuccin" colorscheme catppuccin ]]) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/catppuccin-nvim", lazy = false, name = "catppuccin", opts = { background = { dark = "mocha", light = "latte" }, flavour = "mocha" }, priority = 1000, }, { "nvim-web-devicons", config = function(_, opts) require("nvim-web-devicons").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, { "nvim-autopairs", config = function(_, opts) require("nvim-autopairs").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-autopairs", event = { "InsertEnter" }, lazy = true, name = "nvim-autopairs", opts = { check_ts = true }, }, { "vim-bbye", cmd = { "Bdelete", "Bwipeout" }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vim-bbye", lazy = true, name = "vim-bbye", }, { "better_escape", config = function(_, opts) require("better_escape").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/better-escape.nvim", event = { "InsertEnter" }, lazy = true, name = "better_escape", opts = { default_mappings = true, timeout = 200 }, }, { "clangd_extensions", config = function(_, opts) require("clangd_extensions").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/clangd_extensions.nvim", lazy = true, name = "clangd_extensions", opts = { inlay_hints = { inline = false } }, }, { "cmp", config = function(_, opts) require("cmp").setup(opts) end, dependencies = { { "cmp-async-path", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-async-path", lazy = true, name = "cmp-async-path", }, { "cmp-buffer", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-buffer", enabled = false, lazy = true, name = "cmp-buffer", }, { "cmp-cmdline", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-cmdline", enabled = false, lazy = true, name = "cmp-cmdline", }, { "cmp-emoji", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-emoji", lazy = true, name = "cmp-emoji", }, { "cmp-nvim-lsp", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-nvim-lsp", lazy = true, name = "cmp-nvim-lsp", }, { "cmp-nvim-lsp-signature-help", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp-nvim-lsp-signature-help", lazy = true, name = "cmp-nvim-lsp-signature-help", }, { "cmp_luasnip", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/cmp_luasnip", lazy = true, name = "cmp_luasnip", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-cmp", event = { "InsertEnter" }, lazy = true, name = "cmp", opts = function() local cmp = require("cmp") local luasnip = require("luasnip") local has_words_before = function() unpack = unpack or table.unpack local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end return { sources = cmp.config.sources({ { ["name"] = "async_path" }, { ["name"] = "emoji" }, { ["name"] = "nvim_lsp" }, { ["name"] = "nvim_lsp_signature_help" }, { ["name"] = "luasnip" }, }), snippet = { expand = function(args) require("luasnip").lsp_expand(args.body) end, }, window = { completion = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(), -- completion.border = "rounded", -- documentation.border = "rounded", }, mapping = cmp.mapping.preset.insert({ [""] = cmp.mapping.scroll_docs(4), [""] = cmp.mapping.complete({}), [""] = cmp.mapping.scroll_docs(-4), [""] = cmp.mapping.abort(), [""] = cmp.mapping.confirm({ select = true }), [""] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Select }), [""] = cmp.mapping.abort(), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() elseif luasnip.jumpable(-1) then luasnip.jump(-1) else fallback() end end, { "i", "s" }), [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() elseif require("luasnip").expand_or_jumpable() then require("luasnip").expand_or_jump() elseif has_words_before() then cmp.complete() else fallback() -- This will call the intellitab binding end end, { "i", "s" }), [""] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Select }), }), } end, }, { "Comment", config = function(_, opts) require("Comment").setup(opts) end, dependencies = { { "ts_context_commentstring", config = function(_, opts) require("ts_context_commentstring").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-ts-context-commentstring", init = function() -- Skip compatibility checks vim.g.skip_ts_context_commentstring_module = true end, lazy = true, name = "ts_context_commentstring", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/comment.nvim", lazy = false, name = "Comment", opts = { mappings = { basic = true, extra = false }, opleader = { block = "", line = "" }, pre_hook = function() require("ts_context_commentstring.integrations.comment_nvim").create_pre_hook() end, toggler = { block = "", line = "" }, }, }, { "conform", config = function(_, opts) require("conform").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/conform.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "conform", opts = { format_on_save = function(bufnr) -- Disable with a global or buffer-local variable if vim.g.disable_autoformat then return end return { timeout_ms = 500, lsp_fallback = true } end, formatters_by_ft = { c = { "clang-format" }, cpp = { "clang-format" }, css = { { "prettierd", "prettier" } }, h = { "clang-format" }, hpp = { "clang-format" }, html = { { "prettierd", "prettier" } }, java = { "google-java-format" }, javascript = { { "prettierd", "prettier" } }, lua = { "stylua" }, markdown = { { "prettierd", "prettier" } }, nix = { "alejandra" }, python = { "black" }, rust = { "rustfmt" }, }, }, }, { "dashboard", config = function(_, opts) require("dashboard").setup(opts) end, dependencies = { { "nvim-web-devicons", config = function(_, opts) require("nvim-web-devicons").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, { "persisted", cmd = { "SessionSave", "SessionDelete", "Telescope persisted" }, config = function(_, opts) require("persisted").setup(opts) require("telescope").load_extension("persisted") end, dependencies = { { "telescope", cmd = { "Telescope" }, config = function(_, opts) local telescope = require("telescope") telescope.setup(opts) for i, extension in ipairs({ "undo", "ui-select", "fzf" }) do telescope.load_extension(extension) end end, dependencies = { { "plenary", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, { "telescope-fzf-native", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-fzf-native.nvim", lazy = true, name = "telescope-fzf-native", }, { "telescope-undo", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-undo.nvim", lazy = true, name = "telescope-undo", }, { "telescope-ui-select", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-ui-select.nvim", lazy = true, name = "telescope-ui-select", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope.nvim", lazy = true, name = "telescope", opts = { defaults = { mappings = { i = { [""] = function(...) return require("telescope.actions").close(...) end, }, }, }, }, }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/persisted.nvim", lazy = true, name = "persisted", opts = { autoload = false, autosave = false, follow_cwd = true, ignored_dirs = { "/", "~/", "~/Projects/" }, silent = false, use_git_branch = false, }, }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/dashboard-nvim", lazy = false, name = "dashboard", opts = { config = { center = { { action = "Telescope persisted", desc = " Restore Session", icon = " ", key = "s" }, { action = "Telescope find_files", desc = " Find File", icon = " ", key = "f" }, { action = "Telescope oldfiles", desc = " Recent Files", icon = " ", key = "r" }, { action = "ene | startinsert", desc = " New File", icon = " ", key = "n" }, { action = "Telescope live_grep", desc = " Find Text", icon = " ", key = "g" }, { action = "Lazy", desc = " Lazy", icon = "󰒲 ", key = "l" }, { action = "quitall", desc = " Quit", icon = " ", key = "q" }, }, footer = function() local stats = require("lazy").stats() local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) return { "⚡ Neovim loaded " .. stats.loaded .. "/" .. stats.count .. " plugins in " .. ms .. "ms", } end, }, disable_move = true, shortcut_type = "number", theme = "doom", }, }, { "diffview", cmd = { "DiffviewOpen" }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/diffview.nvim", lazy = true, name = "diffview", }, { "direnv", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/direnv.vim", lazy = false, name = "direnv", }, { "flash", config = function(_, opts) require("flash").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/flash.nvim", keys = { "s", "S", "f", "F", "t", "T" }, lazy = true, name = "flash", }, { "gitmessenger", cmd = { "GitMessenger" }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/git-messenger.vim", init = function() for k, v in pairs({ ["git_messenger_floating_win_opts"] = { ["border"] = "rounded" }, ["git_messenger_no_default_mappings"] = true, }) do vim.g[k] = v end end, lazy = true, name = "gitmessenger", }, { "gitsigns", config = function(_, opts) require("gitsigns").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/gitsigns.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "gitsigns", opts = { current_line_blame = false }, }, { "haskell-tools", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/haskell-tools.nvim", lazy = false, name = "haskell-tools", }, { "illuminate", config = function(_, opts) require("illuminate").configure(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vim-illuminate", event = { "BufreadPost", "BufNewFile" }, lazy = true, name = "illuminate", opts = { filetypesDenylist = { "DressingSelect", "Outline", "TelescopePrompt", "alpha", "harpoon", "toggleterm", "neo-tree", "Spectre", "reason", }, }, }, { "intellitab", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/intellitab.nvim", event = { "InsertEnter" }, lazy = true, name = "intellitab", }, { "jdtls", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-jdtls", lazy = false, name = "jdtls", }, { "nvim-lastplace", config = function(_, opts) require("nvim-lastplace").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-lastplace", lazy = false, name = "nvim-lastplace", }, { "lazygit", cmd = { "LazyGit", "LazyGitConfig", "LazyGitCurrentFile", "LazyGitFilter", "LazyGitFilterCurrentFile" }, dependencies = { { "plenary", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/lazygit.nvim", lazy = true, name = "lazygit", }, { "lint", config = function(_, opts) local lint = require("lint") for k, v in pairs(opts) do lint[k] = v end end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-lint", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lint", opts = { linters_by_ft = { c = { "clangtidy" }, clojure = { "clj-kondo" }, cpp = { "clangtidy" }, h = { "clangtidy" }, hpp = { "clangtidy" }, java = { "checkstyle" }, javascript = { "eslint_d" }, lua = { "luacheck" }, markdown = { "vale" }, nix = { "statix" }, python = { "flake8" }, text = { "vale" }, }, }, }, { "lspconfig", cmd = { "LspInfo" }, config = function(_, opts) -- Make LspInfo window border rounded require("lspconfig.ui.windows").default_options.border = "rounded" local __lspOnAttach = function(client, bufnr) end local __lspCapabilities = function() capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend("force", capabilities, require("cmp_nvim_lsp").default_capabilities()) return capabilities end local __setup = { on_attach = __lspOnAttach, capabilities = __lspCapabilities(), } for i, server in ipairs({ { ["extraOptions"] = { ["capabilities"] = { ["offsetEncoding"] = { "utf-16" } }, ["cmd"] = { "clangd", "--background-index", "--clang-tidy", "--header-insertion=iwyu", "--completion-style=detailed", "--function-arg-placeholders", "--fallback-style=llvm", }, ["init_options"] = { ["clangdFileStatus"] = true, ["completeUnimported"] = true, ["usePlaceholders"] = true, }, ["root_dir"] = function(fname) return require("lspconfig.util").root_pattern( "Makefile", "CMakeLists.txt", ".clang-format", ".clang-tidy" )(fname) or require("lspconfig.util").root_pattern( "compile_commands.json" )(fname) or require("lspconfig.util").find_git_ancestor( fname ) end, }, ["name"] = "clangd", }, { ["name"] = "clojure_lsp" }, { ["name"] = "cmake" }, { ["name"] = "lua_ls" }, { ["name"] = "nil_ls" }, { ["name"] = "ltex" }, { ["extraOptions"] = { ["nixd"] = { ["diagnostic"] = { ["suppress"] = { "sema-escaping-with", "var-bind-to-this", "escaping-this-with" }, }, }, }, ["name"] = "nixd", }, { ["name"] = "pyright" }, { ["name"] = "texlab" }, }) do if type(server) == "string" then require("lspconfig")[server].setup(__setup) else local options = server.extraOptions if options == nil then options = __setup else options = vim.tbl_extend("keep", options, __setup) end require("lspconfig")[server.name].setup(options) end end end, dependencies = { { "lazydev", config = function(_, opts) require("lazydev").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vimplugin-nvim-lazydev", ft = { "lua" }, name = "lazydev", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-lspconfig", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lspconfig", }, { "lualine", config = function(_, opts) local lualine = require("lualine") lualine.setup(opts) -- Disable tabline/winbar sections lualine.hide({ place = { "tabline", "winbar" }, unhide = false, }) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/lualine.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "lualine", opts = { extensions = { "fzf", "chadtree", "neo-tree", "toggleterm", "trouble" }, options = { always_divide_middle = true, component_separators = { left = "", right = "" }, globalstatus = true, ignore_focus = { "neo-tree", "chadtree" }, section_separators = { left = "", right = "" }, }, sections = { lualine_a = { "mode" }, lualine_b = { "branch", "diff", "diagnostics" }, lualine_c = { { "filename", path = 1 } }, lualine_x = { "filetype", "encoding", "fileformat" }, lualine_y = { "progress", "searchcount", "selectioncount" }, lualine_z = { "location" }, }, }, }, { "luasnip", config = function(_, opts) require("luasnip").config.set_config(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/luasnip", lazy = false, name = "luasnip", }, { "narrow-region", cmd = { "NR" }, config = function(_, opts) vim.keymap.del("x", "Nr") vim.keymap.del("x", "nr") vim.keymap.del("n", "nr") end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/NrrwRgn", lazy = true, name = "narrow-region", }, { "navbuddy", cmd = { "Navbuddy" }, config = function(_, opts) local actions = require("nvim-navbuddy.actions") -- ? require("nvim-navbuddy").setup(opts) end, dependencies = { { "navic", config = function(_, opts) navic = require("nvim-navic") navic.setup(opts) -- NOTE: Use incline, because the default winbar isn't floating and disappears -- when leavin the split, which makes the buffer jump -- Register navic with lualine's winbar -- TODO: The setup function should only be ran once -- require("lualine").setup({ -- winbar = { -- lualine_c = { -- { -- function() -- return navic.get_location() -- end, -- cond = function() -- return navic.is_available() -- end -- } -- } -- } -- }) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-navic", lazy = true, name = "navic", opts = { click = true, depth_limit = 5, highlight = true, lsp = { auto_attach = true } }, }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-navbuddy", lazy = true, name = "navbuddy", opts = { lsp = { auto_attach = true }, window = { border = "rounded" } }, }, { "neo-tree", cmd = { "Neotree" }, config = function(_, opts) require("neo-tree").setup(opts) end, dependencies = { { "plenary", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, { "nvim-web-devicons", config = function(_, opts) require("nvim-web-devicons").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-web-devicons", lazy = true, name = "nvim-web-devicons", }, { "nui", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nui.nvim", lazy = true, name = "nui", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/neo-tree.nvim", lazy = true, name = "neo-tree", opts = { buffers = { follow_current_file = { enabled = true, leave_dirs_open = false } }, default_component_configs = { container = { enable_character_fade = true } }, enable_diagnostics = false, enable_git_status = true, filesystem = { bind_to_cwd = true, cwd_target = { sidebar = "global" }, filtered_items = { visible = false }, follow_current_file = { enabled = true, leave_dirs_open = false }, }, open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, popup_border_style = "rounded", use_default_mappings = false, window = { mappings = { ["."] = "set_root", ["/"] = "fuzzy_finder", [""] = "open", [""] = "cancel", [">"] = "navigate_up", ["?"] = "show_help", H = "toggle_hidden", R = "refresh", a = "add", c = "close_node", d = "delete", i = "show_file_details", p = "paste_from_clipboard", q = "close_window", r = "rename", x = "cut_to_clipboard", y = "copy_to_clipboard", }, position = "left", }, }, }, { "noice", config = function(_, opts) require("noice").setup(opts) end, dependencies = { { "notify", config = function(_, opts) local notify = require("notify") notify.setup(opts) vim.notify = notify -- Vim uses notify by default end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-notify", lazy = true, name = "notify", }, { "nui", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nui.nvim", lazy = true, name = "nui", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/noice.nvim", lazy = false, name = "noice", opts = { lsp = { documentation = { opts = { border = "rounded", format = { "{message}" }, lang = "markdown", render = "plain", replace = true, win_options = { concealcursor = "n", conceallevel = 3 }, }, view = "hover", }, override = { ["cmp.entry.get_documentation"] = true, ["vim.lsp.util.convert_input_to_markdown_lines"] = true, ["vim.lsp.util.stylize_markdown"] = true, }, }, notify = { enabled = true }, popupmenu = { backend = "nui", enabled = true }, presets = { bottom_search = false, command_palette = true, inc_rename = true, long_message_to_split = true, lsp_doc_border = true, }, routes = { { filter = { event = "msg_show", kind = "search_count" }, opts = { skip = true } } }, }, }, { "rainbow-delimiters", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/rainbow-delimiters.nvim", lazy = false, name = "rainbow-delimiters", }, { "rustaceanvim", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/rustaceanvim", init = function() vim.g.rustaceanvim = { tools = { enable_clippy = true, float_win_config = { border = "rounded", }, }, server = { default_settings = { ["rust-analyzer"] = { cargo = { allFeatures = true, -- features = "all", -- loadOutDirsFromCheck = true, -- runBuildScripts = true, }, -- lint-nvim doesn't support clippy checkOnSave = { allFeatures = true, allTargets = true, command = "clippy", extraArgs = { "--", "--no-deps", "-Dclippy::pedantic", "-Dclippy::nursery", "-Dclippy::unwrap_used", "-Dclippy::enum_glob_use", "-Dclippy::complexity", "-Dclippy::perf", }, }, }, }, }, } end, lazy = false, name = "rustaceanvim", }, { "sandwich", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vim-sandwich", init = function() -- Disable default keymaps vim.g.sandwich_no_default_key_mappings = 1 vim.g.operator_sandwich_no_default_key_mappings = 1 vim.g.textobj_sandwich_no_default_key_mappings = 1 end, lazy = false, name = "sandwich", }, { "sleuth", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vim-sleuth", lazy = false, name = "sleuth", }, { "telescope", cmd = { "Telescope" }, config = function(_, opts) local telescope = require("telescope") telescope.setup(opts) for i, extension in ipairs({ "undo", "ui-select", "fzf" }) do telescope.load_extension(extension) end end, dependencies = { { "plenary", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, { "telescope-fzf-native", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-fzf-native.nvim", lazy = true, name = "telescope-fzf-native", }, { "telescope-undo", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-undo.nvim", lazy = true, name = "telescope-undo", }, { "telescope-ui-select", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope-ui-select.nvim", lazy = true, name = "telescope-ui-select", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/telescope.nvim", lazy = true, name = "telescope", opts = { defaults = { mappings = { i = { [""] = function(...) return require("telescope.actions").close(...) end, } }, }, }, }, { "todo-comments", config = function(_, opts) require("todo-comments").setup(opts) end, dependencies = { { "plenary", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/plenary.nvim", lazy = true, name = "plenary", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/todo-comments.nvim", event = { "BufReadPost", "BufNewFile" }, lazy = true, name = "todo-comments", opts = { keywords = { FIX = { alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, color = "error", icon = " " }, HACK = { color = "warning", icon = " " }, NOTE = { alt = { "INFO" }, color = "hint", icon = " " }, PERF = { alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" }, icon = " " }, TEST = { alt = { "TESTING", "PASSED", "FAILED" }, color = "test", icon = "⏲ " }, TODO = { color = "info", icon = " " }, WARN = { alt = { "WARNING", "XXX" }, color = "warning", icon = " " }, }, signs = true, }, }, { "toggleterm", cmd = { "ToggleTerm" }, config = function(_, opts) require("toggleterm").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/toggleterm.nvim", keys = { "" }, lazy = true, name = "toggleterm", opts = { auto_scroll = true, autochdir = true, close_on_exit = true, direction = "horizontal", float_opts = { border = "curved", height = 35, width = 80, winblend = 0 }, hide_numbers = true, insert_mappings = true, open_mapping = [[]], persist_mode = true, shade_terminals = false, shading_factor = 30, shell = "fish", start_in_insert = true, terminal_mappings = true, }, }, { "treesitter", cmd = { "TSModuleInfo" }, config = function(_, opts) require("nvim-treesitter.configs").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-treesitter", event = { "BufReadPost", "BufNewFile" }, init = function() -- Fix treesitter grammars/parsers on nix vim.opt.runtimepath:append( "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/nvim-treesitter" ) vim.opt.runtimepath:append("/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/treesitter-parsers") end, lazy = true, name = "treesitter", opts = { auto_install = false, highlight = { additional_vim_regex_highlighting = false, enable = true }, incremental_selection = { enable = true, keymaps = { init_selection = "gnn", node_decremental = "grm", node_incremental = "grn", scope_incremental = "grc", }, }, indent = { enable = true }, parser_install_dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/treesitter-parsers", }, }, { "trim", config = function(_, opts) require("trim").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/trim.nvim", lazy = false, name = "trim", }, { "trouble", cmd = { "Trouble", "TroubleToggle" }, config = function(_, opts) require("trouble").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/trouble.nvim", lazy = true, name = "trouble", }, { "ufo", config = function(_, opts) require("ufo").setup(opts) end, dependencies = { { "promise", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/promise-async", lazy = true, name = "promise", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/nvim-ufo", lazy = false, name = "ufo", }, { "vimtex", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/vimtex", init = function() vim.g.vimtex_view_method = "zathura" end, name = "vimtex", }, { "which-key", config = function(_, opts) require("which-key").setup(opts) end, dependencies = { { "mini", dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/mini.nvim", lazy = true, name = "mini", }, }, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/which-key.nvim", lazy = false, name = "which-key", opts = { preset = "helix" }, priority = 500, }, { "winshift", cmd = { "WinShift" }, config = function(_, opts) require("winshift").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/winshift.nvim", lazy = true, name = "winshift", opts = { highlight_moving_win = true, keymaps = { disable_defaults = true, win_move_mode = { h = "left", j = "down", k = "up", l = "right" } }, }, }, { "yanky", cmd = { "YankyClearHistory", "YankyRingHistory" }, config = function(_, opts) require("yanky").setup(opts) end, dir = "/home/lab/smchurla/Downloads/flake-nixinator/config/neovim/store/lazy-plugins/yanky.nvim", lazy = true, name = "yanky", }, }, }) -- Set up keybinds {{{ do local __nixvim_binds = { { action = "v:count == 0 ? 'gj' : 'j'", key = "j", mode = "n", options = { desc = "Move cursor down", expr = true }, }, { action = "v:count == 0 ? 'gj' : 'j'", key = "", mode = "n", options = { desc = "Move cursor down", expr = true }, }, { action = "v:count == 0 ? 'gk' : 'k'", key = "k", mode = "n", options = { desc = "Move cursor up", expr = true }, }, { action = "v:count == 0 ? 'gk' : 'k'", key = "", mode = "n", options = { desc = "Move cursor up", expr = true }, }, { action = "vertical resize -2", key = "", mode = "n", options = { desc = "Decrease window width" }, }, { action = "vertical resize +2", key = "", mode = "n", options = { desc = "Increase window width" }, }, { action = "resize -2", key = "", mode = "n", options = { desc = "Decrease window height" } }, { action = "resize +2", key = "", mode = "n", options = { desc = "Increase window height" } }, { action = "m .+1==", key = "", mode = "n", options = { desc = "Move line down" } }, { action = "m .+1==gi", key = "", mode = "i", options = { desc = "Move line down" } }, { action = ":m '>+1gv=gv", key = "", mode = "v", options = { desc = "Move line down" } }, { action = "m .-2==", key = "", mode = "n", options = { desc = "Move line up" } }, { action = "m .-2==gi", key = "", mode = "i", options = { desc = "Move line up" } }, { action = ":m '<-2gv=gv", key = "", mode = "v", options = { desc = "Move line up" } }, { action = "w", key = "", mode = { "n", "i", "v" }, options = { desc = "Save current buffer" } }, { action = "wa", key = "", mode = { "n", "i", "v" }, options = { desc = "Save all buffers" } }, { action = "", 'v:lua.get_wildmenu_key("", "")', { expr = true }) vim.api.nvim_set_keymap("c", "", 'v:lua.get_wildmenu_key("", "")', { expr = true }) function _G.get_wildmenu_key(key_wildmenu, key_regular) return vim.fn.wildmenumode() ~= 0 and key_wildmenu or key_regular end -- Check LSP server config vim.api.nvim_create_user_command("LspInspect", function() require("notify")(vim.inspect(vim.lsp.get_active_clients())) end, { desc = "Print LSP server configuration", }) -- Toggle linting vim.g.disable_autolint = false vim.api.nvim_create_user_command("ToggleAutoLint", function() vim.g.disable_autolint = not vim.g.disable_autolint if vim.g.disable_autolint then -- vim.diagnostic.reset(vim.api.nvim_get_current_buf()) vim.diagnostic.reset() -- Reset for all buffers end require("notify")((vim.g.disable_autolint and "Disabled" or "Enabled") .. " autolint-on-save") end, { desc = "Toggle autolint-on-save", }) -- Set up autocommands {{ do local __nixvim_autocommands = { { callback = function() if not vim.g.disable_autolint then require("lint").try_lint() end end, event = { "BufWritePost" }, }, { callback = function() vim.highlight.on_yank() end, event = { "TextYankPost" }, }, { callback = function() local current_tab = vim.fn.tabpagenr() vim.cmd("tabdo wincmd =") vim.cmd("tabnext " .. current_tab) end, event = { "VimResized" }, }, { callback = function() vim.opt_local.conceallevel = 0 end, event = { "FileType" }, pattern = { "json", "jsonc", "json5" }, }, { callback = function() local workspace = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]) local opts = { root_dir = workspace, cmd = { "jdtls", "-data", "/home/lab/smchurla/.local/share/eclipse/" .. vim.fn.fnamemodify(workspace, ":p:h:t"), }, } require("jdtls").start_or_attach(opts) end, event = { "FileType" }, pattern = { "Java", "java" }, }, } for _, autocmd in ipairs(__nixvim_autocommands) do vim.api.nvim_create_autocmd(autocmd.event, { group = autocmd.group, pattern = autocmd.pattern, buffer = autocmd.buffer, desc = autocmd.desc, callback = autocmd.callback, command = autocmd.command, once = autocmd.once, nested = autocmd.nested, }) end end -- }} local opt = vim.opt local g = vim.g local o = vim.o -- Neovide if g.neovide then -- require("notify").notify("Running in NeoVide") g.neovide_cursor_animate_command_line = true g.neovide_cursor_animate_in_insert_mode = true -- g.neovide_fullscreen = false g.neovide_hide_mouse_when_typing = true g.neovide_padding_top = 0 g.neovide_padding_bottom = 0 g.neovide_padding_right = 0 g.neovide_padding_left = 0 g.neovide_refresh_rate = 144 -- g.neovide_theme = "light" -- Neovide Fonts o.guifont = "JetBrainsMono Nerd Font:h13:Medium" else -- require("notify").notify("Not running in NeoVide") end