ohmyzsh/plugins/singlechar/singlechar.plugin.zsh

133 lines
2.4 KiB
Bash
Raw Normal View History

2012-05-05 16:58:55 +08:00
################################################################################
# FILE: singlechar.plugin.zsh
# DESCRIPTION: oh-my-zsh plugin file.
# AUTHOR: Michael Varner (musikmichael@web.de)
# VERSION: 1.0.0
#
# This plugin adds single char shortcuts (and combinations) for some commands.
#
################################################################################
2012-05-05 06:05:50 +08:00
###########################
# Settings
2012-05-05 16:58:55 +08:00
2012-05-05 06:05:50 +08:00
# These can be overwritten any time.
# If they are not set yet, they will be
# overwritten with their default values
default GREP grep
default ROOT sudo
2012-05-05 22:03:48 +08:00
default WGET wget
default CURL curl
2012-05-05 06:05:50 +08:00
2012-05-05 22:10:52 +08:00
env_default PAGER less
2012-05-05 22:07:05 +08:00
2012-05-05 06:05:50 +08:00
###########################
# Alias
2012-05-05 22:03:48 +08:00
# CAT, GREP, CURL, WGET
2012-05-13 16:22:45 +08:00
alias y='"$GREP" -Ri'
alias n='"$GREP" -Rvi'
2012-05-05 06:05:50 +08:00
2012-05-29 09:07:15 +08:00
alias f.='find . | "$GREP"'
2012-05-10 15:21:50 +08:00
alias f:='find'
2012-05-13 16:22:45 +08:00
alias f='"$GREP" -Rli'
alias fn='"$GREP" -Rlvi'
2012-05-10 15:21:50 +08:00
2012-05-05 22:17:26 +08:00
alias w='echo >'
alias a='echo >>'
2012-05-05 22:17:26 +08:00
alias c='cat'
2012-05-05 22:07:05 +08:00
alias p='"$PAGER"'
2012-05-10 15:35:29 +08:00
alias m='man'
2012-05-05 22:03:48 +08:00
alias d='"$WGET"'
alias u='"$CURL"'
2012-05-10 15:21:50 +08:00
# enhanced writing
2012-05-05 22:17:26 +08:00
alias w:='cat >'
alias a:='cat >>'
# XARGS
2012-05-05 06:05:50 +08:00
alias x='xargs'
2012-05-13 16:22:45 +08:00
alias xy='xargs "$GREP" -Ri'
alias xn='xargs "$GREP" -Riv'
2012-05-05 06:05:50 +08:00
2012-05-29 09:07:15 +08:00
alias xf.='xargs find . | "$GREP"'
2012-05-10 15:21:50 +08:00
alias xf:='xargs find'
2012-05-13 16:22:45 +08:00
alias xf='xargs "$GREP" -Rli'
alias xfn='xargs "$GREP" -Rlvi'
2012-05-10 15:21:50 +08:00
2012-05-05 22:17:26 +08:00
alias xw='xargs echo >'
alias xa='xargs echo >>'
2012-05-05 22:17:26 +08:00
alias xc='xargs cat'
2012-05-05 22:07:05 +08:00
alias xp='xargs "$PAGER"'
2012-05-10 15:35:29 +08:00
alias xm='xargs man'
2012-05-05 22:03:48 +08:00
alias xd='xargs "$WGET"'
alias xu='xargs "$CURL"'
2012-05-05 22:17:26 +08:00
alias xw:='xargs cat >'
alias xa:='xargs >>'
# SUDO
2012-05-05 06:05:50 +08:00
alias s='"$ROOT"'
2012-05-13 16:22:45 +08:00
alias sy='"$ROOT" "$GREP" -Ri'
alias sn='"$ROOT" "$GREP" -Riv'
2012-05-05 22:08:40 +08:00
2012-05-29 09:07:15 +08:00
alias sf.='"$ROOT" find . | "$GREP"'
2012-05-10 15:35:29 +08:00
alias sf:='"$ROOT" find'
2012-05-10 15:21:50 +08:00
2012-05-13 16:22:45 +08:00
alias sf='"$ROOT" "$GREP" -Rli'
alias sfn='"$ROOT" "$GREP" -Rlvi'
2012-05-10 15:21:50 +08:00
2012-05-05 22:17:26 +08:00
alias sw='"$ROOT" echo >'
alias sa='"$ROOT" echo >>'
2012-05-05 22:08:40 +08:00
2012-05-05 22:17:26 +08:00
alias sc='"$ROOT" cat'
2012-05-05 22:08:40 +08:00
alias sp='"$ROOT" "$PAGER"'
2012-05-10 15:35:29 +08:00
alias sm='"$ROOT" man'
2012-05-05 22:08:40 +08:00
alias sd='"$ROOT" "$WGET"'
2012-05-05 22:17:26 +08:00
alias sw:='"$ROOT" cat >'
alias sa:='"$ROOT" cat >>'
2012-05-05 22:08:40 +08:00
# SUDO-XARGS
2012-05-05 06:05:50 +08:00
alias sx='"$ROOT" xargs'
2012-05-13 16:22:45 +08:00
alias sxy='"$ROOT" xargs "$GREP" -Ri'
alias sxn='"$ROOT" xargs "$GREP" -Riv'
2012-05-29 09:07:15 +08:00
alias sxf.='"$ROOT" xargs find . | "$GREP"'
2012-05-10 15:21:50 +08:00
alias sxf:='"$ROOT" xargs find'
alias sxf='"$ROOT" xargs "$GREP" -li'
alias sxfn='"$ROOT" xargs "$GREP" -lvi'
2012-05-05 22:17:26 +08:00
alias sxw='"$ROOT" xargs echo >'
alias sxa='"$ROOT" xargs echo >>'
2012-05-05 22:03:48 +08:00
2012-05-05 22:17:26 +08:00
alias sxc='"$ROOT" xargs cat'
2012-05-05 22:07:05 +08:00
alias sxp='"$ROOT" xargs "$PAGER"'
2012-05-10 15:35:29 +08:00
alias sxm='"$ROOT" xargs man'
2012-05-05 22:03:48 +08:00
alias sxd='"$ROOT" xargs "$WGET"'
2012-05-05 22:17:26 +08:00
alias sxu='"$ROOT" xargs "$CURL"'
alias sxw:='"$ROOT" xargs cat >'
alias sxa:='"$ROOT" xargs cat >>'