-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
49 lines (39 loc) · 1.95 KB
/
.bashrc
File metadata and controls
49 lines (39 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# .bashrc - Run once for every user shell!
stty -ixon # Disable ctrl-s and ctrl-q.
HISTSIZE= HISTFILESIZE= # Infinite history.
HISTCONTROL=ignoreboth:erasedups # No duplicates! (https://unix.stackexchange.com/a/265649)
shopt -s histappend # When the shell exits, append to the history file instead of overwriting it. (https://unix.stackexchange.com/a/1292)
PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND" # Append last command to history right before executing it! And then reload history. (https://unix.stackexchange.com/a/48113)
mkdir -p $HOME/.history && touch $HOME/.history/history
export HISTFILE=$HOME/.history/history #Out of sight, out of mind. >.<
# Autocompletion in interactive shells for posix compliant commands (https://askubuntu.com/a/209894)
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
# Coloring
PS1="\[\e[38;5;198m\][\[\e[38;5;213m\]\u\[\e[38;5;201m\]@\[\e[38;5;177m\]\h \[\e[38;5;135m\]\w\$(b=\$(git branch --show-current 2>/dev/null); [ -n \"\$b\" ] && printf ' \[\e[38;5;81m\](%s)' \"\$b\")\[\e[38;5;198m\]]\[\e[0m\] \$ "
#Aliases
if [[ "$(uname)" == "Darwin" ]]; then
alias ls='ls -hG'
alias clip='pbcopy'
else
alias ls='ls -hN --color=auto --group-directories-first'
alias clip="perl -pe 'chomp if eof' | xclip -sel clip"
fi
alias grep="grep --color"
# Path
export PATH=$HOME/development/flutter/bin:$PATH
#iTerm uses this to get the CWD (OSC 1337) !
export PS1="$PS1\[\e]1337;CurrentDir="'$(pwd)\a\]'
# Run the file that sets all the users private environment variables!
if [ -f $HOME/.bash_env ]; then
. $HOME/.bash_env
fi
# Tell GPG in which terminal to prompt me for my password!
export GPG_TTY=$(tty)
# Set bitwarden as our ssh agent! (https://bitwarden.com/help/ssh-agent/#configure-bitwarden-ssh-agent)
export SSH_AUTH_SOCK=$HOME/.bitwarden-ssh-agent.sock