mirror of
https://github.com/RGBCube/ncc
synced 2025-07-31 12:07:48 +00:00
Use zoxide
This commit is contained in:
parent
a5212e24ae
commit
68e747bfda
3 changed files with 8 additions and 4 deletions
|
@ -137,9 +137,9 @@ $env.config.completions = {
|
||||||
enable: true
|
enable: true
|
||||||
max_results: 100
|
max_results: 100
|
||||||
completer: {|tokens: list<string>|
|
completer: {|tokens: list<string>|
|
||||||
mut expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
let expanded = scope aliases | where name == $tokens.0 | get --ignore-errors expansion.0
|
||||||
|
|
||||||
mut expanded = if $expanded != null {
|
let expanded = if $expanded != null and $expanded.0 != "cd" {
|
||||||
$expanded | split row " " | append ($tokens | skip 1)
|
$expanded | split row " " | append ($tokens | skip 1)
|
||||||
} else {
|
} else {
|
||||||
$tokens
|
$tokens
|
||||||
|
@ -147,7 +147,7 @@ $env.config.completions = {
|
||||||
|
|
||||||
$expanded.0 = ($expanded.0 | str trim --left --char "^")
|
$expanded.0 = ($expanded.0 | str trim --left --char "^")
|
||||||
|
|
||||||
fish --command $'complete (char sq)--do-complete=($expanded | str join " ")(char sq)'
|
fish --command $"complete '--do-complete=($expanded | str join ' ')'"
|
||||||
| $"value(char tab)description(char newline)" + $in
|
| $"value(char tab)description(char newline)" + $in
|
||||||
| from tsv --flexible --no-infer
|
| from tsv --flexible --no-infer
|
||||||
}
|
}
|
||||||
|
@ -410,4 +410,6 @@ $env.config.keybindings = [
|
||||||
event: { send: enter }
|
event: { send: enter }
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
source ~/.config/nushell/zoxide.nu
|
||||||
''
|
''
|
||||||
|
|
|
@ -44,5 +44,6 @@
|
||||||
})
|
})
|
||||||
|
|
||||||
(systemPackages (with pkgs; [
|
(systemPackages (with pkgs; [
|
||||||
fish # For completions.
|
fish # For completions.
|
||||||
|
zoxide # For completions and better cd.
|
||||||
]))
|
]))
|
||||||
|
|
|
@ -15,4 +15,5 @@ def --env mc [path: path] {
|
||||||
}
|
}
|
||||||
|
|
||||||
use ${upkgs.nuScripts}/modules/background_task/task.nu
|
use ${upkgs.nuScripts}/modules/background_task/task.nu
|
||||||
|
zoxide init nushell --cmd cd | save --force ~/.config/nushell/zoxide.nu
|
||||||
''
|
''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue