From 68910abbe066964a49c76a8d34b1280704f95041 Mon Sep 17 00:00:00 2001 From: Salar Rahmanian Date: Wed, 30 Oct 2024 23:56:08 -0700 Subject: [PATCH] add smart splits --- lua/plugins/smart-splits.lua | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lua/plugins/smart-splits.lua diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua new file mode 100644 index 0000000..e552197 --- /dev/null +++ b/lua/plugins/smart-splits.lua @@ -0,0 +1,27 @@ +return { + { "mrjones2014/smart-splits.nvim" }, + lazy = false, + config = function() + local smart_splits = require("smart-splits") + local keymap = vim.keymap + -- recommended mappings + -- resizing splits + -- these keymaps will also accept a range, + -- for example `10` will `resize_left` by `(10 * config.default_amount)` + keymap.set("n", "", smart_splits.resize_left) + keymap.set("n", "", smart_splits.resize_down) + keymap.set("n", "", smart_splits.resize_up) + keymap.set("n", "", smart_splits.resize_right) + -- moving between splits + keymap.set("n", "", smart_splits.move_cursor_left) + keymap.set("n", "", smart_splits.move_cursor_down) + keymap.set("n", "", smart_splits.move_cursor_up) + keymap.set("n", "", smart_splits.move_cursor_right) + keymap.set("n", "", smart_splits.move_cursor_previous) + -- swapping buffers between windows + keymap.set("n", "h", smart_splits.swap_buf_left) + keymap.set("n", "j", smart_splits.swap_buf_down) + keymap.set("n", "k", smart_splits.swap_buf_up) + keymap.set("n", "l", smart_splits.swap_buf_right) + end, +} -- 2.46.1