Fixed vim/emacs aliases

This commit is contained in:
Henrik Lissner 2014-09-21 10:10:47 -04:00
parent 4600402d8c
commit ce3282e424

View file

@ -1,3 +1,4 @@
#!/bin/bash
alias q='exit' alias q='exit'
alias clr='clear' alias clr='clear'
@ -8,6 +9,7 @@ alias -- -='cd -'
# Command fixes # Command fixes
alias ln="${aliases[ln]:-ln} -v" # verbose ln alias ln="${aliases[ln]:-ln} -v" # verbose ln
alias wget='wget -c' # Resume download if possible alias wget='wget -c' # Resume download if possible
alias rsyncd='rsync -va --delete' # Hard sync two directories
# Shortcut for git # Shortcut for git
g() { g() {
@ -18,7 +20,8 @@ g() {
fi fi
} }
alias git='hub' is-callable 'hub' && alias git='hub'
alias gi='git init' alias gi='git init'
alias ga='git add' alias ga='git add'
alias gap='git add --patch' alias gap='git add --patch'
@ -39,7 +42,7 @@ if is-callable 'tmux'; then
alias tl='tmux list-sessions' alias tl='tmux list-sessions'
alias ts='tmux switch' alias ts='tmux switch'
tmux-send() { function tmux-send {
tmux send-keys -s "x" $1 Enter tmux send-keys -s "x" $1 Enter
} }
fi fi
@ -48,8 +51,16 @@ fi
if [[ "$OSTYPE" == darwin* ]]; then if [[ "$OSTYPE" == darwin* ]]; then
alias codekit='open -a CodeKit' alias codekit='open -a CodeKit'
alias b='brew' alias b='brew'
alias v='vim'
alias e='emacsclient -n' # Emacs server must be running! function v {
[ $# -eq 0 ] && vim . || vim $@
}
unalias e # get rid of prezto's alias
function e {
[ -z "$@" ] && input="." || input=$@
open -a "Emacs" $input
}
else else
alias ipt='sudo iptables' alias ipt='sudo iptables'
fi fi
@ -76,7 +87,7 @@ alias pye='pyenv'
# Bash-only aliases # Bash-only aliases
if [ -z "$ZSH_VERSION" ]; then if [ -z "$ZSH_VERSION" ]; then
# Allow aliases to be with sudo # Allow sudo with aliases
alias sudo='sudo ' alias sudo='sudo '
alias ls='ls -G' alias ls='ls -G'