Advertisement
jamesonBradfield

smart-splits.lua

Jan 8th, 2024
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.13 KB | Software | 0 0
  1. return{
  2.   require('smart-splits').setup({
  3.     -- Ignored filetypes (only while resizing)
  4.     ignored_filetypes = {
  5.       'nofile',
  6.       'quickfix',
  7.       'prompt',
  8.     },
  9.     -- Ignored buffer types (only while resizing)
  10.     ignored_buftypes = { 'NvimTree' },
  11.     -- the default number of lines/columns to resize by at a time
  12.     default_amount = 3,
  13.     -- Desired behavior when your cursor is at an edge and you
  14.     -- are moving towards that same edge:
  15.     -- 'wrap' => Wrap to opposite side
  16.     -- 'split' => Create a new split in the desired direction
  17.     -- 'stop' => Do nothing
  18.     -- function => You handle the behavior yourself
  19.     -- NOTE: If using a function, the function will be called with
  20.     -- a context object with the following fields:
  21.     -- {
  22.     --    mux = {
  23.     --      type:'tmux'|'wezterm'|'kitty'
  24.     --      current_pane_id():number,
  25.     --      is_in_session(): boolean
  26.     --      current_pane_is_zoomed():boolean,
  27.     --      -- following methods return a boolean to indicate success or failure
  28.     --      current_pane_at_edge(direction:'left'|'right'|'up'|'down'):boolean
  29.     --      next_pane(direction:'left'|'right'|'up'|'down'):boolean
  30.     --      resize_pane(direction:'left'|'right'|'up'|'down'):boolean
  31.     --      split_pane(direction:'left'|'right'|'up'|'down',size:number|nil):boolean
  32.     --    },
  33.     --    direction = 'left'|'right'|'up'|'down',
  34.     --    split(), -- utility function to split current Neovim pane in the current direction
  35.     --    wrap(), -- utility function to wrap to opposite Neovim pane
  36.     -- }
  37.     -- NOTE: `at_edge = 'wrap'` is not supported on Kitty terminal
  38.     -- multiplexer, as there is no way to determine layout via the CLI
  39.     at_edge = 'wrap',
  40.     -- when moving cursor between splits left or right,
  41.     -- place the cursor on the same row of the *screen*
  42.     -- regardless of line numbers. False by default.
  43.     -- Can be overridden via function parameter, see Usage.
  44.     move_cursor_same_row = false,
  45.     -- whether the cursor should follow the buffer when swapping
  46.     -- buffers by default; it can also be controlled by passing
  47.     -- `{ move_cursor = true }` or `{ move_cursor = false }`
  48.     -- when calling the Lua function.
  49.     cursor_follows_swapped_bufs = false,
  50.     -- resize mode options
  51.     resize_mode = {
  52.       -- key to exit persistent resize mode
  53.       quit_key = '<ESC>',
  54.       -- keys to use for moving in resize mode
  55.       -- in order of left, down, up' right
  56.       resize_keys = { 'h', 'j', 'k', 'l' },
  57.       -- set to true to silence the notifications
  58.       -- when entering/exiting persistent resize mode
  59.       silent = false,
  60.       -- must be functions, they will be executed when
  61.       -- entering or exiting the resize mode
  62.       hooks = {
  63.         on_enter = nil,
  64.         on_leave = nil,
  65.       },
  66.     },
  67.     -- ignore these autocmd events (via :h eventignore) while processing
  68.     -- smart-splits.nvim computations, which involve visiting different
  69.     -- buffers and windows. These events will be ignored during processing,
  70.     -- and un-ignored on completed. This only applies to resize events,
  71.     -- not cursor movement events.
  72.     ignored_events = {
  73.       'BufEnter',
  74.       'WinEnter',
  75.     },
  76.     -- enable or disable a multiplexer integration;
  77.     -- automatically determined, unless explicitly disabled or set,
  78.     -- by checking the $TERM_PROGRAM environment variable,
  79.     -- and the $KITTY_LISTEN_ON environment variable for Kitty
  80.     multiplexer_integration = nil,
  81.     -- disable multiplexer navigation if current multiplexer pane is zoomed
  82.     -- this functionality is only supported on tmux and Wezterm due to kitty
  83.     -- not having a way to check if a pane is zoomed
  84.     disable_multiplexer_nav_when_zoomed = true,
  85.     -- Supply a Kitty remote control password if needed,
  86.     -- or you can also set vim.g.smart_splits_kitty_password
  87.     -- see https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.remote_control_password
  88.     kitty_password = nil,
  89.     -- default logging level, one of: 'trace'|'debug'|'info'|'warn'|'error'|'fatal'
  90.     log_level = 'info',
  91.  
  92.     -- require("core.utils").load_mappings("smartSplits"),
  93.   })
  94. }
  95.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement