-
Notifications
You must be signed in to change notification settings - Fork 4
/
.bashrc
66 lines (51 loc) · 1.9 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# -- Source dependencies
# source .bashrc-local if it exists
if [ -f ~/.bashrc-local ]; then
source ~/.bashrc-local
fi
# Get it from the original Git repo:
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh
if [ -f ~/.git-prompt.sh ]; then
source ~/.git-prompt.sh
fi
# # Get it from the original Git repo:
# https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
# -- Aliases
alias l="ls -lAh"
alias ll="ls -Gl"
alias la='ls -GA'
alias ls="ls -GpF"
alias g=git
# Reload the shell
alias reload!='. ~/.bashrc'
# DOS style clear
alias cls="clear"
# load GitHub Copilot aliases
eval "$(gh copilot alias -- bash)"
# -- Prompt
export GIT_PS1_SHOWCOLORHINTS=true
export GIT_PS1_SHOWDIRTYSTATE=true
# export GIT_PS1_SHOWUNTRACKEDFILES=true
# If we don't use the below git master one, use this simple
# PS1="\[$(tput setaf 6)\]\W\[$(tput sgr0)\]\[$(tput sgr0)\] \$ "
# 1. Git branch is being showed
# 2. Title of terminal is changed for each new shell
# 3. History is appended each time
export PROMPT_COMMAND='__git_ps1 "\[$(tput setaf 6)\]\W\[$(tput sgr0)\]\[$(tput sgr0)\]" "\n» "; echo -ne "\033]0;${PWD##*/}\007"'
# -- History
# ignoreboth ignores commands starting with a space and duplicates. Erasedups
# removes all previous dups in history
export HISTCONTROL=ignoreboth:erasedups
export HISTFILE=~/.bash_history # be explicit about file path
export HISTSIZE=100000 # in memory history size
export HISTFILESIZE=100000 # on disk history size
export HISTTIMEFORMAT='%F %T '
shopt -s histappend # append to history, don't overwrite it
shopt -s cmdhist # save multi line commands as one command
# Save multi-line commands to the history with embedded newlines
# instead of semicolons -- requries cmdhist to be on.
shopt -s lithist