Skip to content

Commit

Permalink
Replace symlink with actual file for .zshalias
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 2 deletions.
2 changes: 1 addition & 1 deletion home/.zprezto
Submodule .zprezto updated 1 files
+0 −68 runcoms/zshalias
1 change: 0 additions & 1 deletion home/.zshalias

This file was deleted.

71 changes: 71 additions & 0 deletions home/.zshalias
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

0 comments on commit 1af9095

Please sign in to comment.