From 8d7b580f153fad15d93fb24ed23fe3a73c67c747 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 7 Aug 2024 18:02:47 +0200 Subject: [PATCH 1/4] Some new sane default binds from lazyvim --- lua/keymaps.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 1b7561a..b46ffae 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -60,4 +60,27 @@ vim.keymap.set('v', '', 'MoveBlock(-1)') vim.keymap.set('v', '', 'MoveHBlock(-1)') vim.keymap.set('v', '', 'MoveHBlock(1)') +-- 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' }) +vim.keymap.set('x', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next Search Result' }) +vim.keymap.set('o', 'n', "'Nn'[v:searchforward]", { expr = true, desc = 'Next Search Result' }) +vim.keymap.set('n', 'N', "'nN'[v:searchforward].'zv'", { expr = true, desc = 'Prev Search Result' }) +vim.keymap.set('x', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev Search Result' }) +vim.keymap.set('o', 'N', "'nN'[v:searchforward]", { expr = true, desc = 'Prev Search Result' }) + +-- Buffers +vim.keymap.set('n', '', 'bprevious', { desc = 'Prev Buffer' }) +vim.keymap.set('n', '', 'bnext', { desc = 'Next Buffer' }) +vim.keymap.set('n', 'bb', 'e #', { desc = 'Switch to Other Buffer' }) +vim.keymap.set('n', 'bD', ':bd', { desc = 'Delete Buffer and Window' }) + +-- Tabs +vim.keymap.set('n', 'l', 'tablast', { desc = 'Last Tab' }) +vim.keymap.set('n', 'o', 'tabonly', { desc = 'Close Other Tabs' }) +vim.keymap.set('n', 'f', 'tabfirst', { desc = 'First Tab' }) +vim.keymap.set('n', '', 'tabnew', { desc = 'New Tab' }) +vim.keymap.set('n', 'd', 'tabclose', { desc = 'Close Tab' }) +vim.keymap.set('n', ']', 'tabnext', { desc = 'Next Tab' }) +vim.keymap.set('n', '[', 'tabprevious', { desc = 'Previous Tab' }) + -- vim: ts=2 sts=2 sw=2 et From ebf12761126a2534f5d7422bf85abffbbefadb3a Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 7 Aug 2024 18:03:09 +0200 Subject: [PATCH 2/4] Reworked resize window binds --- lua/keymaps.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index b46ffae..a34583e 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -31,10 +31,10 @@ vim.keymap.set('n', '', 'echo "Use k to move!!"') vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Resize windows -vim.keymap.set('n', '', 'wincmd 15 >', { desc = 'Increase window width' }) -vim.keymap.set('n', '', 'wincmd 15 <', { desc = 'Decrease window width' }) -vim.keymap.set('n', '', 'wincmd 5 +', { desc = 'Increase window height' }) -vim.keymap.set('n', '', 'wincmd 5 -', { desc = 'Decrease window height' }) +vim.keymap.set('n', '', 'resize +2', { desc = 'Increase Window Height' }) +vim.keymap.set('n', '', 'resize -2', { desc = 'Decrease Window Height' }) +vim.keymap.set('n', '', 'vertical resize -2', { desc = 'Decrease Window Width' }) +vim.keymap.set('n', '', 'vertical resize +2', { desc = 'Increase Window Width' }) vim.keymap.set('n', '', 'wincmd =', { desc = 'Set height/width equal' }) -- Keybinds to make split navigation easier. From 1aade94ba8f302a8cb340956922b0dbf9721292a Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 7 Aug 2024 18:03:22 +0200 Subject: [PATCH 3/4] Remove unused MoveWord bindings --- lua/keymaps.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/lua/keymaps.lua b/lua/keymaps.lua index a34583e..05ed86a 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -51,8 +51,6 @@ vim.keymap.set('n', '', 'MoveLine(1)') vim.keymap.set('n', '', 'MoveLine(-1)') vim.keymap.set('n', '', 'MoveHChar(-1)') vim.keymap.set('n', '', 'MoveHChar(1)') -vim.keymap.set('n', 'wf', 'MoveWord(1)') -vim.keymap.set('n', 'wb', 'MoveWord(-1)') -- Visual-mode commands vim.keymap.set('v', '', 'MoveBlock(1)') From 0197e64dc2a1841f870107ede41bd85fc458b8f6 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 7 Aug 2024 18:16:14 +0200 Subject: [PATCH 4/4] 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.