Skip to content

Commit

Permalink
feat(plugins): add new smart-splits plugin configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ecosse3 committed Jul 14, 2024
1 parent a731f11 commit 9835bbf
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions lua/plugins/smart-splits.lua
Original file line number Diff line number Diff line change
@@ -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<A-h>` will `resize_left` by `(10 * config.default_amount)`
vim.keymap.set('n', '<A-h>', require('smart-splits').resize_left)
vim.keymap.set('n', '<A-j>', require('smart-splits').resize_down)
vim.keymap.set('n', '<A-k>', require('smart-splits').resize_up)
vim.keymap.set('n', '<A-l>', require('smart-splits').resize_right)
-- moving between splits
vim.keymap.set('n', '<C-h>', require('smart-splits').move_cursor_left)
vim.keymap.set('n', '<C-j>', require('smart-splits').move_cursor_down)
vim.keymap.set('n', '<C-k>', require('smart-splits').move_cursor_up)
vim.keymap.set('n', '<C-l>', require('smart-splits').move_cursor_right)
vim.keymap.set('n', '<C-\\>', require('smart-splits').move_cursor_previous)
-- swapping buffers between windows
vim.keymap.set('n', '<leader><leader>h', require('smart-splits').swap_buf_left)
vim.keymap.set('n', '<leader><leader>j', require('smart-splits').swap_buf_down)
vim.keymap.set('n', '<leader><leader>k', require('smart-splits').swap_buf_up)
vim.keymap.set('n', '<leader><leader>l', require('smart-splits').swap_buf_right)
end
}
}

0 comments on commit 9835bbf

Please sign in to comment.