-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc
58 lines (47 loc) · 1.43 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
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]
then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Prompt setup
function git_branch() {
if [ -d .git ] ; then
printf "%s" "($(git branch 2> /dev/null | awk '/\*/{print $2}')) ";
fi
}
PS1='\[\e[36m\]\u \[\e[0m\]in \[\e[32m\]\W \[\e[0m\]$(git_branch)> '
function find_project(){
cd $(find ~/Development -type d -not -path '*/.*' -not -path '*/node_modules*' | fzf --border=rounded --height=20 --layout=reverse)
}
function git_commit(){
git commit -m "$(echo $1)";
echo -e "\nCommit message has $(echo $1 | wc -c) characters";
}
# Aliases
alias reset-software='killall gnome-software & rm -rf ~/.cache/gnome-software/'
alias ll='ls -lah --group-directories-first'
alias tree='tree --dirsfirst -F'
alias fp=find_project
alias gaa='git add .'
alias gap='git add -p'
alias gcm=git_commit
alias gco='git checkout'
alias gcob='git checkout -b'
alias gs='git status'
alias gpl='git pull origin'
alias gph='git push origin'
alias gpuh='git push -u origin'
alias glog='git log --graph --decorate --all'
# Flatpak
PATH="~/.local/share/flatpak/exports/bin:/var/lib/flatpak/exports/bin:$PATH"
# fnm
export PATH="$HOME/.local/share/fnm:$PATH"
eval "`fnm env`"
# fzf
[ -f /usr/share/fzf/shell/key-bindings.bash ] && source /usr/share/fzf/shell/key-bindings.bash