astro-nvim-v3 - add left hand control wasd + Alt for move block

This commit is contained in:
huyjaky
2024-11-03 17:32:21 +07:00
parent c871e50e7c
commit dc03e0785d
7 changed files with 49 additions and 29 deletions

View File

@@ -10,8 +10,8 @@
"astrotheme": { "branch": "main", "commit": "41b7d8430a55fd771e41bd763af4c3fd1c2fc0b5" },
"astroui": { "branch": "main", "commit": "7adeb60d76939d3cd66c9852e0e8621bd42014dd" },
"auto-save.nvim": { "branch": "main", "commit": "5fbcaac0a2698c87a9a1bd2083cb6949505cca12" },
"bamboo.nvim": { "branch": "master", "commit": "14279945044372b02a4547883ac86f4800dbf128" },
"better-escape.nvim": { "branch": "master", "commit": "f45b52f8f87792e8659526f23261ffe278a54be5" },
"bamboo.nvim": { "branch": "master", "commit": "57e1bff1c0df29d7ec0071baf49210c48fc4a98b" },
"better-escape.nvim": { "branch": "master", "commit": "199dcc2643dec5d8dbdab4ec672cf405224dcb3b" },
"catppuccin": { "branch": "main", "commit": "0b5df9c9e641b1212b21a0762ccad4434fd41322" },
"clangd_extensions.nvim": { "branch": "main", "commit": "8f7b72100883e0e34400d9518d40a03f21e4d0a6" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
@@ -50,7 +50,7 @@
"multiple-cursors.nvim": { "branch": "main", "commit": "2f5e786c43aa9c0fc34b295cfcc9bfbacef8e926" },
"neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" },
"neoconf.nvim": { "branch": "main", "commit": "658710f44c13ca44b131b51938dc009511dc2063" },
"noice.nvim": { "branch": "main", "commit": "df448c649ef6bc5a6a633a44f2ad0ed8d4442499" },
"noice.nvim": { "branch": "main", "commit": "5a78b42bec5e775f2db03bf93f6d1e0f3636306c" },
"none-ls.nvim": { "branch": "main", "commit": "dcc8cd4efdcb29275681a3c95786a816330dbca6" },
"nui.nvim": { "branch": "main", "commit": "a0fd35fcbb4cb479366f1dc5f20145fd718a3733" },
"nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" },
@@ -70,7 +70,7 @@
"nvim-ufo": { "branch": "main", "commit": "a5390706f510d39951dd581f6d2a972741b3fa26" },
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
"promise-async": { "branch": "main", "commit": "38a4575da9497326badd3995e768b4ccf0bb153e" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "5f73b24aeb94f5274c218955573153c69ce4d1ee" },
"rainbow-delimiters.nvim": { "branch": "master", "commit": "d227e6c9879bb50af35cd733461198666981d482" },
"resession.nvim": { "branch": "master", "commit": "cc819b0489938d03e4f3532a583354f0287c015b" },
"smart-splits.nvim": { "branch": "master", "commit": "1a2b268a7ec7aeef879cdd15973339010ec134f7" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },

View File

@@ -89,5 +89,5 @@ return {
},
},
{ "ribru17/bamboo.nvim", lazy = true },
{ "ribru17/bamboo.nvim", lazy = true, opts = { integrations = { mini = true } } },
}

View File

@@ -18,9 +18,9 @@ return {
{ "gen740/SmoothCursor.nvim", enabled = false },
{ "stevearc/resession.nvim", enabled = true },
{ "AstroNvim/astrotheme", enabled = false },
{ "echasnovski/mini.move", enabled = false },
{ "echasnovski/mini.move", enabled = true },
{ "scottmckendry/cyberdream.nvim", enabled = false },
{ "HiPhish/rainbow-delimiters.nvim", enabled = false },
{ "HiPhish/rainbow-delimiters.nvim", enabled = true },
{ "xiyaowong/transparent.nvim", enabled = true },
{ "MagicDuck/grug-far.nvim", enabled = false },

40
lua/plugins/mini-move.lua Normal file
View File

@@ -0,0 +1,40 @@
return {
"echasnovski/mini.move",
keys = function(_, keys)
local plugin = require("lazy.core.config").spec.plugins["mini.move"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false) -- resolve mini.clue options
-- Populate the keys based on the user's options
local mappings = {
{ opts.mappings.line_left, desc = "Move line left" },
{ opts.mappings.line_right, desc = "Move line right" },
{ opts.mappings.line_down, desc = "Move line down" },
{ opts.mappings.line_up, desc = "Move line up" },
{ opts.mappings.left, desc = "Move selection left", mode = "v" },
{ opts.mappings.right, desc = "Move selection right", mode = "v" },
{ opts.mappings.down, desc = "Move selection down", mode = "v" },
{ opts.mappings.up, desc = "Move selection up", mode = "v" },
}
mappings = vim.tbl_filter(function(m) return m[1] and #m[1] > 0 end, mappings)
return vim.list_extend(mappings, keys)
end,
opts = {
mappings = {
left = "<A-a>",
right = "<A-d>",
down = "<A-s>",
up = "<A-w>",
line_left = "<A-a>",
line_right = "<A-d>",
line_down = "<A-s>",
line_up = "<A-w>",
},
},
specs = {
{
"bamboo", -- Replace with the correct name for the Bamboo colorscheme package if necessary
optional = true,
---@type BambooOptions -- Adjust type if Bamboo has specific options
opts = { integrations = { mini = true } },
},
},
}

View File

@@ -1,16 +1,5 @@
-- Plugins related to motion
return {
-- Move lines up/down/left/right
{
"echasnovski/mini.move",
opts = {},
keys = {
{ "<A-h>", mode = { "n", "x" }, desc = "Move line/block left" },
{ "<A-l>", mode = { "n", "x" }, desc = "Move line/block right" },
{ "<A-j>", mode = { "n", "x" }, desc = "Move line/block down" },
{ "<A-k>", mode = { "n", "x" }, desc = "Move line/block up" },
},
},
-- Faster change/delete/replace delimiter pairs
{
"echasnovski/mini.surround",

View File

@@ -1,8 +1,6 @@
return {
{
"HiPhish/rainbow-delimiters.nvim",
-- event = { "InsertLeave", "TextChanged" },
event = "TextChanged",
dependencies = {
"nvim-treesitter/nvim-treesitter",
{
@@ -28,14 +26,7 @@ return {
},
},
},
-- specs = {
-- {
-- "catppuccin",
-- optional = true,
-- ---@type CatppuccinOptions
-- opts = { integrations = { rainbow_delimiters = true } },
-- },
-- },
event = "User AstroFile",
main = "rainbow-delimiters.setup",
opts = {},
},