Last active
March 15, 2023 03:05
-
-
Save wilfreddenton/aa6760eaa7e7cf2d3375db2492698ac9 to your computer and use it in GitHub Desktop.
bash configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# deps: fzf | |
# utf-8 | |
export LANG="en_US.UTF-8" | |
export LC_COLLATE="en_US.UTF-8" | |
export LC_CTYPE="en_US.UTF-8" | |
export LC_MESSAGES="en_US.UTF-8" | |
export LC_MONETARY="en_US.UTF-8" | |
export LC_NUMERIC="en_US.UTF-8" | |
export LC_TIME="en_US.UTF-8" | |
export LC_ALL="en_US.UTF-8" | |
# set a fancy prompt (non-color, unless we know we "want" color) | |
case "$TERM" in | |
xterm-color|*-256color) color_prompt=yes;; | |
esac | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;34m\][\W]\[\033[01;36m\]$(parse_git_branch) \[\033[01;32m\]\u\[\033[00m\]$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}[\W]\$(parse_git_branch) \u$ ' | |
fi | |
unset color_prompt force_color_prompt | |
# fix cargo's git usage | |
export CARGO_NET_GIT_FETCH_WITH_CLI=true | |
bind -x '"\C-f":fzf --bind "enter:become(nvim {})"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment