66 lines
2 KiB
Text
66 lines
2 KiB
Text
|
|
$env.config.completions.external.completer = $fish_completer
|
|
$env.LS_COLORS = (vivid generate one-dark)
|
|
# $env.TRANSIENT_PROMPT_COMMAND = ^starship module character
|
|
# $env.TRANSIENT_PROMPT_INDICATOR = ""
|
|
# $env.TRANSIENT_PROMPT_INDICATOR_VI_INSERT = ""
|
|
# $env.TRANSIENT_PROMPT_INDICATOR_VI_NORMAL = ""
|
|
# $env.TRANSIENT_PROMPT_MULTILINE_INDICATOR = ""
|
|
# $env.TRANSIENT_PROMPT_COMMAND_RIGHT = ^starship module time
|
|
|
|
def --env nufzf [] {$in | each {|i| $i | to json --raw} | str join "\n" | fzf | from json}
|
|
|
|
def --env doomup [...args] {
|
|
doom sync ...$args
|
|
doom gc
|
|
systemctl --user restart emacs.service
|
|
}
|
|
|
|
def --env lla [...args] {
|
|
ls -alm ...$args | select name type size modified mode user
|
|
}
|
|
|
|
# def --env pullall [] {
|
|
|
|
# }
|
|
|
|
def pdf-compress [...args] {
|
|
gs -sDEVICE=pdfwrite -dPDFSETTINGS=/printer -dNOPAUSE -dBATCH -sOutputFile=output.pdf $args
|
|
}
|
|
|
|
def nh-switch-gc [...args] {
|
|
nh os switch; nh clean all --keep 3 --nogcroots; nix store optimise;
|
|
}
|
|
|
|
def "nu-complete zoxide path" [context: string] {
|
|
let parts = $context | str trim --left | split row " " | skip 1 | each { str downcase }
|
|
let completions = (
|
|
^zoxide query --list --exclude $env.PWD -- ...$parts
|
|
| lines
|
|
| each { |dir|
|
|
if ($parts | length) <= 1 {
|
|
$dir
|
|
} else {
|
|
let dir_lower = $dir | str downcase
|
|
let rem_start = $parts | drop 1 | reduce --fold 0 { |part, rem_start|
|
|
($dir_lower | str index-of --range $rem_start.. $part) + ($part | str length)
|
|
}
|
|
{
|
|
value: ($dir | str substring $rem_start..),
|
|
description: $dir
|
|
}
|
|
}
|
|
})
|
|
{
|
|
options: {
|
|
sort: false,
|
|
completion_algorithm: substring,
|
|
case_sensitive: false,
|
|
},
|
|
completions: $completions,
|
|
}
|
|
}
|
|
|
|
def --env --wrapped z [...rest: string@"nu-complete zoxide path"] {
|
|
__zoxide_z ...$rest
|
|
}
|