-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
115 lines (95 loc) · 3.09 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#
# ~/.bashrc # # If not running interactively, don't do anything
[[ $- != *i* ]] && return
PS1='[\u@\h \W]\$ '
#Golang
export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export EDITOR='vim'
# Python
export PATH="/usr/bin/python3/bin:$PATH"
export PYTHONPATH="$PYTHONPATH:/home/hetran/python-tetris"
# Ruby
# export PATH="$HOME/.rbenv/bin:$PATH"
# eval "$(rbenv init -)"
# Make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
# Bash History
export HISTCONTROL=ignoredups
export HISTSIZE=1000
export HISTFILESIZE=3000
# Weather
checkWeather() {
curl wttr.in/$1
}
# Aliases
alias ls='ls --color=auto'
alias la='ls -A --color=auto'
alias ll='ls -alF'
alias python='python3'
alias lua='lua5.3'
alias grep='grep --color=auto'
alias weather=checkWeather
alias moon='curl wttr.in/moon'
set -o vi
bind -m vi-insert "\C-l":clear-screen
neofetch
# 256 colour terminal for xfce4
if [ "$COLORTERM" == "xfce4-terminal" ] ; then
export TERM=xterm-256color
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm|xterm-color|*-256color) color_prompt=yes;;
esac
if [ "$color_prompt" = yes ]; then
if [[ ${EUID} == 0 ]] ; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
else
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w \$\[\033[00m\] '
fi
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h \w \$ '
fi
unset color_prompt
# 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
# Easy extraction
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "don't know how to extract '$1'..." ;;
esac
else
echo "'$1' is not a valid file!"
fi
}
# --files: List files that would be searched but do not search
# --no-ignore: Do not respect .gitignore, etc...
# --hidden: Search hidden files and folders
# --follow: Follow symlinks
# --glob: Additional conditions for search (in this case ignore everything in the .git/ folder)
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
export FZF_DEFAULT_COMMAND='rg --files --no-ignore --hidden --follow -g "!{.git,node_modules}/*" 2> /dev/null'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
bind -x '"\C-p": vim $(fzf);'