From 0197e64dc2a1841f870107ede41bd85fc458b8f6 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 7 Aug 2024 18:16:14 +0200 Subject: [PATCH] Removed move.nvim in favor of vanilla fim --- lua/keymaps.lua | 18 +++++++----------- lua/lazy-plugins.lua | 3 --- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 05ed86a..3f272f3 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -46,17 +46,13 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) --- Normal-mode commands -vim.keymap.set('n', '', 'MoveLine(1)') -vim.keymap.set('n', '', 'MoveLine(-1)') -vim.keymap.set('n', '', 'MoveHChar(-1)') -vim.keymap.set('n', '', 'MoveHChar(1)') - --- Visual-mode commands -vim.keymap.set('v', '', 'MoveBlock(1)') -vim.keymap.set('v', '', 'MoveBlock(-1)') -vim.keymap.set('v', '', 'MoveHBlock(-1)') -vim.keymap.set('v', '', 'MoveHBlock(1)') +-- Move Lines +vim.keymap.set('n', '', 'm .+1==', { desc = 'Move Down' }) +vim.keymap.set('n', '', 'm .-2==', { desc = 'Move Up' }) +vim.keymap.set('i', '', 'm .+1==gi', { desc = 'Move Down' }) +vim.keymap.set('i', '', 'm .-2==gi', { desc = 'Move Up' }) +vim.keymap.set('v', '', ":m '>+1gv=gv", { desc = 'Move Down' }) +vim.keymap.set('v', '', ":m '<-2gv=gv", { desc = 'Move Up' }) -- https://github.com/mhinz/vim-galore#saner-behavior-of-n-and-n vim.keymap.set('n', 'n', "'Nn'[v:searchforward].'zv'", { expr = true, desc = 'Next Search Result' }) diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index daf934a..4e0cfd0 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -16,9 +16,6 @@ require('lazy').setup({ -- Remember position { 'vladdoster/remember.nvim', opts = {} }, - -- Move lines - { 'fedepujol/move.nvim', opts = { noremap = true, silent = true } }, - -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc.