-
Notifications
You must be signed in to change notification settings - Fork 1
/
aliases
executable file
·130 lines (118 loc) · 2.98 KB
/
aliases
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# new stuff
alias eh='e ~/.config/hypr/hyprland.conf'
alias lz='lazygit'
alias dokku='$HOME/.dokku/contrib/dokku_client.sh'
alias b='gbr'
#python
alias pym='python3 manage.py'
#system
alias e='$EDITOR'
alias kf='kill -9 %1'
alias uall='update-all'
alias tma='tmux attach'
# edit existing command or create a new script
function ew() {
if [[ -f `which "$1"` ]]; then
e `which "$1"`
else
echo "#!/usr/bin/env " > ~/bin/"$1"
chmod +x ~/bin/"$1"
e ~/bin/"$1"
fi
}
#ruby
alias rv='ruby --version'
alias be='bundle exec'
if [[ -v MAC ]]; then
alias grep='ggrep'
alias aws='aws2'
alias bup='brew update && echo "==> Outdated Formula" && brew outdated && brew outdated --cask'
alias bu='brew upgrade'
else
alias pbcopy="xclip -selection c"
alias pbpaste="xclip -selection clipboard -o"
#ubuntu
if [ "$(command -v lsb_release)" ]; then
echo 'On ubuntu'
alias aptu='sudo apt update && sudo apt upgrade'
alias apti='sudo apt install'
alias aptr='sudo apt remove'
alias aptf='sudo apt-cache search'
fi
fi
#rails
alias rs='rails s'
alias ragm='rails g migration'
alias rc='rails c'
alias migrate='rails db:migrate'
alias upgrade_gems="bundle update && rspec && git add -A && git commit -m 'Gem upgrades' && git push"
alias bef='foreman start -f Procfile.dev'
alias rt='rake -T'
alias rr='rails routes'
#heroku
hpush() { git add -A; git commit -m "$*"; git pull --rebase && git push; git push production master; }
alias h="heroku"
alias hc="heroku run rails console"
alias hl="heroku logs -t"
#testing
alias specs='rspec --tag ~type:feature'
alias fspecs='rspec --tag type:feature'
alias aspecs='fspecs && specs'
alias fails='rspec --only-failures'
#git
# unalias g
# g() {
# if [[ $# -eq 0 ]]; then
# command hub status -sb
# else
# command hub "$@";
# fi
# }
unalias gbr 2>/dev/null # exists in bin
[ "$(command -v gcam)" ] && unalias gcam
gcam() {
command git add -A;
command git commit -m "$*";
}
gpush() {
command git add -A;
command git commit -m "$*";
command git push
}
alias cp-head='git rev-parse --short HEAD | pbcopy'
alias gb='git branch'
alias gbX='git branch --delete --force'
alias gbx='git branch --delete'
alias gc='git c'
alias gca='git ca'
alias gd='git d'
alias ge='g edit'
alias gg='git grep'
alias gl='git l'
alias gp='git push'
alias gpf='FORCE=1 git push --force-with-lease --no-verify'
alias gs='git status -sb'
alias lg='lazygit'
#msc
alias cd..='cd ..'
if [ "$(command -v eza)" ]; then
alias ls='eza'
alias ll='eza -l'
alias la='eza -a'
fi
alias -g G='|rg'
alias -g CPOUT='2>&1 | tee >(cat >&2) | xclip -selection clipboard'
[ "$(command -v bat)" ] && alias cat='bat'
#system and files editing
alias ea='e ~/.aliases'
alias eaa='e ~/.alacritty.toml'
alias eg='e ~/.gitconfig'
alias ei='e ~/dotfiles/i3/config'
alias eis='e ~/.i3status.conf'
alias es='e ~/.config/sway/config'
alias ess='e ~/.ssh/config'
alias et='e ~/dotfiles/tmux.conf'
alias ez='e ~/dotfiles/zsh_mods'
alias ezz='e ~/.zshrc'
alias se='sudo -E nvim'
alias sr='exec zsh'