From b9801c8daa77f108c8854545b5ada8f04cb6cc58 Mon Sep 17 00:00:00 2001 From: Jason Swank <632526+jswank@users.noreply.github.com> Date: Sun, 22 Mar 2026 14:52:53 -0400 Subject: [PATCH] refactor .zshrc --- zsh/.aliasrc | 3 +++ zsh/.zshrc | 42 +++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 21 deletions(-) create mode 100644 zsh/.aliasrc diff --git a/zsh/.aliasrc b/zsh/.aliasrc new file mode 100644 index 0000000..4be12fd --- /dev/null +++ b/zsh/.aliasrc @@ -0,0 +1,3 @@ +alias ls='ls --color=auto' +alias grep='grep --color' +alias pichat='pi --provider google --model gemini-3.1-flash-lite-preview --prompt-template ~/.pi/agent/prompts/cloudops.md' diff --git a/zsh/.zshrc b/zsh/.zshrc index 85308f0..a910226 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -1,8 +1,12 @@ -alias ls='ls --color=auto' -alias grep='grep --color' + +# aliases are stored in ~/.aliasrc +if [ -f ~/.aliasrc ]; then + source ~/.aliasrc +fi fpath+=~/.local/share/zsh/functions +typeset -U path path+=(~/bin) path+=(~/.local/bin) path+=($GOPATH/bin) @@ -56,9 +60,10 @@ function set_prompt() { aws_prompt="" fi if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then - PROMPT=$aws_prompt"%B${vcs_info_msg_0_}▶ %b" + PROMPT=$aws_prompt"%B${vcs_info_msg_0_} ▶ %b" else - PROMPT=$aws_prompt"%B%m:%~▶ %b" + # PROMPT=$aws_prompt"%B%m:%~ ▶ %b" + PROMPT=$aws_prompt"%B%m:%2~ ▶ %b" fi } precmd_functions+=( set_prompt ) @@ -96,11 +101,11 @@ fi # command line completion autoload -U +X bashcompinit && bashcompinit -autoload -Uz compinit && compinit +autoload -Uz compinit && compinit -C # gcloud -if [ -f '/home/cli/google-cloud-sdk/path.zsh.inc' ]; then . '/home/cli/google-cloud-sdk/path.zsh.inc'; fi -if [ -f '/home/cli/google-cloud-sdk/completion.zsh.inc' ]; then . '/home/cli/google-cloud-sdk/completion.zsh.inc'; fi +if [ -f "$HOME/google-cloud-sdk/path.zsh.inc" ]; then . "$HOME/google-cloud-sdk/path.zsh.inc"; fi +if [ -f "$HOME/google-cloud-sdk/completion.zsh.inc" ]; then . "$HOME/google-cloud-sdk/completion.zsh.inc"; fi # kubectl [[ $commands[kubectl] ]] && source <(kubectl completion zsh) @@ -118,20 +123,15 @@ fi zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" # command line completion for ssh -h=() -if [[ -r ~/.ssh/config ]]; then +#h=() +#if [[ -r ~/.ssh/config ]]; then h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*}) -fi -if [[ -r ~/.ssh/known_hosts ]]; then - h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null -fi -if [[ $#h -gt 0 ]]; then - zstyle ':completion:*:(ssh|scp|slogin|sftp):*' hosts $h -fi +#fi +#if [[ -r ~/.ssh/known_hosts ]]; then +# h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null +#fi +#if [[ $#h -gt 0 ]]; then +# zstyle ':completion:*:(ssh|scp|slogin|sftp):*' hosts $h +#fi zstyle :compinstall filename '~/.zshrc' - -#zstyle ':completion:*' completer _complete _ignored -#zstyle :compinstall filename '~/.zshrc' - -#compinit