Skip to content

Commit

Permalink
adapt starship config a little
Browse files Browse the repository at this point in the history
  • Loading branch information
k-at-goto committed Sep 16, 2024
1 parent a87773e commit b4921f1
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 38 deletions.
20 changes: 18 additions & 2 deletions .bash_aliases
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
if command -v kubectl &>/dev/null; then
alias k=kubectl
alias kctx='kubectl config use-context'
alias kns='kubectl config set-context --current --namespace'
if [ -n "$(type -t __start_kubectl)" ]; then
complete -F __start_kubectl k
fi

klsctx() {
if [ -n "$1" ]; then
kubectl config get-contexts | grep "$1"
else
kubectl config get-contexts
fi
}
alias kctx='kubectl config use-context'

klsns() {
if [ -n "$1" ]; then
kubectl get ns | grep "$1"
else
kubectl get ns
fi
}
alias kns='kubectl config set-context --current --namespace'
fi

if command -v git &>/dev/null; then
Expand Down
4 changes: 2 additions & 2 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ if [ -n "$BREW_PREFIX" ]; then
eval "$(${BREW_PREFIX}/bin/brew shellenv)"
# brew completions
if [[ -r "${BREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${BREW_PREFIX}/etc/profile.d/bash_completion.sh" 2>/dev/null
source "${BREW_PREFIX}/etc/profile.d/bash_completion.sh"
fi
for COMPLETION in "${BREW_PREFIX}/etc/bash_completion.d/"*; do
if [[ -r "${COMPLETION}" ]]; then
source "${COMPLETION}" 2>/dev/null
source "${COMPLETION}"
fi
done

Expand Down
129 changes: 95 additions & 34 deletions .config/starship.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
command_timeout = 5000
scan_timeout = 300

# starship preset plain-text-symbols -o ~/.config/starship.toml
[character]
success_symbol = "[>](bold green)"
error_symbol = "[x](bold red)"
vimcmd_symbol = "[<](bold green)"

[git_commit]
tag_symbol = " tag "

[git_status]
ahead = ">"
behind = "<"
diverged = "<>"
renamed = "r"
deleted = "x"

# starship preset plain-text-symbols
[aws]
symbol = "aws "

[azure]
symbol = "az "

[buf]
symbol = "buf "

[bun]
symbol = "bun "

[c]
symbol = "C "

[character]
error_symbol = "[x](bold red)"
success_symbol = "[>](bold green)"

[cmake]
symbol = "cmake "

[cobol]
symbol = "cobol "

Expand All @@ -38,9 +35,6 @@ symbol = "conda "
[crystal]
symbol = "cr "

[cmake]
symbol = "cmake "

[daml]
symbol = "daml "

Expand All @@ -50,21 +44,26 @@ symbol = "dart "
[deno]
symbol = "deno "

[dotnet]
symbol = ".NET "

[directory]
fish_style_pwd_dir_length = 1
format = "in [$path]($style)[$read_only]($read_only_style) "
read_only = " ro"

[docker_context]
symbol = "docker "

[dotnet]
symbol = ".NET "

[elixir]
symbol = "exs "

[elm]
symbol = "elm "

[erlang]
symbol = "erl "

[fennel]
symbol = "fnl "

Expand All @@ -75,23 +74,47 @@ symbol = "fossil "
symbol = "gcp "

[git_branch]
symbol = "git "
format = "at [$symbol$branch(:$remote_branch)]($style) "
symbol = ""

[git_commit]
tag_disabled = false
tag_symbol = " tag "

[git_status]
ahead = ">"
behind = "<"
deleted = "x"
diverged = "<>"
renamed = "r"

[gleam]
symbol = "gleam "

[golang]
symbol = "go "

[guix_shell]
symbol = "guix "

[gradle]
symbol = "gradle "

[guix_shell]
symbol = "guix "
[haskell]
symbol = "hs "

[haxe]
symbol = "hx "

[helm]
symbol = "helm "

[hg_branch]
symbol = "hg "

[hostname]
ssh_symbol = "ssh "

[java]
symbol = "java "

Expand All @@ -101,12 +124,24 @@ symbol = "jl "
[kotlin]
symbol = "kt "

[kubernetes]
disabled = false
format = "on [$symbol$context \\[$namespace\\]]($style) "
symbol = ""

[[kubernetes.contexts]]
context_pattern = "oci-oke:\\w*:(?P<cluster>[\\w]+):[\\w+\\d+-]+"
context_alias = "$cluster"
style = "red bold"

[[kubernetes.contexts]]
context_pattern = "aws-eks:[\\w-]+:(?P<cluster>[\\w]+):[\\w+\\d+-]+"
context_alias = "$cluster"
style = "yellow bold"

[lua]
symbol = "lua "

[nodejs]
symbol = "nodejs "

[memory_usage]
symbol = "memory "

Expand All @@ -122,16 +157,25 @@ symbol = "nim "
[nix_shell]
symbol = "nix "

[nodejs]
symbol = "js "

[ocaml]
symbol = "ml "

[odin]
symbol = "odin "

[opa]
symbol = "opa "

[openstack]
symbol = "os "

[os.symbols]
AIX = "aix "
Alpaquita = "alq "
AlmaLinux = "alma "
Alpaquita = "alq "
Alpine = "alp "
Amazon = "amz "
Android = "andr "
Expand Down Expand Up @@ -165,12 +209,12 @@ openSUSE = "osuse "
OracleLinux = "orac "
Pop = "pop "
Raspbian = "rasp "
Redhat = "rhl "
RedHatEnterprise = "rhel "
RockyLinux = "rky "
Redhat = "rhl "
Redox = "redox "
Solus = "sol "
RockyLinux = "rky "
SUSE = "suse "
Solus = "sol "
Ubuntu = "ubnt "
Ultramarine = "ultm "
Unknown = "unk "
Expand Down Expand Up @@ -204,6 +248,12 @@ symbol = "quarto "
[raku]
symbol = "raku "

[red]
symbol = "red "

[rlang]
symbol = "r "

[ruby]
symbol = "rb "

Expand All @@ -213,6 +263,10 @@ symbol = "rs "
[scala]
symbol = "scala "

[shlvl]
repeat = true
symbol = '>'

[spack]
symbol = "spack "

Expand All @@ -228,11 +282,18 @@ symbol = "sudo "
[swift]
symbol = "swift "

[terraform]
symbol = "terraform "

[typst]
symbol = "typst "

[terraform]
symbol = "terraform "
[username]
format = "[$user]($style) "
show_always = true

[vagrant]
symbol = "vagrant "

[zig]
symbol = "zig "

0 comments on commit b4921f1

Please sign in to comment.