diff --git a/lua/plugins/smart-splits.lua b/lua/plugins/smart-splits.lua new file mode 100644 index 00000000..498de53c --- /dev/null +++ b/lua/plugins/smart-splits.lua @@ -0,0 +1,28 @@ +return { + { + "mrjones2014/smart-splits.nvim", + lazy = false, + config = function() + require("smart-splits").setup() + + -- resizing splits + -- these keymaps will also accept a range, + -- for example `10` will `resize_left` by `(10 * config.default_amount)` + vim.keymap.set('n', '', require('smart-splits').resize_left) + vim.keymap.set('n', '', require('smart-splits').resize_down) + vim.keymap.set('n', '', require('smart-splits').resize_up) + vim.keymap.set('n', '', require('smart-splits').resize_right) + -- moving between splits + vim.keymap.set('n', '', require('smart-splits').move_cursor_left) + vim.keymap.set('n', '', require('smart-splits').move_cursor_down) + vim.keymap.set('n', '', require('smart-splits').move_cursor_up) + vim.keymap.set('n', '', require('smart-splits').move_cursor_right) + vim.keymap.set('n', '', require('smart-splits').move_cursor_previous) + -- swapping buffers between windows + vim.keymap.set('n', 'h', require('smart-splits').swap_buf_left) + vim.keymap.set('n', 'j', require('smart-splits').swap_buf_down) + vim.keymap.set('n', 'k', require('smart-splits').swap_buf_up) + vim.keymap.set('n', 'l', require('smart-splits').swap_buf_right) + end + } +}