change smart split keys

This commit is contained in:
Salar Rahmanian 2024-11-01 17:48:29 -07:00
parent 68910abbe0
commit c6c097057c

View file

@ -1,27 +1,22 @@
return { return {
{ "mrjones2014/smart-splits.nvim" }, { "mrjones2014/smart-splits.nvim" },
lazy = false, lazy = false,
config = function() keys = {
local smart_splits = require("smart-splits")
local keymap = vim.keymap
-- recommended mappings
-- resizing splits -- resizing splits
-- these keymaps will also accept a range, { "n", "<A-a>", ":lua require('smart-splits').resize_left()<CR>" },
-- for example `10<A-h>` will `resize_left` by `(10 * config.default_amount)` { "n", "<A-o>", ":lua require('smart-splits').resize_down()<CR>" },
keymap.set("n", "<A-h>", smart_splits.resize_left) { "n", "<A-e>", ":lua require('smart-splits').resize_up()<CR>" },
keymap.set("n", "<A-j>", smart_splits.resize_down) { "n", "<A-u>", ":lua require('smart-splits').resize_right()<CR>" },
keymap.set("n", "<A-k>", smart_splits.resize_up)
keymap.set("n", "<A-l>", smart_splits.resize_right)
-- moving between splits -- moving between splits
keymap.set("n", "<C-h>", smart_splits.move_cursor_left) { "n", "<C-a>", ":lua require('smart-splits').move_cursor_left()<CR>" },
keymap.set("n", "<C-j>", smart_splits.move_cursor_down) { "n", "<C-o>", ":lua require('smart-splits').move_cursor_down()<CR>" },
keymap.set("n", "<C-k>", smart_splits.move_cursor_up) { "n", "<C-e>", ":lua require('smart-splits').move_cursor_up()<CR>" },
keymap.set("n", "<C-l>", smart_splits.move_cursor_right) { "n", "<C-u>", ":lua require('smart-splits').move_cursor_right()<CR>" },
keymap.set("n", "<C-\\>", smart_splits.move_cursor_previous) { "n", "<C-\\>", ":lua require('smart-splits').move_cursor_previous()<CR>" },
-- swapping buffers between windows -- swapping buffers between windows
keymap.set("n", "<leader><leader>h", smart_splits.swap_buf_left) { "n", "<leader><leader>a", ":lua require('smart-splits').swap_buf_left()<CR>" },
keymap.set("n", "<leader><leader>j", smart_splits.swap_buf_down) { "n", "<leader><leader>o", ":lua require('smart-splits').swap_buf_down()<CR>" },
keymap.set("n", "<leader><leader>k", smart_splits.swap_buf_up) { "n", "<leader><leader>e", ":lua require('smart-splits').swap_buf_up()<CR>" },
keymap.set("n", "<leader><leader>l", smart_splits.swap_buf_right) { "n", "<leader><leader>u", ":lua require('smart-splits').swap_buf_right()<CR>" },
end, },
} }