FEAT: Move lines around more easily in 3 different modes using alt-j and
alt-k
This commit is contained in:
parent
85f3ba3d71
commit
5b3ec85c91
@ -14,3 +14,12 @@ elseif osname == "Linux" then
|
||||
-- Linux only!!
|
||||
vim.keymap.set('n', '<leader>x', "<cmd>!chmod +x %<CR>", { silent = true })
|
||||
end
|
||||
-- Move lines while in visual mode
|
||||
vim.keymap.set('v', '<A-j>', ':m \'>+1<CR>gv=gv', {noremap = true})
|
||||
vim.keymap.set('v', '<A-k>', ':m \'<-2<CR>gv=gv', {noremap = true})
|
||||
-- Move lines while in normal mode
|
||||
vim.keymap.set('n', '<A-j>', ':m .+1<CR>==', {noremap = true})
|
||||
vim.keymap.set('n', '<A-k>', ':m .-2<CR>==', {noremap = true})
|
||||
-- Move line in edit mode
|
||||
vim.keymap.set('i', '<A-j>', ':m .+1<CR>==gi', {noremap = true})
|
||||
vim.keymap.set('i', '<A-k>', ':m .-2<CR>==gi', {noremap = true})
|
||||
|
Loading…
Reference in New Issue
Block a user