mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
904 stars 38 forks source link

feat(api): `at_edge` may now be a user-defined function #87

Closed mrjones2014 closed 1 year ago

mrjones2014 commented 1 year ago

Fixes #85

mrjones2014 commented 1 year ago

@IndianBoy42 Does this work for you?

IndianBoy42 commented 1 year ago
      at_edge = function(ctx)
        if ctx.direction == "left" then
          vim.cmd.NvimTreeFocus()
        elseif ctx.direction == "right" then
          vim.cmd.Trouble()
        else
          ctx.split()
        end
      end,

This seems to work great! thanks again

I did notice that the context object doesn't have a wrap() helper, a user might want to fallback to wrapping unlike me right?

mrjones2014 commented 1 year ago

Good call. Added.