LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.31k stars 1.18k forks source link

Error while moving lines #292

Closed lkabuci closed 1 year ago

lkabuci commented 1 year ago

i get an error while moving a chunk of lines down "E134: Cannot move a range of lines into itself" https://github.com/LunarVim/Neovim-from-scratch/blob/2c7a64973602e8d9d18f6de75022014e96fa576a/lua/user/keymaps.lua#L54

lkabuci commented 1 year ago

I tried to use keymap("v", "<A-k>", ":m .-2<CR>==gv", opts) but it didn't work

Alexis12119 commented 1 year ago

Can you try this? It's from my config and I think it works.

-- Move text up
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv")
-- Move text down
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
Alexis12119 commented 1 year ago

I would like to work on this issue. Can you assign it to me?