83 lines
3.5 KiB
Lua
83 lines
3.5 KiB
Lua
-- 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 = {
|
|
-- vim options can be configured here
|
|
options = {
|
|
opt = { -- vim.opt.<key>
|
|
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.<key>
|
|
-- 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, `<Leader>` must be capitalized
|
|
mappings = {
|
|
-- first key is the mode
|
|
n = {
|
|
-- second key is the lefthand side of the map
|
|
|
|
-- navigate buffer tabs
|
|
-- ["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
|
-- ["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
|
["<leader>a"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
|
["<leader>;"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
|
["<Tab>"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
|
|
["<S-Tab>"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
|
|
|
|
-- mappings seen under group name "Buffer"
|
|
-- ["<Leader>bd"] = {
|
|
-- function()
|
|
-- require("astroui.status.heirline").buffer_picker(
|
|
-- function(bufnr) require("astrocore.buffer").close(bufnr) end
|
|
-- )
|
|
-- end,
|
|
-- desc = "Close buffer from tabline",
|
|
-- },
|
|
|
|
-- tables with just a `desc` key will be registered with which-key if it's installed
|
|
-- this is useful for naming menus
|
|
-- ["<Leader>b"] = { desc = "Buffers" },
|
|
|
|
-- setting a mapping to false will disable it
|
|
-- ["<C-S>"] = false,
|
|
["<M-h>"] = { "<Cmd>ToggleTerm size=20<CR>", desc = "Toggle terminal" },
|
|
[",tt"] = {
|
|
function()
|
|
local size = vim.o.lines * 0.4
|
|
require("toggleterm").toggle(nil, size)
|
|
end,
|
|
desc = "Toggle terminal",
|
|
},
|
|
[",tn"] = { "<Cmd>ToggleTerm direction=tab<CR>", desc = "Toggle terminal" },
|
|
},
|
|
t = {
|
|
["<M-h>"] = { "<Cmd>ToggleTerm<CR>", desc = "Toggle terminal" },
|
|
[",tt"] = { "<Cmd>ToggleTerm<CR>", desc = "Toggle terminal" },
|
|
|
|
["<C-Up>"] = { "<Cmd>resize +2<CR>", desc = "Resize terminal up" },
|
|
["<C-Down>"] = { "<Cmd>resize -2<CR>", desc = "Resize terminal down" },
|
|
|
|
-- Navigate tabs
|
|
["]t"] = { function() vim.cmd.tabnext() end, desc = "Next tab" },
|
|
["[t"] = { function() vim.cmd.tabprevious() end, desc = "Previous tab" },
|
|
},
|
|
},
|
|
},
|
|
}
|