1
0
Fork 0

Bash prompt and alias updates

This commit is contained in:
Gregory Eremin 2021-04-24 00:26:43 +02:00 committed by Gregory Eremin
parent 508b6c5fb7
commit a7ce5182d1
2 changed files with 7 additions and 2 deletions

View File

@ -25,3 +25,7 @@ alias br="bundle exec rails"
# Go # Go
alias goi="go install ./..." alias goi="go install ./..."
alias gg='rg -g "*.go"' alias gg='rg -g "*.go"'
alias ytdl="youtube-dl -f 'bestvideo+bestaudio'"
alias cr="cargo run --quiet --"

View File

@ -5,12 +5,13 @@ function __bash_prompt {
__window_title $baseDir __window_title $baseDir
# Define building blocks # Define building blocks
local basedir="$_BOLD$_BLUE\W$_RESET_COLOR$_RESET" local userhost="$_BOLD$_BLUE\u@\h$_RESET_COLOR$_RESET"
local basedir="$_BOLD$_GREEN\W$_RESET_COLOR$_RESET"
local git_y_u_no_commit="$_MAGENTA$(__bash_git_y_u_no_commit_warn)$_RESET_COLOR" local git_y_u_no_commit="$_MAGENTA$(__bash_git_y_u_no_commit_warn)$_RESET_COLOR"
local git_branch="$(__bash_prompt_git)" local git_branch="$(__bash_prompt_git)"
local cursor="\[${_DIM}\]\[$_RESET\]" local cursor="\[${_DIM}\]\[$_RESET\]"
PS1="\n$basedir$git_branch$git_y_u_no_commit\n$cursor\[$_RESET\] " PS1="\n$userhost $basedir$git_branch$git_y_u_no_commit\n$cursor\[$_RESET\] "
} }
PROMPT_COMMAND=__bash_prompt # <--- ta-da! PROMPT_COMMAND=__bash_prompt # <--- ta-da!