-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace symlink with actual file for
.zshalias
This is a file that I change frequently, separate from the whole Prezto framework, which I update separately. If there was a way for me to set options _outside_ of `.zpreztorc` that would get picked up, I should do the same with that file.
- Loading branch information
David Rogers
committed
Jun 14, 2016
1 parent
a8096e9
commit 1af9095
Showing
2 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
alias j='jobs' | ||
|
||
alias vimrc="vim -c '"'edit $MYVIMRC'"'" | ||
alias zshalias="vim ~/.zshalias && source ~/.zshalias" | ||
|
||
alias today='gdate -d today -I' | ||
alias yesterday='gdate -d yesterday -I' | ||
alias tomorrow='gdate -d tomorrow -I' | ||
|
||
## From `brew install hub` | ||
alias gpr='git pull-request' | ||
|
||
## From `brew install git extras` | ||
alias gwi='git ignore' | ||
alias gbp='git-delete-merged-branches' | ||
|
||
## Replacing `git ll` and `git la`... | ||
alias gll='git log --graph --pretty=format:"${_git_log_oneline_format}"' | ||
alias gla='gll --all' | ||
|
||
## From `brew install `hub`... | ||
alias ggo='git browse' | ||
|
||
## Missing from Prezto? | ||
alias gwm='git mv' | ||
alias gwM='git mv --force' | ||
|
||
## Application shortcuts... | ||
|
||
## Find WTF this command is... with regex! | ||
## b/c prezto ships with too many dang aliases to remember them all... | ||
function wtf { | ||
alias | grep $@ | ||
} | ||
|
||
## Print lines between two markers... | ||
## TODO: Move into an autoloading function | ||
function between { | ||
if [ $# -lt 1 ]; then | ||
cat <<'USAGE' | ||
usage: between START END | ||
|
||
Print input from `stdin` that appears between `START` | ||
and `END` markers, as long as they appear on a single | ||
line. | ||
|
||
EXAMPLE | ||
|
||
$> between.zsh | between USAGE EXAMPLE | ||
usage: between START END | ||
|
||
Print input from `stdin` that appears between `START` | ||
and `END` markers, as long as they appear on a single | ||
line. | ||
USAGE | ||
|
||
return 1 | ||
fi | ||
if [ $# -gt 1 ]; then | ||
gawk "/${1}/{keep=1}/${2}/{keep=0} keep" | ||
else | ||
gawk "/${1}/{keep=1}keep" | ||
fi | ||
} ## END between | ||
|
||
## Print a random line from a file... | ||
## TODO: Move into an autoloading function | ||
function randline { | ||
integer lines=$(wc -l <$1) | ||
sed -n $[RANDOM % lines + 1]p $1 | ||
} ## END randline |