-- if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE -- AstroCore provides a central place to modify mappings, vim options, autocommands, and more! -- Configuration documentation can be found with `:h astrocore` -- NOTE: We highly recommend setting up the Lua Language Server (`:LspInstall lua_ls`) -- as this provides autocomplete and documentation while editing ---@type LazySpec return { "AstroNvim/astrocore", ---@type AstroCoreOpts opts = { -- Configure core features of AstroNvim features = { large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter autopairs = true, -- enable autopairs at start cmp = true, -- enable completion at start diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup highlighturl = true, -- highlight URLs at start notifications = true, -- enable notifications at start }, -- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on diagnostics = { virtual_text = true, underline = true, }, -- passed to `vim.filetype.add` filetypes = { -- see `:h vim.filetype.add` for usage extension = { foo = "fooscript", }, filename = { [".foorc"] = "fooscript", }, pattern = { [".*/etc/foo/.*"] = "fooscript", }, }, -- vim options can be configured here options = { opt = { -- vim.opt. relativenumber = true, -- sets vim.opt.relativenumber number = true, -- sets vim.opt.number spell = false, -- sets vim.opt.spell signcolumn = "yes", -- sets vim.opt.signcolumn to yes wrap = false, -- sets vim.opt.wrap }, g = { -- vim.g. -- configure global vim variables (vim.g) -- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup` -- This can be found in the `lua/lazy_setup.lua` file }, }, -- Mappings can be configured through AstroCore as well. -- NOTE: keycodes follow the casing in the vimdocs. For example, `` must be capitalized mappings = { -- first key is the mode n = { -- second key is the lefthand side of the map ["L"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, ["H"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["fe"] = { "ZkNotes", desc = "Find entries" }, ["ft"] = { "ZkTags", desc = "Find tags" }, ["zn"] = { "ZkNew", desc = "new entry" }, -- mappings seen under group name "Buffer" ["bd"] = { function() require("astroui.status.heirline").buffer_picker( function(bufnr) require("astrocore.buffer").close(bufnr) end ) end, desc = "Close buffer from tabline", }, ["nz"] = { function() function Scandir(directory) local i, t, popen = 0, {}, io.popen local pfile = popen('ls -A "' .. directory .. '"') for filename in pfile:lines() do i = i + 1 t[i] = '"' .. filename .. '"' end pfile:close() return t end local ZK_DIR = os.getenv "ZK_NOTEBOOK_DIR" or "~/Desktop/notebooks/slipbox" ZK_DIR = ZK_DIR .. "/.zk/templates" local Template_List = Scandir(ZK_DIR) vim.ui.select( Template_List, { prompt = "Template:" }, function(str) vim.cmd("ZkNew {title = vim.fn.input('Title: '), template = " .. str .. "}") end ) end, desc = "New zk slip", }, -- tables with just a `desc` key will be registered with which-key if it's installed -- this is useful for naming menus -- ["b"] = { desc = "Buffers" }, -- setting a mapping to false will disable it -- [""] = false, }, }, }, }