Tweak aliases and bash profile.
This commit is contained in:
parent
bdb80771c6
commit
1949caff33
11
bash_aliases
11
bash_aliases
@ -4,7 +4,7 @@ alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias ~="cd ~"
|
||||
alias -- -="cd -"
|
||||
alias -- -="cd -" # The alias is `-`, not `--`
|
||||
|
||||
# Shortcuts
|
||||
alias dr="cd ~/Dropbox"
|
||||
@ -66,12 +66,18 @@ done
|
||||
# Convert line endings to UNIX
|
||||
alias dos2unix="perl -pi -e 's/\r\n?/\n/g' "
|
||||
|
||||
# Password generator
|
||||
password() { openssl rand -base64 ${1:-8} | c; }
|
||||
|
||||
# Git root
|
||||
alias gr='[ ! -z `git rev-parse --show-cdup` ] && cd `git rev-parse --show-cdup || pwd`'
|
||||
|
||||
# NPM
|
||||
alias npm-patch='npm version patch -m "%s"'
|
||||
alias npm-release='npm version minor -m "%s"'
|
||||
|
||||
# Grunt
|
||||
alias gw="grunt watch --debug"
|
||||
alias gw="grunt deploy --debug && grunt watch --debug"
|
||||
ginit() { grunt init:$@; }
|
||||
|
||||
# Magic Project Opener
|
||||
@ -80,6 +86,5 @@ function repo { cd "$("$HOME/dotfiles/bin/opener.py" "$HOME/Dropbox/Projects" $1
|
||||
function wptheme { cd "$("$HOME/dotfiles/bin/opener.py" "$HOME/Dropbox/Projects" $1 -w wptheme $2)"; }
|
||||
|
||||
# Load external aliases
|
||||
source ~/dotfiles/includes/root.sh
|
||||
source ~/dotfiles/includes/functions.sh
|
||||
|
12
bash_profile
12
bash_profile
@ -35,12 +35,18 @@ export PATH="$HOME/bin:/usr/local/bin:$PATH"
|
||||
# Add brew coreutils to $PATH
|
||||
command -v brew >/dev/null 2>&1 && export PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
|
||||
|
||||
# Load ~/.extra, ~/.bash_prompt and ~/.bash_aliases
|
||||
# ~/.extra can be used for settings you don’t want to commit
|
||||
for file in ~/.{extra,bash_prompt,bash_aliases}; do
|
||||
[ -r "$file" ] && source "$file"
|
||||
done
|
||||
unset file
|
||||
|
||||
# If possible, add tab completion for many commands
|
||||
[ -f /etc/bash_completion ] && source /etc/bash_completion
|
||||
|
||||
# Aliases and prompt
|
||||
[ -f ~/.bash_aliases ] && source ~/.bash_aliases
|
||||
[ -f ~/.bash_prompt ] && source ~/.bash_prompt
|
||||
# Bash completion (installed via Homebrew; source after `brew` is added to PATH)
|
||||
command -v brew >/dev/null 2>&1 && [ -r "$(brew --prefix)/etc/bash_completion" ] && source "$(brew --prefix)/etc/bash_completion"
|
||||
|
||||
# Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
|
||||
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh
|
||||
|
@ -1,9 +0,0 @@
|
||||
# Copyright 2009 Daniel Jackoway
|
||||
# released under the MIT License
|
||||
# see COPYING for the full text
|
||||
function gitr {
|
||||
while [ ! -d .git -a ! -f '.this_is_root' -a `pwd` != "/" ]
|
||||
do
|
||||
cd "..";
|
||||
done
|
||||
}
|
Loading…
Reference in New Issue
Block a user