From b5ca587067aec2684171c7950392b000fc879341 Mon Sep 17 00:00:00 2001 From: Cameron Reed Date: Tue, 6 Aug 2024 08:13:18 -0600 Subject: [PATCH] Only show host when using ssh --- .aliases | 7 ++++++- .zprofile | 1 - .zshenv | 12 ++++++++++++ .zshrc | 16 +++++++++++++++- 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/.aliases b/.aliases index 64d82bd..0f286e6 100644 --- a/.aliases +++ b/.aliases @@ -32,11 +32,16 @@ alias nvc='nvim -c "edit \$MYVIMRC"' alias c='clear' alias e='echo' alias pf='printf' -alias nf='neofetch' +alias ff='fastfetch' +alias :w='printf "Saved\n"' alias :q='exit' alias :wq='exit' +if command -v zigup &> /dev/null; then + alias zigup='zigup --install-dir "$HOME/.local/share/zigup" --path-link "$HOME/.local/bin/zig-local"' +fi + bindkey -s '^o' 'lfcd\n' bindkey -s '^n' 'nvd\n' diff --git a/.zprofile b/.zprofile index 8678a26..379f1e8 100644 --- a/.zprofile +++ b/.zprofile @@ -4,7 +4,6 @@ [[ -f ~/.profile ]] && . ~/.profile -[[ -f $ZDOTDIR/.zshrc ]] && . $ZDOTDIR/.zshrc if [ "$XDG_SESSION_TYPE" = "wayland" ]; then diff --git a/.zshenv b/.zshenv index d61f94d..e842632 100644 --- a/.zshenv +++ b/.zshenv @@ -9,6 +9,10 @@ if [ -d /opt/devkitpro ]; then export DEVKITPPC=$DEVKITPRO/devkitPPC fi +if [ -d $HOME/.local/share/esp ]; then + export IDF_TOOLS_PATH=$HOME/.local/share/esp/idf +fi + # Copied from arch linux's default /etc/profile @@ -25,6 +29,14 @@ function append_path() { append_path "/home/cameron/.local/share/JetBrains/Toolbox/scripts" +if [ -d "$HOME/.local/bin" ]; then + append_path "$HOME/.local/bin" +fi + +if [ -d "$HOME/go/bin" ]; then + append_path "$HOME/go/bin" +fi + export PATH unset -f append_path diff --git a/.zshrc b/.zshrc index e1077f4..0019a04 100644 --- a/.zshrc +++ b/.zshrc @@ -96,8 +96,15 @@ function set_prompt() { for i in $(seq 1 "${#prefixes[@]}"); do prefix+="%F{${colors[$i]:-255}}${prefixes[$i]}%F{255} " done + + local user="${USER_OVERRIDE:-%n}" + local host="@${HOST_OVERRIDE:-%m}" + + if [ -z "${SSH_CONNECTION}" ]; then + host="" + fi - PROMPT="[${prefix}%n@%m %1~]%(#.#.$) " + PROMPT="[${prefix}${user}${host} %1~]%(#.#.$) " } typeset -a precmd_functions @@ -134,6 +141,11 @@ function rmbookmark() { fi } +function get_idf() { + . $HOME/.local/share/esp/esp-idf/export.sh + alias idf="idf.py" +} + # Initialize direnv if it exists @@ -141,6 +153,8 @@ if command -v direnv &> /dev/null; then eval "$(direnv hook zsh)" fi +fastfetch + # Unset extra variables unset CACHE_DIR