summaryrefslogtreecommitdiffstats
path: root/after/plugin/smartsplits.lua
blob: 54fc07cfd7966b84a60b2ec206fe8013ed01c2f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
local status_ok, smartsplits = pcall(require, "smart-splits")
if not status_ok then
  return
end

smartsplits.setup {
  default_amount = 3,
  resize_mode = {
    quit_key = '<leader>r',
    resize_keys = {
      '<C-h>',
      '<C-j>',
      '<C-k>',
      '<C-l>',
    },
    silent = true,
    hooks = {
      on_enter = function()
        vim.notify("Resize mode on", vim.log.levels.INFO, { title = "Smart Splits" })
        vim.cmd('unmap <leader>r')
      end,
      on_leave = function()
        vim.notify("Resize Mode off", vim.log.levels.INFO, { title = "Smart Splits" })
        vim.keymap.set('n', '<leader>r', smartsplits.start_resize_mode, {})
      end,
    },
  },
}