Skip to content

Instantly share code, notes, and snippets.

@felipepodesta
Forked from rigwild/.bashrc
Created November 16, 2021 03:28
Show Gist options
  • Save felipepodesta/6726a85e4da43c66400abecb7c125bac to your computer and use it in GitHub Desktop.
Save felipepodesta/6726a85e4da43c66400abecb7c125bac to your computer and use it in GitHub Desktop.
my wsl bashrc with git branch status coloring and windows `/mnt/c` hiding
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
fi
# Alias definitions.
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# Enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
bind 'set bell-style none'
# -----
#if [ -z "$SSH_AUTH_SOCK" ] ; then
# eval `ssh-agent -s`
# ssh-add
#fi
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Allow duplicate tab - https://github.com/microsoft/terminal/issues/3158
export PROMPT_COMMAND='printf "\e]9;9;%s\e\\" "$(wslpath -m "$PWD")"'
# See https://github.com/rigwild/bashgit
if [ -f ~/.bashgit ]; then
. ~/.bashgit
fi
export DENO_INSTALL="/home/rigwild/.deno"
_prompt_hide_wsl_dir() {
# pwd but hiding `/mnt/c` from wsl windows path
printf '%s' "$(echo "$(pwd)" | sed -r 's/^\/home\/rigwild\/dev/\/dev/g')"
}
# export DISPLAY=:0
export WINDOWS_IP=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}')
export DISPLAY="$WINDOWS_IP:0"
export PS1='\[\e[1;32m\]$(_prompt_hide_wsl_dir)\[\e[m\] $ '
export GPG_TTY=$(tty)
export PATH=$PATH:/home/rigwild/.local/bin
export PATH=$PATH:/home/rigwild/.yarn/bin
export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/usr/bin/intellij-idea/bin
export PATH="$DENO_INSTALL/bin:$PATH"
source "$HOME/.cargo/env"
[ -f "/home/rigwild/.ghcup/env" ] && source "/home/rigwild/.ghcup/env" # ghcup-env
export _dev='/home/rigwild/dev'
export _dev_windows='/mnt/c/dev'
export _desktop='/mnt/c/Users/rigwild/Desktop'
alias python='/usr/bin/python3'
alias ll='LANG=C ls -al --color=auto $*'
alias gs='git status'
alias gl='git log'
alias subl='/mnt/c/Program\ Files/Sublime\ Text\ 3/subl.exe'
alias explorer='explorer.exe'
#alias docker-compose='docker-compose.exe'
alias docker_clean_images='docker rmi $(docker images -a --filter=dangling=true -q)'
alias docker_clean_ps='docker rm $(docker ps --filter=status=exited --filter=status=created -q)'
alias docker_clean_full='docker system prune -a'
alias serve='serve -n'
alias tor_get_ip='curl --socks5 127.0.0.1:9050 http://checkip.amazonaws.com/'
alias tor_change_ip="printf 'AUTHENTICATE \"password\"\r\nSIGNAL NEWNYM\r\n' | nc 127.0.0.1 9051"
. "$HOME/.cargo/env"
[core]
autocrlf = false
eol = lf
[credential]
helper = store
[user]
email = [email protected]
name = rigwild
[bashgit]
disabled = false
[pager]
diff = delta
log = delta
reflog = delta
show = delta
[delta]
plus-style = "syntax #012800"
minus-style = "syntax #340001"
syntax-theme = Monokai Extended
navigate = true
[interactive]
diffFilter = delta --color-only
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment