forked from nanounanue/dotfiles
/
aliases
121 lines (94 loc) · 2.42 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
# SSH
# Para evitar el error "Error opening terminal:rxvt-unicode"
# que sucede al conectarse via ssh
alias ssh="TERM=linux ssh"
# ps-fea
alias psf='ps -fea | grep'
# Git
alias gs="git status"
alias gls="git ls-files"
alias ungit="find . -name '.git' -exec rm -rf {} \;"
alias gb='git branch --color'
alias gba='git branch -a'
alias gc='git commit -v'
alias gca='git commit -v -a'
# Commit pending changes and quote all args as message
function gg() {
git commit -v -a -m "$*"
}
alias gco='git checkout'
alias gcb='git checkout -b'
alias gd='git diff'
alias gdm='git diff master'
alias gpl='git pull'
alias gnp="git-notpushed"
alias gps='git push'
alias eg='e .git/config'
alias grm="git status | grep deleted | awk '{print \$3}' | xargs git rm"
# Setup a tracking branch from [remote] [branch_name]
function gbt() {
git branch --track $2 $1/$2 && git checkout $2
}
# Quickly clobber a file and checkout
function grf() {
rm $1
git checkout $1
}
# Emacs
alias e="emacsclient -t"
alias ec="emacsclient -c"
alias et="emacsclient -t"
alias ed="emacs --daemon"
alias vim="emacsclient -t"
alias vi="emacsclient --t"
# Regenerate TAGS file from file arguments
function ct() {
rm -f TAGS
etags --append --output=TAGS $*
}
# Ruby
alias r='rake'
# Rails
alias ss="./script/server"
alias sc='./script/console'
alias sg='./script/generate'
alias sp='./script/plugin'
alias tl='tail -f log/*.log'
alias rmig='rake db:migrate'
# Utilidades
alias reload='source ~/.bashrc'
alias ea='e ~/config/dotfiles/bash/aliases && reload' # Edit aliases
alias ee="e ~/config/dotfiles/bash/env"
# General
alias h='history'
alias md='mkdir -p'
# clear
alias c='clear'
alias cl='clear; l'
alias cls='clear; ls'
# ls
alias ls='ls --color=auto'
alias l='ls -h'
alias ll="l -lGt" # -l lista larga, los más recientes primero
# -G color
alias lf="l -F"
alias la='l -A'
alias lt='l -lt' # sort with recently modified first
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
# kill
alias k9="killall -9"
# Directorios de proyectos
function proyecto() {
cd ~/projects/$1
}
alias p="proyecto"
# Crear directorio y un archivo
mkpfile() { mkdir -p "$(dirname "$1")" || return; touch "$1"; }
## SSH tunnels for dsapp
alias dsapp-up='ssh -fNTM dsapp-tunnel'
alias dsapp-status='ssh -TO check dsapp-tunnel'
alias dsapp-down='ssh -TO exit dsapp-tunnel'