-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
42 lines (34 loc) · 1.29 KB
/
.bashrc
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
#!/bin/bash
eval "$(zoxide init bash)"
export PATH=$PATH:/usr/local/go/bin:~/go/bin:
source "$HOME/.config/git-aware.sh"
export EDITOR="nvim"
export READER="zathura"
export FILE="lf"
export BIB="$HOME/Documents/LaTeX/uni.bib"
export REFER="$HOME/Documents/referbib"
set editing-mode vi
stty -ixon # Disable ctrl-s and ctrl-q.
shopt -s autocd #Allows you to cd into directory merely by typing the directory name.
HISTSIZE= HISTFILESIZE= # Infinite history.
# Set PS1 for terminals. Displays time, directory and git branch if in git folder
RED="\[$(tput setaf 1)\]"
GREEN="\[$(tput setaf 6)\]"
BLUE="\[$(tput setaf 4)\]"
WHITE="\[$(tput sgr0)\]"
BOLD="\[$(tput bold)\]"
export PS1="${BOLD}${RED}[${WHITE}\t ${BOLD}${BLUE}\W${RED}]${GREEN}\$git_branch ${WHITE}"
[ -f "$HOME/.config/aliasrc" ] && source "$HOME/.config/aliasrc"
# Save current working dir
touch $HOME/.cwd
PROMPT_COMMAND="pwd > "${HOME}/.cwd" && find_git_branch; history -a"
# Change to saved working dir on load
[[ -f "${HOME}/.cwd" ]] && cd "$(< ${HOME}/.cwd)"
# Automatically start and stop ssh-agent
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
ssh-agent > ~/.ssh-agent-thing
fi
if [[ ! "$SSH_AUTH_SOCK" ]]; then
eval "$(<~/.ssh-agent-thing)"
fi
alias config='/usr/bin/git --git-dir=/home/$USER/.dotfiles/ --work-tree=/home/$USER'