-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
77 lines (70 loc) · 1.5 KB
/
.bashrc
File metadata and controls
77 lines (70 loc) · 1.5 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
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
# Extract archives - use: extract <file>
# Credits to http://dotfiles.org/~pseup/.bashrc
function extract() {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*) echo "'$1' cannot be extracted via extract()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
# peco + ghq
function ghqp() {
cd $(ghq list --full-path | peco)
clear
}
bind -x '"\C-g": ghqp'
# peco + ssh
function s() {
ssh $(awk '
tolower($1)=="host" {
for (i=2; i<=NF; i++) {
if ($i !~ "[*?]") {
print $i
}
}
}
' ~/.ssh/config | sort | peco)
}
function diffspec() {
bundle exec rspec $(git status --short | grep 'spec.rb' | awk '{ print $2 }')
}
# aliases
alias b='bat -p'
alias c='nyan'
alias g='git'
alias o='open'
alias p='peco'
alias tailf='tail -f'
alias v='vim'
# ls
alias l='la'
alias la='ls -lA'
alias ls='ls -G'
# Easier navigation
alias ..="cd .."
alias ...="cd ../.."
alias ....="cd ../../.."
alias .....="cd ../../../.."
# colorized grep
alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'
alias vgrep='grep -v --color'
# https://starship.rs
# eval "$(starship init bash)"
# https://mise.jdx.dev/getting-started.html
# eval "$(mise activate bash)"
export EDITOR=vim