mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-30 21:57:44 +00:00
add zoxide custom completions (#1063)
Hello, here are custom completions for zioxide, a tool which I really like
This commit is contained in:
parent
698e240647
commit
c517cd0075
3 changed files with 67 additions and 1 deletions
|
@ -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
|
||||
|
|
13
custom-completions/zoxide/RAEDME.md
Normal file
13
custom-completions/zoxide/RAEDME.md
Normal file
|
@ -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
custom-completions/zoxide/zoxide-completions.nu
Normal file
53
custom-completions/zoxide/zoxide-completions.nu
Normal file
|
@ -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
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue