1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-31 12:07:48 +00:00

Use zoxide

This commit is contained in:
RGBCube 2024-02-17 22:15:23 +03:00
parent a5212e24ae
commit 68e747bfda
No known key found for this signature in database
3 changed files with 8 additions and 4 deletions

View file

@ -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
'' ''

View file

@ -44,5 +44,6 @@
}) })
(systemPackages (with pkgs; [ (systemPackages (with pkgs; [
fish # For completions. fish # For completions.
zoxide # For completions and better cd.
])) ]))

View file

@ -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
'' ''