From d18fe5d69d5c1dec9d980b06e4a4b312c212c034 Mon Sep 17 00:00:00 2001 From: benj Date: Tue, 28 Sep 2021 17:09:24 -0700 Subject: include idf env setup and PS1 flag --- .bashrc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to '.bashrc') diff --git a/.bashrc b/.bashrc index e4702ae..5481eb6 100644 --- a/.bashrc +++ b/.bashrc @@ -19,6 +19,12 @@ function show_opam_switch () { fi } +function idf_venv() { + if [ ! -z "$IDF_PATH" ]; then + echo "(idf-venv) " + fi +} + # mkdir and follow into dir function mkdirf () { mkdir -p $1 && cd $1 @@ -34,9 +40,9 @@ if [ -n "$SSH_CLIENT" ]; then ssh_text="ssh" fi if [ -z $STY ]; then - export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " + export PS1="\[\033[1;36m\]\$(idf_venv)\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " else - export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " + export PS1="\[\033[1;36m\]\$(idf_venv)\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " fi # Alias @@ -53,6 +59,7 @@ alias grep='grep --color' alias g='googler' alias pt='prototool' alias t='tmux' +alias idf='. /usr/local/esp-idf/export.sh' export ALTERNATE_EDITOR="" export EDITOR="vim" -- cgit v1.2.3