mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-07-03 22:14:39 +02:00
feat(extras): use mini.move instead of native move (#2865)
This commit is contained in:
parent
e29c7acd2d
commit
8f1fb60f0a
1 changed files with 32 additions and 0 deletions
32
lua/lazyvim/plugins/extras/editor/mini-move.lua
Normal file
32
lua/lazyvim/plugins/extras/editor/mini-move.lua
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"echasnovski/mini.move",
|
||||||
|
event = "VeryLazy",
|
||||||
|
opts = {},
|
||||||
|
keys = function()
|
||||||
|
local ret = {}
|
||||||
|
local directions = { "left", "down", "up", "right" }
|
||||||
|
local keys = { "h", "j", "k", "l" }
|
||||||
|
local move = require("mini.move")
|
||||||
|
for i, dir in ipairs(directions) do
|
||||||
|
ret[#ret + 1] = {
|
||||||
|
"<A-" .. keys[i] .. ">",
|
||||||
|
mode = { "i", "n" },
|
||||||
|
function()
|
||||||
|
move.move_line(dir)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
for i, dir in ipairs(directions) do
|
||||||
|
ret[#ret + 1] = {
|
||||||
|
"<A-" .. keys[i] .. ">",
|
||||||
|
mode = { "v" },
|
||||||
|
function()
|
||||||
|
move.move_selection(dir)
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return ret
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue