Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add zellij action new-tab completions #821

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions custom-completions/zellij/zellij-completions.nu
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def "nu-complete sessions" [] {
^zellij ls -n | lines | parse "{value} {description}"
}

def "nu-complete zellij layouts" [] {
ls ~/.config/zellij/layouts/
fdncred marked this conversation as resolved.
Show resolved Hide resolved
| where name =~ "\\.kdl"
| get name
| each { |$it| { value: ($it | path basename | str replace ".kdl" ""), description: $it } }
}

# Turned off since it messes with sub-commands
#export extern "zellij" [
# command?: string@"nu-complete zellij"
Expand All @@ -106,6 +113,15 @@ export extern "zellij action rename-tab" [
name: string # Name for the tab
]

# Create a new tab, optionally with a specified tab layout and name
export extern "zellij action new-tab" [
--cwd(-c): path # Change the working directory of the new tab
--help(-h) # Print help information
--layout(-l): string@"nu-complete zellij layouts" # Layout ot use for the new tab
--layout-dir: path # Default folder to look for layouts
--name(-n): string # Name for the tab
]

# Attach to a session
export extern "zellij attach" [
session_name: string@"nu-complete sessions" # Name of the session to attach to
Expand Down