From fcb153c2e32641bb13649bfdd8d3bbe8c17798c8 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 00:05:50 +0200 Subject: [PATCH 01/13] Add the singlechar plugin --- plugins/singlechar/singlechar.plugin.zsh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 plugins/singlechar/singlechar.plugin.zsh diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh new file mode 100644 index 000000000..1440a6237 --- /dev/null +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -0,0 +1,24 @@ +########################### +# Settings +# +# 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 + +########################### +# Alias + +alias y='"$GREP" -i' +alias n='"$GREP" -vi' + +alias x='xargs' +alias xy='xargs "$GREP" -i' +alias xn='xargs "$GREP" -iv' + +alias s='"$ROOT"' +alias sx='"$ROOT" xargs' +alias sxy='"$ROOT" xargs "$GREP" -i' +alias sxn='"$ROOT" xargs "$GREP" -iv' \ No newline at end of file From f970d8206e9245eb2f78728623fdfff354402644 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 10:52:46 +0200 Subject: [PATCH 02/13] Add cat (+write, +append), enhance formatting --- plugins/singlechar/singlechar.plugin.zsh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 1440a6237..3635dd19a 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -11,14 +11,35 @@ default ROOT sudo ########################### # Alias +# CAT, GREP + alias y='"$GREP" -i' alias n='"$GREP" -vi' +alias c='cat' +alias w='cat >' +alias a='cat >>' + +# XARGS + alias x='xargs' + alias xy='xargs "$GREP" -i' alias xn='xargs "$GREP" -iv' +alias xc='xargs cat' +alias xw='xargs cat >' +alias xa='xargs cat >>' + +# SUDO + alias s='"$ROOT"' + alias sx='"$ROOT" xargs' + alias sxy='"$ROOT" xargs "$GREP" -i' -alias sxn='"$ROOT" xargs "$GREP" -iv' \ No newline at end of file +alias sxn='"$ROOT" xargs "$GREP" -iv' + +alias sxc='"$ROOT" xargs cat' +alias sxw='"$ROOT" xargs cat >' +alias sxa='"$ROOT" xargs cat >>' From 4c0b5c71d5332f6961156fc1cda0ab9cc54b8787 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 10:58:55 +0200 Subject: [PATCH 03/13] Add a description --- plugins/singlechar/singlechar.plugin.zsh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 3635dd19a..06fa78b9c 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -1,6 +1,16 @@ +################################################################################ +# 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. +# +################################################################################ + ########################### # Settings -# + # These can be overwritten any time. # If they are not set yet, they will be # overwritten with their default values From e0b271264460219e624ac378c40421490a8e193c Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 16:03:48 +0200 Subject: [PATCH 04/13] Add download shortcuts --- plugins/singlechar/singlechar.plugin.zsh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 06fa78b9c..f4517d274 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -17,11 +17,13 @@ default GREP grep default ROOT sudo +default WGET wget +default CURL curl ########################### # Alias -# CAT, GREP +# CAT, GREP, CURL, WGET alias y='"$GREP" -i' alias n='"$GREP" -vi' @@ -30,6 +32,9 @@ alias c='cat' alias w='cat >' alias a='cat >>' +alias d='"$WGET"' +alias u='"$CURL"' + # XARGS alias x='xargs' @@ -41,6 +46,9 @@ alias xc='xargs cat' alias xw='xargs cat >' alias xa='xargs cat >>' +alias xd='xargs "$WGET"' +alias xu='xargs "$CURL"' + # SUDO alias s='"$ROOT"' @@ -53,3 +61,6 @@ alias sxn='"$ROOT" xargs "$GREP" -iv' alias sxc='"$ROOT" xargs cat' alias sxw='"$ROOT" xargs cat >' alias sxa='"$ROOT" xargs cat >>' + +alias sxd='"$ROOT" xargs "$WGET"' +alias sxu='"$ROOT" xargs "$CURL"' \ No newline at end of file From 712f850f3a860e87458d35a7d8ebba13b9975a06 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 16:07:05 +0200 Subject: [PATCH 05/13] Add pager shortcuts --- plugins/singlechar/singlechar.plugin.zsh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index f4517d274..aadcde423 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -20,6 +20,8 @@ default ROOT sudo default WGET wget default CURL curl +env_defaul PAGER less + ########################### # Alias @@ -32,6 +34,8 @@ alias c='cat' alias w='cat >' alias a='cat >>' +alias p='"$PAGER"' + alias d='"$WGET"' alias u='"$CURL"' @@ -46,6 +50,8 @@ alias xc='xargs cat' alias xw='xargs cat >' alias xa='xargs cat >>' +alias xp='xargs "$PAGER"' + alias xd='xargs "$WGET"' alias xu='xargs "$CURL"' @@ -62,5 +68,7 @@ alias sxc='"$ROOT" xargs cat' alias sxw='"$ROOT" xargs cat >' alias sxa='"$ROOT" xargs cat >>' +alias sxp='"$ROOT" xargs "$PAGER"' + alias sxd='"$ROOT" xargs "$WGET"' alias sxu='"$ROOT" xargs "$CURL"' \ No newline at end of file From 6f5599474f31516cec641242c0bdb391d8930cf2 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 16:08:40 +0200 Subject: [PATCH 06/13] Add sudo without xargs shortcuts --- plugins/singlechar/singlechar.plugin.zsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index aadcde423..0a815736d 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -59,6 +59,19 @@ alias xu='xargs "$CURL"' alias s='"$ROOT"' +alias sy='"$ROOT" "$GREP" -i' +alias sn='"$ROOT" "$GREP" -iv' + +alias sc='"$ROOT" cat' +alias sw='"$ROOT" cat >' +alias sa='"$ROOT" cat >>' + +alias sp='"$ROOT" "$PAGER"' + +alias sd='"$ROOT" "$WGET"' + +# SUDO-XARGS + alias sx='"$ROOT" xargs' alias sxy='"$ROOT" xargs "$GREP" -i' From 88f3f28e8c634e54e68769d72f2ec40f7c5d35f9 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 16:10:52 +0200 Subject: [PATCH 07/13] env_defaul=>env_default --- plugins/singlechar/singlechar.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 0a815736d..b6c9665c5 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -20,7 +20,7 @@ default ROOT sudo default WGET wget default CURL curl -env_defaul PAGER less +env_default PAGER less ########################### # Alias From 67290ffca93d3fb7ebeb9253cc551a5632299c16 Mon Sep 17 00:00:00 2001 From: mapc Date: Sat, 5 May 2012 16:17:26 +0200 Subject: [PATCH 08/13] Enhance writing routines --- plugins/singlechar/singlechar.plugin.zsh | 40 ++++++++++++++++-------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index b6c9665c5..ea9b34324 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -30,15 +30,20 @@ env_default PAGER less alias y='"$GREP" -i' alias n='"$GREP" -vi' -alias c='cat' -alias w='cat >' -alias a='cat >>' +alias w='echo >' +alias a='echo >>' +alias c='cat' alias p='"$PAGER"' alias d='"$WGET"' alias u='"$CURL"' +# enhanced writeing + +alias w:='cat >' +alias a:='cat >>' + # XARGS alias x='xargs' @@ -46,15 +51,18 @@ alias x='xargs' alias xy='xargs "$GREP" -i' alias xn='xargs "$GREP" -iv' -alias xc='xargs cat' -alias xw='xargs cat >' -alias xa='xargs cat >>' +alias xw='xargs echo >' +alias xa='xargs echo >>' +alias xc='xargs cat' alias xp='xargs "$PAGER"' alias xd='xargs "$WGET"' alias xu='xargs "$CURL"' +alias xw:='xargs cat >' +alias xa:='xargs >>' + # SUDO alias s='"$ROOT"' @@ -62,14 +70,17 @@ alias s='"$ROOT"' alias sy='"$ROOT" "$GREP" -i' alias sn='"$ROOT" "$GREP" -iv' -alias sc='"$ROOT" cat' -alias sw='"$ROOT" cat >' -alias sa='"$ROOT" cat >>' +alias sw='"$ROOT" echo >' +alias sa='"$ROOT" echo >>' +alias sc='"$ROOT" cat' alias sp='"$ROOT" "$PAGER"' alias sd='"$ROOT" "$WGET"' +alias sw:='"$ROOT" cat >' +alias sa:='"$ROOT" cat >>' + # SUDO-XARGS alias sx='"$ROOT" xargs' @@ -77,11 +88,14 @@ alias sx='"$ROOT" xargs' alias sxy='"$ROOT" xargs "$GREP" -i' alias sxn='"$ROOT" xargs "$GREP" -iv' -alias sxc='"$ROOT" xargs cat' -alias sxw='"$ROOT" xargs cat >' -alias sxa='"$ROOT" xargs cat >>' +alias sxw='"$ROOT" xargs echo >' +alias sxa='"$ROOT" xargs echo >>' +alias sxc='"$ROOT" xargs cat' alias sxp='"$ROOT" xargs "$PAGER"' alias sxd='"$ROOT" xargs "$WGET"' -alias sxu='"$ROOT" xargs "$CURL"' \ No newline at end of file +alias sxu='"$ROOT" xargs "$CURL"' + +alias sxw:='"$ROOT" xargs cat >' +alias sxa:='"$ROOT" xargs cat >>' \ No newline at end of file From 3af5cf3b1d40312101dae89c1d43c9d6afef8fcd Mon Sep 17 00:00:00 2001 From: mapc Date: Thu, 10 May 2012 09:21:50 +0200 Subject: [PATCH 09/13] Add file finders --- plugins/singlechar/singlechar.plugin.zsh | 26 +++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index ea9b34324..cd5191cbd 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -30,6 +30,12 @@ env_default PAGER less alias y='"$GREP" -i' alias n='"$GREP" -vi' +alias f.='find .' +alias f:='find' + +alias f='"$GREP" -li' +alias fn='"$GREP" -lvi' + alias w='echo >' alias a='echo >>' @@ -39,7 +45,7 @@ alias p='"$PAGER"' alias d='"$WGET"' alias u='"$CURL"' -# enhanced writeing +# enhanced writing alias w:='cat >' alias a:='cat >>' @@ -51,6 +57,12 @@ alias x='xargs' alias xy='xargs "$GREP" -i' alias xn='xargs "$GREP" -iv' +alias xf.='xargs find .' +alias xf:='xargs find' + +alias xf='xargs "$GREP" -li' +alias xfn='xargs "$GREP" -lvi' + alias xw='xargs echo >' alias xa='xargs echo >>' @@ -70,6 +82,12 @@ alias s='"$ROOT"' alias sy='"$ROOT" "$GREP" -i' alias sn='"$ROOT" "$GREP" -iv' +alias xf.='"$ROOT" find .' +alias xf:='"$ROOT" find' + +alias xf='"$ROOT" "$GREP" -li' +alias xfn='"$ROOT" "$GREP" -lvi' + alias sw='"$ROOT" echo >' alias sa='"$ROOT" echo >>' @@ -88,6 +106,12 @@ alias sx='"$ROOT" xargs' alias sxy='"$ROOT" xargs "$GREP" -i' alias sxn='"$ROOT" xargs "$GREP" -iv' +alias sxf.='"$ROOT" xargs find .' +alias sxf:='"$ROOT" xargs find' + +alias sxf='"$ROOT" xargs "$GREP" -li' +alias sxfn='"$ROOT" xargs "$GREP" -lvi' + alias sxw='"$ROOT" xargs echo >' alias sxa='"$ROOT" xargs echo >>' From 7a338ab6a5208a9f9b9fcbf69d225159fc4ae600 Mon Sep 17 00:00:00 2001 From: mapc Date: Thu, 10 May 2012 09:35:29 +0200 Subject: [PATCH 10/13] Add Man --- plugins/singlechar/singlechar.plugin.zsh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index cd5191cbd..d44a0e80f 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -42,6 +42,8 @@ alias a='echo >>' alias c='cat' alias p='"$PAGER"' +alias m='man' + alias d='"$WGET"' alias u='"$CURL"' @@ -69,6 +71,8 @@ alias xa='xargs echo >>' alias xc='xargs cat' alias xp='xargs "$PAGER"' +alias xm='xargs man' + alias xd='xargs "$WGET"' alias xu='xargs "$CURL"' @@ -82,11 +86,11 @@ alias s='"$ROOT"' alias sy='"$ROOT" "$GREP" -i' alias sn='"$ROOT" "$GREP" -iv' -alias xf.='"$ROOT" find .' -alias xf:='"$ROOT" find' +alias sf.='"$ROOT" find .' +alias sf:='"$ROOT" find' -alias xf='"$ROOT" "$GREP" -li' -alias xfn='"$ROOT" "$GREP" -lvi' +alias sf='"$ROOT" "$GREP" -li' +alias sfn='"$ROOT" "$GREP" -lvi' alias sw='"$ROOT" echo >' alias sa='"$ROOT" echo >>' @@ -94,6 +98,8 @@ alias sa='"$ROOT" echo >>' alias sc='"$ROOT" cat' alias sp='"$ROOT" "$PAGER"' +alias sm='"$ROOT" man' + alias sd='"$ROOT" "$WGET"' alias sw:='"$ROOT" cat >' @@ -118,6 +124,8 @@ alias sxa='"$ROOT" xargs echo >>' alias sxc='"$ROOT" xargs cat' alias sxp='"$ROOT" xargs "$PAGER"' +alias sxm='"$ROOT" xargs man' + alias sxd='"$ROOT" xargs "$WGET"' alias sxu='"$ROOT" xargs "$CURL"' From d573cddcc937be8c253b97b7343a0670aea3e9b7 Mon Sep 17 00:00:00 2001 From: mapc Date: Tue, 29 May 2012 03:07:15 +0200 Subject: [PATCH 11/13] Enhance file find --- plugins/singlechar/singlechar.plugin.zsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index d44a0e80f..4d3e16b12 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -30,7 +30,7 @@ env_default PAGER less alias y='"$GREP" -i' alias n='"$GREP" -vi' -alias f.='find .' +alias f.='find . | "$GREP"' alias f:='find' alias f='"$GREP" -li' @@ -59,7 +59,7 @@ alias x='xargs' alias xy='xargs "$GREP" -i' alias xn='xargs "$GREP" -iv' -alias xf.='xargs find .' +alias xf.='xargs find . | "$GREP"' alias xf:='xargs find' alias xf='xargs "$GREP" -li' @@ -86,7 +86,7 @@ alias s='"$ROOT"' alias sy='"$ROOT" "$GREP" -i' alias sn='"$ROOT" "$GREP" -iv' -alias sf.='"$ROOT" find .' +alias sf.='"$ROOT" find . | "$GREP"' alias sf:='"$ROOT" find' alias sf='"$ROOT" "$GREP" -li' @@ -112,7 +112,7 @@ alias sx='"$ROOT" xargs' alias sxy='"$ROOT" xargs "$GREP" -i' alias sxn='"$ROOT" xargs "$GREP" -iv' -alias sxf.='"$ROOT" xargs find .' +alias sxf.='"$ROOT" xargs find . | "$GREP"' alias sxf:='"$ROOT" xargs find' alias sxf='"$ROOT" xargs "$GREP" -li' From b1977d4049cbb7fd203f53511c1067a17150d3e4 Mon Sep 17 00:00:00 2001 From: mapc Date: Sun, 13 May 2012 10:22:45 +0200 Subject: [PATCH 12/13] Make grep recoursive --- plugins/singlechar/singlechar.plugin.zsh | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 4d3e16b12..58837407d 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -27,14 +27,14 @@ env_default PAGER less # CAT, GREP, CURL, WGET -alias y='"$GREP" -i' -alias n='"$GREP" -vi' +alias y='"$GREP" -Ri' +alias n='"$GREP" -Rvi' alias f.='find . | "$GREP"' alias f:='find' -alias f='"$GREP" -li' -alias fn='"$GREP" -lvi' +alias f='"$GREP" -Rli' +alias fn='"$GREP" -Rlvi' alias w='echo >' alias a='echo >>' @@ -56,14 +56,14 @@ alias a:='cat >>' alias x='xargs' -alias xy='xargs "$GREP" -i' -alias xn='xargs "$GREP" -iv' +alias xy='xargs "$GREP" -Ri' +alias xn='xargs "$GREP" -Riv' alias xf.='xargs find . | "$GREP"' alias xf:='xargs find' -alias xf='xargs "$GREP" -li' -alias xfn='xargs "$GREP" -lvi' +alias xf='xargs "$GREP" -Rli' +alias xfn='xargs "$GREP" -Rlvi' alias xw='xargs echo >' alias xa='xargs echo >>' @@ -83,14 +83,14 @@ alias xa:='xargs >>' alias s='"$ROOT"' -alias sy='"$ROOT" "$GREP" -i' -alias sn='"$ROOT" "$GREP" -iv' +alias sy='"$ROOT" "$GREP" -Ri' +alias sn='"$ROOT" "$GREP" -Riv' alias sf.='"$ROOT" find . | "$GREP"' alias sf:='"$ROOT" find' -alias sf='"$ROOT" "$GREP" -li' -alias sfn='"$ROOT" "$GREP" -lvi' +alias sf='"$ROOT" "$GREP" -Rli' +alias sfn='"$ROOT" "$GREP" -Rlvi' alias sw='"$ROOT" echo >' alias sa='"$ROOT" echo >>' @@ -109,8 +109,8 @@ alias sa:='"$ROOT" cat >>' alias sx='"$ROOT" xargs' -alias sxy='"$ROOT" xargs "$GREP" -i' -alias sxn='"$ROOT" xargs "$GREP" -iv' +alias sxy='"$ROOT" xargs "$GREP" -Ri' +alias sxn='"$ROOT" xargs "$GREP" -Riv' alias sxf.='"$ROOT" xargs find . | "$GREP"' alias sxf:='"$ROOT" xargs find' From 0f35726a003e133daf8879aa05ba276ed565c0dd Mon Sep 17 00:00:00 2001 From: mapc Date: Sun, 13 May 2012 10:23:20 +0200 Subject: [PATCH 13/13] Make (s)xf not search in current dir --- plugins/singlechar/singlechar.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/singlechar/singlechar.plugin.zsh b/plugins/singlechar/singlechar.plugin.zsh index 58837407d..44bd998aa 100644 --- a/plugins/singlechar/singlechar.plugin.zsh +++ b/plugins/singlechar/singlechar.plugin.zsh @@ -59,7 +59,7 @@ alias x='xargs' alias xy='xargs "$GREP" -Ri' alias xn='xargs "$GREP" -Riv' -alias xf.='xargs find . | "$GREP"' +alias xf.='xargs find | "$GREP"' alias xf:='xargs find' alias xf='xargs "$GREP" -Rli' @@ -112,7 +112,7 @@ alias sx='"$ROOT" xargs' alias sxy='"$ROOT" xargs "$GREP" -Ri' alias sxn='"$ROOT" xargs "$GREP" -Riv' -alias sxf.='"$ROOT" xargs find . | "$GREP"' +alias sxf.='"$ROOT" xargs find | "$GREP"' alias sxf:='"$ROOT" xargs find' alias sxf='"$ROOT" xargs "$GREP" -li'