Repository navigation
feat(split-and-window): add the available smart-splits backends #1807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
mehalter
wants to merge
1
commit into
main
Choose a base branch
from
smart-splits-v3
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-ghostty/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-ghostty/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| 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 = {} }, | ||
| }, | ||
| } | ||
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-herdr/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
28 changes: 28 additions & 0 deletions
28
lua/astrocommunity/split-and-window/smart-splits-backend-herdr/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-kitty/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-kitty/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-tmux/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-tmux/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-wezterm/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-wezterm/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-zellij-lua/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-zellij-lua/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
5 changes: 5 additions & 0 deletions
5
lua/astrocommunity/split-and-window/smart-splits-backend-zellij-rs/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> |
29 changes: 29 additions & 0 deletions
29
lua/astrocommunity/split-and-window/smart-splits-backend-zellij-rs/init.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 = {} }, | ||
| }, | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.luaor something? it's a little tricky sincesmart-splits.nvimitself is in core, so we don't have a natural place here likelua/astrocommunity/split-and-window/smart-splits/utils.luawhich is what I would otherwise recommend.