Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-ghostty

Seamless navigation between Neovim splits and Ghostty/cmux panes on macOS.

**Repository:** <https://github.com/smart-splits-nvim/backend-ghostty>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-ghostty"
return {
"smart-splits-nvim/smart-splits.nvim",
event = vim.trim((vim.env.TERM_PROGRAM or ""):lower()) == "ghostty" and "VeryLazy" or nil,
opts = function(_, opts)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with the conventions of this repo yet so idk where exactly it would go but it might be worth extracting this to a shared helper function somewhere

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah we do have a small "utility" file for AstroCommunity but it has focused on some pretty general things that is useful for any and all plugin specs. Not sure if we want to expand it to being for more specific stuff. Not sure what the best pattern is here honestly

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe something like lua/astrocommunity/split-and-window/utils.lua or something? it's a little tricky since smart-splits.nvim itself is in core, so we don't have a natural place here like lua/astrocommunity/split-and-window/smart-splits/utils.lua which is what I would otherwise recommend.

if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { prev_backend, backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, require(backend))
return selected
else
return { selected, require(backend) }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-ghostty", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-herdr

A herdr backend for smart-splits.nvim v3.

**Repository:** <https://github.com/adriankarlen/smart-splits-backend-herdr>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local backend = "smart-splits-backend-herdr"
return {
"smart-splits-nvim/smart-splits.nvim",
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, 1, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { backend, prev_backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, 1, require(backend))
return selected
else
return { require(backend), selected }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "adriankarlen/smart-splits-backend-herdr", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-kitty

Kitty backend for smart-splits.

**Repository:** <https://github.com/smart-splits-nvim/backend-kitty>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-kitty"
return {
"smart-splits-nvim/smart-splits.nvim",
event = vim.env.KITTY_LISTEN_ON and "VeryLazy" or nil,
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { prev_backend, backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, require(backend))
return selected
else
return { selected, require(backend) }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-kitty", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-tmux

smart-splits.nvim backend for tmux.

**Repository:** <https://github.com/smart-splits-nvim/backend-tmux>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-tmux"
return {
"smart-splits-nvim/smart-splits.nvim",
event = vim.trim((vim.env.TERM_PROGRAM or ""):lower()) == "tmux" and "VeryLazy" or nil,
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, 1, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { backend, prev_backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, 1, require(backend))
return selected
else
return { require(backend), selected }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-tmux", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-wezterm

Wezterm backend for smart-splits.nvim.

**Repository:** <https://github.com/smart-splits-nvim/backend-wezterm>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-wezterm"
return {
"smart-splits-nvim/smart-splits.nvim",
event = vim.trim((vim.env.TERM_PROGRAM or ""):lower()) == "wezterm" and "VeryLazy" or nil,
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { prev_backend, backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, require(backend))
return selected
else
return { selected, require(backend) }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-wezterm", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-zellij-lua

Zellij backend for smart-splits.

**Repository:** <https://github.com/smart-splits-nvim/backend-zellij-lua>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-zellij-lua"
return {
"smart-splits-nvim/smart-splits.nvim",
event = (vim.env.ZELLIJ and #vim.env.ZELLIJ > 0) and "VeryLazy" or nil,
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, 1, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { backend, prev_backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, 1, require(backend))
return selected
else
return { require(backend), selected }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-zellij-lua", lazy = true, opts = {} },
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# smart-splits-backend-zellij-rs

Zellij backend for smart-splits, written in Rust.

**Repository:** <https://github.com/smart-splits-nvim/backend-zellij-rs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local backend = "smart-splits-backend-zellij-rs"
return {
"smart-splits-nvim/smart-splits.nvim",
event = (vim.env.ZELLIJ and #vim.env.ZELLIJ > 0) and "VeryLazy" or nil,
opts = function(_, opts)
if not opts.mux then opts.mux = {} end
local prev_backend = opts.mux.backend
if type(prev_backend) == "table" then
table.insert(prev_backend, 1, backend)
elseif type(prev_backend) == "string" then
opts.mux.backend = { backend, prev_backend }
elseif type(prev_backend) == "function" then
opts.mux.backend = function()
local selected = prev_backend()
if selected[1] then
table.insert(selected, 1, require(backend))
return selected
else
return { require(backend), selected }
end
end
else
opts.mux.backend = { backend }
end
end,
specs = {
{ "smart-splits-nvim/backend-zellij-rs", lazy = true, opts = {} },
},
}
Loading