Skip to content

Commit 472124d

Browse files
committed
feat: add vault & t mapping
1 parent 06a2da3 commit 472124d

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

config/private_dot_config/mise/config.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ go = "1.23.4"
1313
node = "22.12.0"
1414
python = "3.13.1"
1515
ruby = "3.3.6"
16+
vault = "latest"

config/private_dot_config/private_fish/conf.d/functions.fish

+18
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,21 @@ function vault_auth
4040
set -gx VAULT_ADDR https://$env.vault.tuadm.net:8200
4141
set -gx TF_VAR_vault_token_$env (vault login -method=oidc -path=okta role=admin -format=json 2>/dev/null | jq '.auth.client_token' -r)
4242
end
43+
44+
# `cd` and then `ls` if the destination is a dir
45+
# - including backwards with -
46+
# - including to home with no arguments
47+
#
48+
# `$EDITOR <dest>` if the destination(s) is/are a file
49+
function t
50+
if test (count $argv) -eq 1 -a \( -d "$argv[1]" -o "$argv[1]" = - \)
51+
cd "$argv[1]" || return
52+
ls
53+
else if test (count $argv) -eq 0
54+
cd "$HOME" || return
55+
else if test -f "$argv[1]"; or test ! -e "$argv[1]"; or test (count $argv) -gt 1
56+
$EDITOR $argv
57+
else
58+
echo "t: case not accounted for"
59+
end
60+
end

0 commit comments

Comments
 (0)