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 zoxide custom completions #1063

Merged
merged 1 commit into from
Mar 5, 2025
Merged
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
2 changes: 1 addition & 1 deletion custom-completions/bat/bat-completions.nu
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A cat(1) clone with syntax highlighting and Git integration
export extern "bat" [
...file: path # file to print / concatenate
...file: path # file(s) to print / concatenate
--help # Print help (see a summary with '-h')
-h # Print help (see more with '--help')
--version # Print version
Expand Down
13 changes: 13 additions & 0 deletions custom-completions/zoxide/RAEDME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# pytest completions

Completions for [zoxide](https://github.com/ajeetdsouza/zoxide). ``zoxide`` is a smarter cd command, inspired by z and autojump. It remembers which directories you use most frequently, so you can "jump" to them in just a few keystrokes. zoxide works on all major shells.

## Usage

```nushell
use zoxide-completions.nu *
```
or
```nushell
source zoxide-completions.nu
```
53 changes: 53 additions & 0 deletions custom-completions/zoxide/zoxide-completions.nu
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
def "nu-complete zoxide import" [] {
["autojump", "z"]
}

def "nu-complete zoxide shells" [] {
["bash", "elvish", "fish", "nushell", "posix", "powershell", "xonsh", "zsh"]
}

def "nu-complete zoxide hooks" [] {
["none", "prompt", "pwd"]
}

# Add a new directory or increment its rank
export extern "zoxide add" [
...paths: path
]

# Edit the database
export extern "zoxide edit" [ ]

# Import entries from another application
export extern "zoxide import" [
--from: string@"nu-complete zoxide import" # Application to import from
--merge # Merge into existing database
]

# Generate shell configuration
export extern "zoxide init" [
shell: string@"nu-complete zoxide shells"
--no-cmd # Prevents zoxide from defining the `z` and `zi` commands
--cmd: string # Changes the prefix of the `z` and `zi` commands [default: z]
--hook: string@"nu-complete zoxide hooks" # Changes how often zoxide increments a directory's score [default: pwd]
]

# Search for a directory in the database
export extern "zoxide query" [
...keywords: string
--all(-a) # Show unavailable directories
--interactive(-i) # Use interactive selection
--list(-l) # List all matching directories
--score(-s) # Print score with results
--exclude: path # Exclude the current directory
]

# Remove a directory from the database
export extern "zoxide remove" [
...paths: path
]

export extern zoxide [
--help(-h) # Print help
--version(-V) # Print version
]