add mappings to move lines up and down

This commit is contained in:
2025-08-12 09:56:51 +01:00
parent 45458b78c1
commit 34ea1ee888

View File

@@ -5,7 +5,7 @@
---@type LazySpec ---@type LazySpec
return { return {
"AstroNvim/astrocore", 'AstroNvim/astrocore',
---@type AstroCoreOpts ---@type AstroCoreOpts
opts = { opts = {
-- Configure core features of AstroNvim -- Configure core features of AstroNvim
@@ -26,13 +26,13 @@ return {
filetypes = { filetypes = {
-- see `:h vim.filetype.add` for usage -- see `:h vim.filetype.add` for usage
extension = { extension = {
foo = "fooscript", foo = 'fooscript',
}, },
filename = { filename = {
[".foorc"] = "fooscript", ['.foorc'] = 'fooscript',
}, },
pattern = { pattern = {
[".*/etc/foo/.*"] = "fooscript", ['.*/etc/foo/.*'] = 'fooscript',
}, },
}, },
-- vim options can be configured here -- vim options can be configured here
@@ -41,7 +41,7 @@ return {
relativenumber = true, -- sets vim.opt.relativenumber relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell spell = false, -- sets vim.opt.spell
signcolumn = "yes", -- sets vim.opt.signcolumn to yes signcolumn = 'yes', -- sets vim.opt.signcolumn to yes
wrap = false, -- sets vim.opt.wrap wrap = false, -- sets vim.opt.wrap
}, },
g = { -- vim.g.<key> g = { -- vim.g.<key>
@@ -58,17 +58,27 @@ return {
-- second key is the lefthand side of the map -- second key is the lefthand side of the map
-- navigate buffer tabs -- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, [']b'] = {
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, 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',
},
-- mappings seen under group name "Buffer" -- mappings seen under group name "Buffer"
["<Leader>bd"] = { ['<Leader>bd'] = {
function() function()
require("astroui.status.heirline").buffer_picker( require('astroui.status.heirline').buffer_picker(function(bufnr)
function(bufnr) require("astrocore.buffer").close(bufnr) end require('astrocore.buffer').close(bufnr)
) end)
end, end,
desc = "Close buffer from tabline", desc = 'Close buffer from tabline',
}, },
-- tables with just a `desc` key will be registered with which-key if it's installed -- tables with just a `desc` key will be registered with which-key if it's installed
@@ -78,6 +88,11 @@ return {
-- setting a mapping to false will disable it -- setting a mapping to false will disable it
-- ["<C-S>"] = false, -- ["<C-S>"] = false,
}, },
v = {
['J'] = ":m '>+1<CR>gv=gv",
['K'] = ":m '<-2<CR>gv=gv",
},
}, },
}, },
} }