From dc03e0785d3479398c7e7e46b0c7209d7a39f05b Mon Sep 17 00:00:00 2001 From: huyjaky Date: Sun, 3 Nov 2024 17:32:21 +0700 Subject: [PATCH] astro-nvim-v3 - add left hand control wasd + Alt for move block --- lazy-lock.json | 8 ++++---- lua/lazy_setup.lua | 2 +- lua/plugins/colorschemes.lua | 2 +- lua/plugins/disabled.lua | 4 ++-- lua/plugins/mini-move.lua | 40 ++++++++++++++++++++++++++++++++++++ lua/plugins/motion.lua | 11 ---------- lua/plugins/ts-rainbow.lua | 11 +--------- 7 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 lua/plugins/mini-move.lua diff --git a/lazy-lock.json b/lazy-lock.json index 8e9add6..214d0c9 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -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" }, diff --git a/lua/lazy_setup.lua b/lua/lazy_setup.lua index 8af39c0..db9d8bd 100644 --- a/lua/lazy_setup.lua +++ b/lua/lazy_setup.lua @@ -22,7 +22,7 @@ require("lazy").setup({ border = "single", size = { width = 0.8, height = 0.8 }, }, - + checker = { enabled = true, notify = false, diff --git a/lua/plugins/colorschemes.lua b/lua/plugins/colorschemes.lua index 1a43714..114c69c 100644 --- a/lua/plugins/colorschemes.lua +++ b/lua/plugins/colorschemes.lua @@ -89,5 +89,5 @@ return { }, }, - { "ribru17/bamboo.nvim", lazy = true }, + { "ribru17/bamboo.nvim", lazy = true, opts = { integrations = { mini = true } } }, } diff --git a/lua/plugins/disabled.lua b/lua/plugins/disabled.lua index 83e6aa7..6fc4313 100644 --- a/lua/plugins/disabled.lua +++ b/lua/plugins/disabled.lua @@ -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 }, diff --git a/lua/plugins/mini-move.lua b/lua/plugins/mini-move.lua new file mode 100644 index 0000000..b8d119d --- /dev/null +++ b/lua/plugins/mini-move.lua @@ -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 = "", + right = "", + down = "", + up = "", + line_left = "", + line_right = "", + line_down = "", + line_up = "", + }, + }, + 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 } }, + }, + }, +} diff --git a/lua/plugins/motion.lua b/lua/plugins/motion.lua index fe0b432..837632e 100644 --- a/lua/plugins/motion.lua +++ b/lua/plugins/motion.lua @@ -1,16 +1,5 @@ -- Plugins related to motion return { - -- Move lines up/down/left/right - { - "echasnovski/mini.move", - opts = {}, - keys = { - { "", mode = { "n", "x" }, desc = "Move line/block left" }, - { "", mode = { "n", "x" }, desc = "Move line/block right" }, - { "", mode = { "n", "x" }, desc = "Move line/block down" }, - { "", mode = { "n", "x" }, desc = "Move line/block up" }, - }, - }, -- Faster change/delete/replace delimiter pairs { "echasnovski/mini.surround", diff --git a/lua/plugins/ts-rainbow.lua b/lua/plugins/ts-rainbow.lua index 8fe0812..6f7802a 100644 --- a/lua/plugins/ts-rainbow.lua +++ b/lua/plugins/ts-rainbow.lua @@ -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 = {}, },