Add aliases
parent
3adff68faf
commit
c0d374f8ed
@ -0,0 +1,549 @@
|
||||
|
||||
def "nu-complete gh" [] {
|
||||
^gh --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh" [
|
||||
command?: string@"nu-complete gh"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh auth" [] {
|
||||
^gh auth --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh auth" [
|
||||
command?: string@"nu-complete gh auth"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh browse" [
|
||||
command?: string # TODO: completion with [<PR number> | <file path> | <commit-SHA>]
|
||||
--branch(-b) # Select another branch by passing in the branch name
|
||||
--commit(-c) # Select another commit by passing in the commit SHA, default is the last commit
|
||||
--no-browser(-n) # Print destination URL instead of opening the browser
|
||||
--projects(-p) # Open repository projects
|
||||
--releases(-r) # Open repository releases
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--settings(-s) # Open repository settings
|
||||
--wiki(-w) # Open repository wiki
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh codespace" [] {
|
||||
^gh codespace --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh codespace" [
|
||||
command?: string@"nu-complete gh codespace"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh gist" [] {
|
||||
^gh gist --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh gist" [
|
||||
command?: string@"nu-complete gh gist"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist clone" [
|
||||
gist: string # gist to clone
|
||||
directory?:path # directory to clone
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist create" [
|
||||
filename_or_stdin: string # gist to create
|
||||
--desc(-d): string # A description for this gist
|
||||
--filename(-f): string # Provide a filename to be used when reading from standard input
|
||||
--public(-p) # List the gist publicly (default: secret)
|
||||
--web(-w) # Open the web browser with created gist
|
||||
--public # Make the new gist public
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist delete" [
|
||||
gist: string@"nu-complete gist list" # gist to delete
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist edit" [
|
||||
gist: string@"nu-complete gist list" # gist to edit
|
||||
--add(-a): string # Add a new file to the gist
|
||||
--desc(-d): string # New description for the gist
|
||||
--filename(-f): string # Select a file to edit
|
||||
--remove(-r): string # Remove a file from the gist
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gist list" [] {
|
||||
# TODO add the name of the gist to autocompletion
|
||||
^gh gist list --limit 100 | lines | str replace --regex --multiline '\S+\K.*' ''
|
||||
}
|
||||
|
||||
export extern "gh gist list" [
|
||||
--limit(-L): number # Maximum number of repositories to list (default 30)
|
||||
--public # Show only the public gists
|
||||
--secret # Show only the secret gists
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist rename" [
|
||||
gist: string # gist to rename
|
||||
oldFilename: string # gist to rename
|
||||
newFilename: string # gist to rename
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh gist view" [
|
||||
gist?: string # gist to view
|
||||
--filename(-f): string # Display a single file from the gist
|
||||
--files # List file names from the gist
|
||||
--raw(-r) # Print raw instead of rendered gist contents
|
||||
--web(-w) # Open gist in the browser
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh issue" [] {
|
||||
^gh issue --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh issue" [
|
||||
command?: string@"nu-complete gh issue"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh org" [] {
|
||||
^gh org --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh org" [
|
||||
command?: string@"nu-complete gh org"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh pr" [] {
|
||||
^gh pr --help | lines | filter { str starts-with " " } | skip 1 | parse "{value}: {description}" | str trim
|
||||
}
|
||||
|
||||
export extern "gh pr" [
|
||||
command?: string@"nu-complete gh pr"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh list prs" [] {
|
||||
gh pr list --json title,number,author,updatedAt | from json | update author {|row| $row.author.login } | rename --column { number: value } | insert description { |row| ( $row.updatedAt | date humanize) + " - " + $row.title + " by " + $row.author } | select value description
|
||||
}
|
||||
|
||||
export extern "gh pr checkout" [
|
||||
branch_url_or_PRnumber: string@"nu-complete gh list prs" # {<number> | <url> | <branch>}
|
||||
--branch(-b): string # Local branch name to use (default: the name of the head branch)
|
||||
--detach # Checkout PR with a detached HEAD
|
||||
--force(-f) # Reset the existing local branch to the latest state of the pull request
|
||||
--recurse-submodules # Update all submodules after checkout
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh project" [] {
|
||||
^gh project --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh project" [
|
||||
command?: string@"nu-complete gh project"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh release" [] {
|
||||
^gh release --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh release" [
|
||||
command?: string@"nu-complete gh release"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh repo" [] {
|
||||
^gh repo --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh repo" [
|
||||
command?: string@"nu-complete gh repo"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh repo clone" [] {
|
||||
# regex that actually works
|
||||
# ^(?P<value>\S+) +(?P<description>\S+( \S+)*)? {2,}(?P<Visibility>public|private),?.*(?P<updated>about.*)
|
||||
^gh repo list --limit 100 | lines | str replace --regex --multiline '\S+\K.*' ''
|
||||
}
|
||||
|
||||
export extern "gh repo clone" [
|
||||
command: string@"nu-complete gh repo clone"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete visibility" [] {
|
||||
['public', 'private', 'internal']
|
||||
}
|
||||
|
||||
export extern "gh repo list" [
|
||||
owner?: string # List repos of this owner
|
||||
--archived # Show only archived repositories
|
||||
--fork # Show only forks
|
||||
--jq(-q):string # Filter JSON output using a jq expression
|
||||
--json: string # Output JSON with the specified fields
|
||||
--language(-l): string # Filter by primary coding language
|
||||
--limit(-L): number # Maximum number of repositories to list (default 30)
|
||||
--no-archived # Omit archived repositories
|
||||
--source # Show only non-forks
|
||||
--template(-t): string # Format JSON output using a Go template; see "gh help formatting"
|
||||
--topic: string # Filter by topic
|
||||
--visibility: string@"nu-complete visibility" # Filter by repository visibility: {public|private|internal}
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh repo view" [
|
||||
org_repo: string # <ORG/REPO> to view
|
||||
--branch(-b):string # View a specific branch of the repository
|
||||
--jq(-q):string # Filter JSON output using a jq expression
|
||||
--json: string # Output JSON with the specified fields
|
||||
--template(-t):string # Format JSON output using a Go template; see "gh help formatting"
|
||||
--web # Open a repository in the browser
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gitignore list" [] {
|
||||
^gh api -H "Accept: application/vnd.github+json" /gitignore/templates
|
||||
| from json
|
||||
}
|
||||
|
||||
def "nu-complete licenses list" [] {
|
||||
let value = ^gh api -H "Accept: application/vnd.github+json" /licenses | from json | get key | enumerate | reject index | rename value
|
||||
let description = ^gh api -H "Accept: application/vnd.github+json" /licenses | from json | get name | enumerate | reject index | rename description
|
||||
$value | merge $description
|
||||
}
|
||||
|
||||
export extern "gh repo create" [
|
||||
repo_name?: string
|
||||
--help # Show help for command
|
||||
--add-readme # Add a README file to the new repository
|
||||
--clone(-c) # Clone the new repository to the current directory
|
||||
--description(-d): string # Description of the repository
|
||||
--disable-issues # Disable issues in the new repository
|
||||
--disable-wiki # Disable wiki in the new repository
|
||||
--gitignore(-g): string@"nu-complete gitignore list" # Specify a gitignore template for the repository
|
||||
--homepage(-g): string # Repository home page URL
|
||||
--include-all-branches # Include all branches from template repository
|
||||
--internal # Make the new repository internal
|
||||
--license(-l): string@"nu-complete licenses list" # Specify an Open Source License for the repository
|
||||
--private # Make the new repository private
|
||||
--public # Make the new repository public
|
||||
--push # Push local commits to the new repository
|
||||
--remote(-r): string # Specify remote name for the new repository
|
||||
--source(-s): string # Specify path to local repository to use as source
|
||||
--team(-t): string # The name of the organization team to be granted access
|
||||
--template(-p): string # Make the new repository based on a template repository
|
||||
]
|
||||
|
||||
export extern "gh repo fork" [
|
||||
repo?: string
|
||||
--clone # Clone the fork
|
||||
--default-branch-only # Only include the default branch in the fork
|
||||
--fork-name: string # Rename the forked repository
|
||||
--org: string # Create the fork in an organization
|
||||
--remote # Add a git remote for the fork
|
||||
--remote-name: string # Specify the name for the new remote (default "origin")
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh cache" [] {
|
||||
^gh cache --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh cache" [
|
||||
command?: string@"nu-complete gh cache"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh run" [] {
|
||||
^gh run --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh run" [
|
||||
command?: string@"nu-complete gh run"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh workflow" [] {
|
||||
^gh workflow --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh workflow" [
|
||||
command?: string@"nu-complete gh workflow"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh alias" [] {
|
||||
^gh alias --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh alias" [
|
||||
command?: string@"nu-complete gh alias"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh api" [] {
|
||||
# TODO
|
||||
# endpoints
|
||||
# ["graphql", "gists"]
|
||||
}
|
||||
|
||||
export extern "gh api" [
|
||||
--cache # Cache the response, e.g. "3600s", "60m", "1h"
|
||||
--field(-F) # `key=value` Add a typed parameter in key=value format
|
||||
--header(-H) # `key:value` Add a HTTP request header in key:value format
|
||||
--hostname # The GitHub hostname for the request (default "github.com")
|
||||
--include(-i) # Include HTTP response status line and headers in the output
|
||||
--input file # The file to use as body for the HTTP request (use "-" to read from standard input)
|
||||
--jq(-q) # Query to select values from the response using jq syntax
|
||||
--method(-X) # The HTTP method for the request (default "GET")
|
||||
--paginate # Make additional HTTP requests to fetch all pages of results
|
||||
--preview(-p) # GitHub API preview names to request (without the "-preview" suffix)
|
||||
--raw-field(-f) # `key:value` Add a string parameter in key=value format
|
||||
--silent # Do not print the response body
|
||||
--template(-t) # Format JSON output using a Go template; see "gh help formatting"
|
||||
--verbose # Include full HTTP request and response in the output
|
||||
--help # Show help for command
|
||||
command?: string@"nu-complete gh api"
|
||||
]
|
||||
|
||||
def "nu-complete gh completion" [] {
|
||||
['bash', 'fish', 'powershell', 'zsh']
|
||||
}
|
||||
|
||||
export extern "gh completion" [
|
||||
command?: string@"nu-complete gh completion"
|
||||
--shell(-s) # Shell type: {bash|zsh|fish|powershell}
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh config" [] {
|
||||
^gh config --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh config" [
|
||||
command?: string@"nu-complete gh config"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh extension" [] {
|
||||
^gh extension --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh extension" [
|
||||
command?: string@"nu-complete gh extension"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh gpg-key" [] {
|
||||
^gh gpg-key --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh gpg-key" [
|
||||
command?: string@"nu-complete gh gpg-key"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh label" [] {
|
||||
^gh label --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh label" [
|
||||
command?: string@"nu-complete gh label"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh ruleset" [] {
|
||||
^gh ruleset --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh ruleset" [
|
||||
command?: string@"nu-complete gh ruleset"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh search" [] {
|
||||
^gh search --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh search" [
|
||||
--extension # Filter on file extension
|
||||
--filename # Filter on filename
|
||||
--jq(-q) # Filter JSON output using a jq expression
|
||||
--json # Output JSON with the specified fields
|
||||
--language # Filter results by language
|
||||
--limit(-L) # Maximum number of code results to fetch (default 30)
|
||||
--match # Restrict search to file contents or file path: {file|path}
|
||||
--owner # Filter on owner
|
||||
--repo(-R) # Filter on repository
|
||||
--size # Filter on size range, in kilobytes
|
||||
--template(-t) # Format JSON output using a Go template; see "gh help formatting"
|
||||
--web(-w) a # Open the search query in the web browser
|
||||
--help # Show help for command
|
||||
command?: string@"nu-complete gh search"
|
||||
]
|
||||
|
||||
def "nu-complete gh secret" [] {
|
||||
^gh secret --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh secret" [
|
||||
command?: string@"nu-complete gh secret"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh ssh-key" [] {
|
||||
^gh ssh-key --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh ssh-key" [
|
||||
command?: string@"nu-complete gh ssh-key"
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
export extern "gh status" [
|
||||
--exclude(-e) # Comma separated list of repos to exclude in owner/name format
|
||||
--org(-o) # Report status within an organization
|
||||
--help # Show help for command
|
||||
]
|
||||
|
||||
def "nu-complete gh variable" [] {
|
||||
^gh variable --help
|
||||
| lines
|
||||
| filter { str starts-with " " }
|
||||
| skip 1
|
||||
| parse "{value}: {description}"
|
||||
| str trim
|
||||
}
|
||||
|
||||
export extern "gh variable" [
|
||||
command?: string@"nu-complete gh variable"
|
||||
--repo(-R) # Select another repository using the [HOST/]OWNER/REPO format
|
||||
--help # Show help for command
|
||||
]
|
@ -0,0 +1,28 @@
|
||||
def "nu-complete npm" [] {
|
||||
^npm -l
|
||||
|lines
|
||||
|find 'Run "'
|
||||
|str trim
|
||||
|split column -c ' '
|
||||
|get column4
|
||||
|str replace '"' ''
|
||||
}
|
||||
|
||||
export extern "npm" [
|
||||
command?: string@"nu-complete npm"
|
||||
]
|
||||
|
||||
def "nu-complete npm run" [] {
|
||||
open ./package.json
|
||||
|get scripts
|
||||
|columns
|
||||
}
|
||||
|
||||
export extern "npm run" [
|
||||
command?: string@"nu-complete npm run"
|
||||
--workspace(-w)
|
||||
--include-workspace-root
|
||||
--if-present
|
||||
--ignore-scripts
|
||||
--script-shell
|
||||
]
|
@ -0,0 +1,228 @@
|
||||
def "nu-complete subcommands" [] {
|
||||
^zellij --help | split column "SUBCOMMANDS:" | get column2.0 | str trim | lines | str trim | parse -r '(?P<command>^[
|
||||
a-z-]+)' | get command
|
||||
}
|
||||
|
||||
def "nu-complete zellij" [] {
|
||||
[
|
||||
{ value: "action", description: "Send actions to a specific session [aliases: ac]" },
|
||||
{ value: "attach", description: "Attach to a session [aliases: a]" },
|
||||
{ value: "convert-config", description: "" },
|
||||
{ value: "convert-layout", description: "" },
|
||||
{ value: "convert-theme", description: "" },
|
||||
{ value: "edit", description: "Edit file with default $EDITOR / $VISUAL [aliases: e]" },
|
||||
{ value: "help", description: "Print this message or the help of the given subcommand(s)" },
|
||||
{ value: "kill-all-sessions", description: "Kill all sessions [aliases: ka]" },
|
||||
{ value: "kill-session", description: "Kill the specific session [aliases: k]" },
|
||||
{ value: "list-sessions", description: "List active sessions [aliases: ls]" },
|
||||
{ value: "options", description: "Change behaviour of zellij" },
|
||||
{ value: "run", description: "Run a command in a new pane [aliases: r]" },
|
||||
{ value: "setup", description: "Setup zellij and check its configuration" },
|
||||
|
||||
# Aliases
|
||||
{ value: "ac", description: "Alias for `action`" },
|
||||
{ value: "a", description: "Alias for `attach`" },
|
||||
{ value: "e", description: "Alias for `edit`" },
|
||||
{ value: "ka", description: "Alias for `kill-all-sessions`" },
|
||||
{ value: "k", description: "Alias for `kill-session`" },
|
||||
{ value: "ls", description: "Alias for `list-sessions`" },
|
||||
{ value: "r", description: "Alias for `run`" },
|
||||
]
|
||||
}
|
||||
|
||||
def "nu-complete zellij action" [] {
|
||||
[
|
||||
{ value: "close-pane", description: "Close the focused pane" },
|
||||
{ value: "close-tab", description: "Close the current tab" },
|
||||
{ value: "dump-screen", description: "Dump the focused pane to a file" },
|
||||
{ value: "edit", description: "Open the specified file in a new zellij pane with your default EDITOR" },
|
||||
{ value: "edit-scrollback", description: "Open the pane scrollback in your default editor" },
|
||||
{ value: "focus-next-pane", description: "Change focus to the next pane" },
|
||||
{ value: "focus-previous-pane", description: "Change focus to the precvious pane" },
|
||||
{ value: "go-to-next-tab", description: "Go to the next tab" },
|
||||
{ value: "go-to-previous-tab", description: "Go to the previous tab" },
|
||||
{ value: "go-to-tab", description: "Go to tab with index [index]" },
|
||||
{ value: "half-page-scroll-down", description: "Scroll down half page in focus pane" },
|
||||
{ value: "half-page-scroll-up", description: "Scroll up half page in focus pane" },
|
||||
{ value: "help", description: "Print this message or the help of the given subcommand(s)" },
|
||||
{ value: "move-focus", description: "Move the focused pane in the specified direction. [right|left|up|down]" },
|
||||
{ value: "move-focus-or-tab", description: "Move focus to the pane or tab (if on screen edge) in the specified direction. [right|left|up|down]" },
|
||||
{ value: "move-pane", description: "Change the location of the focused pane in the specified direction. [right|left|up|down]" },
|
||||
{ value: "new-pane", description: "Open a new pane in the specified direction. [right|down] If no direction specified, will try to use the biggest available space" },
|
||||
{ value: "new-tab", description: "Create a new tab, optionally with a specified tab layout and name" },
|
||||
{ value: "page-scroll-down", description: "Scroll down one page in focus pane" },
|
||||
{ value: "page-scroll-up", description: "Scroll up one page in focus pane" },
|
||||
{ value: "rename-pane", description: "Renames the focused pane" },
|
||||
{ value: "rename-tab", description: "Renames the focused tab" },
|
||||
{ value: "resize", description: "Resize the focused pane in the specified direction. [right|left|up|down|+|-]" },
|
||||
{ value: "scroll-down", description: "Scroll down to the bottom in focus pane" },
|
||||
{ value: "scroll-up", description: "Scroll up in the focused pane" },
|
||||
{ value: "switch-mode", description: "Switch input mode of all connected clients [locked|pane|tab|resize|move|search|session]" },
|
||||
{ value: "toggle-active-sync-tab", description: "Toggle between sending text commands to all panes on the current tab and normal mode" },
|
||||
{ value: "toggle-floating-panes", description: "Toggle visibility of all floating panes in the current tab, open one if none exist" },
|
||||
{ value: "toggle-fullscreen", description: "Toggle between fullscreen focus pane and normal layout" },
|
||||
{ value: "toggle-pane-embed-or-floating", description: "Embed focused pane if floating or float focused pane if embedded" },
|
||||
{ value: "toggle-pane-frames", description: "Toggle frames around panes in the UI" },
|
||||
{ value: "undo-rename-pane", description: "Remove a previously set pane name" },
|
||||
{ value: "undo-rename-tab", description: "Remove a previously set tab name" },
|
||||
{ value: "write", description: "Write bytes to the terminal" },
|
||||
{ value: "write-chars", description: "Write characters to the terminal" },
|
||||
]
|
||||
}
|
||||
|
||||
def "nu-complete zellij attach" [] {
|
||||
[
|
||||
{ value: "help", description: "Print this message or the help of a given subcommand(s)" },
|
||||
{ value: "options", description: "Change the behaviour of zellij" },
|
||||
]
|
||||
}
|
||||
|
||||
def "nu-complete sessions" [] {
|
||||
^zellij ls -n | lines | parse "{value} {description}"
|
||||
}
|
||||
|
||||
# Turned off since it messes with sub-commands
|
||||
#export extern "zellij" [
|
||||
# command?: string@"nu-complete zellij"
|
||||
# --config(-c) # <CONFIG> Change where zellij looks for the configuration file [env: ZELLIJ_CONFIG_FILE=]
|
||||
# --config-dir # <CONFIG_DIR> Change where zellij looks for the configuration directory [env: ZELLIJ_CONFIG_DIR=]
|
||||
# --debug(-d) # Specify emitting additional debug information
|
||||
# --data-dir # <DATA_DIR> Change where zellij looks for plugins
|
||||
# --help(-h) # Print help message
|
||||
# --layout(-l) # <LAYOUT> Name of a predefined layout inside the layout directory or the path to a layout file
|
||||
# --max-panes # <MAX_PANES> Maximum panes on screen, caution: opening more panes will close old ones
|
||||
# --sessions(-s) # <SESSION> Specify name of a new session
|
||||
# --version(-v) # Print version information
|
||||
#]
|
||||
|
||||
# Send actions to a specific session
|
||||
export extern "zellij action" [
|
||||
command: string@"nu-complete zellij action"
|
||||
--help(-h) # Print help information
|
||||
]
|
||||
|
||||
# Renames the focused tab
|
||||
export extern "zellij action rename-tab" [
|
||||
name: 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
|
||||
command?: string@"nu-complete zellij attach"
|
||||
--create(-c) # Create a session if one does not exist
|
||||
--help(-h) # Print help information
|
||||
--index # <INDEX> Number of the session index in the active sessions ordered by creation date
|
||||
]
|
||||
|
||||
# <OLD_CONFIG_FILE>
|
||||
export extern "zellij convert-config" [
|
||||
file: path
|
||||
--help(-h) # Print help information
|
||||
]
|
||||
|
||||
# <OLD_LAYOUT_FILE>
|
||||
export extern "zellij convert-layout" [
|
||||
file: path
|
||||
--help(-h) # Print help information
|
||||
]
|
||||
|
||||
# <OLD_THEME_FILE>
|
||||
export extern "zellij convert-theme" [
|
||||
file: path
|
||||
--help(-h) # Print help information
|
||||
]
|
||||
|
||||
def "nu-complete directions" [] {
|
||||
[ "right" "left" "down" "up" ]
|
||||
}
|
||||
|
||||
# Edit file with default $EDITOR / $VISUAL
|
||||
export extern "zellij edit" [
|
||||
file: path
|
||||
--cwd: path # <CWD> Change the working directory of the editor
|
||||
--direction(-d): string@"nu-complete directions" # <DIRECTION> Direction to open the new pane in
|
||||
--floating(-f) # Open the new pane in floating mode
|
||||
--help(-h) # Print help information
|
||||
--line-number(-l): number # <LINE_NUMBER> Open the file in the specified line number
|
||||
]
|
||||
|
||||
# Print this message or the help of the given subcommand(s)
|
||||
export extern "zellij help" [
|
||||
command?: string@"nu-complete subcommands"
|
||||
]
|
||||
|
||||
# Kill all sessions
|
||||
export extern "zellij kill-all-sessions" [
|
||||
--help(-h) # Print help information
|
||||
--yes(-y) # Automatic yes to prompts
|
||||
]
|
||||
|
||||
# Kill the specific session
|
||||
export extern "zellij kill-session" [
|
||||
session_name: string@"nu-complete sessions" # <TARGET_SESSION> Name of target session
|
||||
--help(-h) # Print help information # Print help information
|
||||
]
|
||||
|
||||
# List active sessions
|
||||
export extern "zellij list-sessions" [
|
||||
--help(-h) # Print help information
|
||||
]
|
||||
|
||||
def "nu-complete string bools" [] {
|
||||
[ "'true'" "'false'" ]
|
||||
}
|
||||
|
||||
def "nu-complete option copy-clipboard" [] {
|
||||
[ "system", "primary" ]
|
||||
}
|
||||
|
||||
def "nu-complete option on-force-close" [] {
|
||||
[ "quit" "detach" ]
|
||||
}
|
||||
|
||||
# Change the behaviour of zellij
|
||||
export extern "zellij options" [
|
||||
--attach-to-session: string@"nu-complete string bools" # Whether to attach to a session specified in "session-name" if it exists [possible values: true, false]
|
||||
--copy-clipboard: string@"nu-complete option copy-clipboard" # OSC52 destination clipboard [possible values: system, primary]
|
||||
--copy-command: string # <COPY_COMMAND> Switch to using a user supplied command for clipboard instead of OSC52
|
||||
--copy-on-select: string@"nu-complete string bools" # Automatically copy when selecting text (tru or false) [possible values: true, false]
|
||||
--default-layout # <DEFAULT_LAYOUT> Set the default layout
|
||||
--default-mode # <DEFAULT_MODE> Set the default mode
|
||||
--default-shell # <DEFAULT_SHELL> Set the default shell
|
||||
--disable-mouse-mode # Disable handling of mouse events
|
||||
--help(-h) # Print help information
|
||||
--layout-dir: path # <LAYOUT_DIR> Set the layout_dir, defaults to subdirectory of config dir
|
||||
--mirror-session: string@"nu-complete string bools" # Mirror session when multiple users are connected (true or false) [possible values: true, false]
|
||||
--mouse-mode: string@"nu-complete string bools" # <MOUSE_MODE> Set the handling of mouse events (true or false) Can be temporarily bypassed by the [SHIFT] key [possible values: true, false]
|
||||
--on-force-close: string@"nu-complete option on-force-close" # <ON_FORCE_CLOSE> Set behaviour on force close (quit or detach)
|
||||
--pane-frames: string@"nu-complete string bools" # <PANE_FRAMES> Set display of pane frames (true or false) [possible values: true, false]
|
||||
--scroll-buffer-size: any # <SCROLL_BUFFER_SIZE>
|
||||
--scrollback-editor: path # <SCROLLBACK_EDITOR> Explicit full path to open the scrollback editor (default is $EDITOR or $VISUAL)
|
||||
--session-name: string # <SESSION_NAME> The name of the session to create when starting Zellij
|
||||
--simplified-ui: string@"nu-complete string bools" # <SIMPLIFIED_UI> Allow plugins to use a more simplified layout that is compatible with more fonts (true or false) [possible values: true, false]
|
||||
--theme: string # <THEME> Set the default theme
|
||||
--theme-dir: path # <THEME_DIR> Set the theme_dir, defaults to subdirectory of config dir
|
||||
]
|
||||
|
||||
# Run a command in a new pane
|
||||
export extern "zellij run" [
|
||||
command: string # Command to run
|
||||
--close-on-exit(-c) # Close the pane immediately when its command exits
|
||||
--cwd: path # <CWD> Change the working directory of th new pane
|
||||
--direction(-d): string@"nu-complete directions" # <DIRECTION> Direction to open new pane in
|
||||
--floating(-f) # Open the new pane in floating mode
|
||||
--help(-h) # Print help information
|
||||
--name(-n): string # <NAME> Name of the new pane
|
||||
--start-suspended(-s) # Start the command suspended, only running after you first presses ENTER
|
||||
]
|
||||
|
||||
export extern "zellij setup" [
|
||||
--check # Checks the configuration of zellij and displays currently used directories
|
||||
--clean # Disables loading of configuration file at default location, loads the defaults that zellij ships with
|
||||
--dump-config # Dump the default configuration file to stdout
|
||||
--dump-layout: string # <DUMP_LAYOUT> Dump the specified layout file to stdout
|
||||
--generate-auto-start: string # Generates auto-start for the specified shell
|
||||
--generate-completion: string # Generates completion for the specified shell
|
||||
--help(-h) # Print help information
|
||||
]
|
Loading…
Reference in New Issue