Basic completion for pass

This commit is contained in:
Thomas Forgione 2023-11-09 12:15:45 +01:00
parent f753f6cc45
commit 677caa4bba
1 changed files with 25 additions and 2 deletions

View File

@ -201,6 +201,31 @@ def _gclone_dirs [] {
def-env cdg [key: string@_gclone_dirs] { cd (CLICOLOR_FORCE=1 pgd $key) }
# pass aliases / completion
def _pass_completion [] {
_ls ~/.password-store/**/* | each { |x|
if $x.type == "file" {
$x.name
| path parse
| update extension ""
| get parent stem
| str join "/"
} else {
$x.name
}
| split row '/'
| skip 4
| str join "/"
}
| prepend git
| prepend insert
}
export extern "pass" [ host?: string@_pass_completion ]
alias p = pass
alias pc = pass --clip
# docker aliases
alias ld = lazydocker
alias dc = docker-compose
@ -248,8 +273,6 @@ alias kns = k9s
alias :q = exit
alias pdf = evince
alias rg = rg -uu
alias p = pass
alias pc = pass --clip
def-env mkcd [dir: string] { mkdir $dir; cd $dir }
# Start tfetch