singlechar.plugin.zsh 2.42 KB
Newer Older
mapc's avatar
mapc committed
1
2
3
4
5
6
7
8
9
10
################################################################################
#          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.
#
################################################################################

mapc's avatar
mapc committed
11
12
###########################
# Settings 
mapc's avatar
mapc committed
13

mapc's avatar
mapc committed
14
15
16
17
18
19
# 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
mapc's avatar
mapc committed
20
21
default WGET wget
default CURL curl
mapc's avatar
mapc committed
22

mapc's avatar
mapc committed
23
env_default PAGER less
mapc's avatar
mapc committed
24

mapc's avatar
mapc committed
25
26
27
###########################
# Alias

mapc's avatar
mapc committed
28
# CAT, GREP, CURL, WGET
29

mapc's avatar
mapc committed
30
31
alias y='"$GREP" -Ri'
alias n='"$GREP" -Rvi'
mapc's avatar
mapc committed
32

mapc's avatar
mapc committed
33
alias f.='find . | "$GREP"'
mapc's avatar
mapc committed
34
35
alias f:='find'

mapc's avatar
mapc committed
36
37
alias f='"$GREP" -Rli'
alias fn='"$GREP" -Rlvi'
mapc's avatar
mapc committed
38

mapc's avatar
mapc committed
39
40
alias w='echo >'
alias a='echo >>'
41

mapc's avatar
mapc committed
42
alias c='cat'
mapc's avatar
mapc committed
43
44
alias p='"$PAGER"'

mapc's avatar
Add Man    
mapc committed
45
46
alias m='man'

mapc's avatar
mapc committed
47
48
49
alias d='"$WGET"'
alias u='"$CURL"'

mapc's avatar
mapc committed
50
# enhanced writing
mapc's avatar
mapc committed
51
52
53
54

alias w:='cat >'
alias a:='cat >>'

55
56
# XARGS

mapc's avatar
mapc committed
57
alias x='xargs'
58

mapc's avatar
mapc committed
59
60
alias xy='xargs "$GREP" -Ri'
alias xn='xargs "$GREP" -Riv'
mapc's avatar
mapc committed
61

mapc's avatar
mapc committed
62
alias xf.='xargs find . | "$GREP"'
mapc's avatar
mapc committed
63
64
alias xf:='xargs find'

mapc's avatar
mapc committed
65
66
alias xf='xargs "$GREP" -Rli'
alias xfn='xargs "$GREP" -Rlvi'
mapc's avatar
mapc committed
67

mapc's avatar
mapc committed
68
69
alias xw='xargs echo >'
alias xa='xargs echo >>'
70

mapc's avatar
mapc committed
71
alias xc='xargs cat'
mapc's avatar
mapc committed
72
73
alias xp='xargs "$PAGER"'

mapc's avatar
Add Man    
mapc committed
74
75
alias xm='xargs man'

mapc's avatar
mapc committed
76
77
78
alias xd='xargs "$WGET"'
alias xu='xargs "$CURL"'

mapc's avatar
mapc committed
79
80
81
alias xw:='xargs cat >'
alias xa:='xargs >>'

82
83
# SUDO

mapc's avatar
mapc committed
84
alias s='"$ROOT"'
85

mapc's avatar
mapc committed
86
87
alias sy='"$ROOT" "$GREP" -Ri'
alias sn='"$ROOT" "$GREP" -Riv'
mapc's avatar
mapc committed
88

mapc's avatar
mapc committed
89
alias sf.='"$ROOT" find . | "$GREP"'
mapc's avatar
Add Man    
mapc committed
90
alias sf:='"$ROOT" find'
mapc's avatar
mapc committed
91

mapc's avatar
mapc committed
92
93
alias sf='"$ROOT" "$GREP" -Rli'
alias sfn='"$ROOT" "$GREP" -Rlvi'
mapc's avatar
mapc committed
94

mapc's avatar
mapc committed
95
96
alias sw='"$ROOT" echo >'
alias sa='"$ROOT" echo >>'
mapc's avatar
mapc committed
97

mapc's avatar
mapc committed
98
alias sc='"$ROOT" cat'
mapc's avatar
mapc committed
99
100
alias sp='"$ROOT" "$PAGER"'

mapc's avatar
Add Man    
mapc committed
101
102
alias sm='"$ROOT" man'

mapc's avatar
mapc committed
103
104
alias sd='"$ROOT" "$WGET"'

mapc's avatar
mapc committed
105
106
107
alias sw:='"$ROOT" cat >'
alias sa:='"$ROOT" cat >>'

mapc's avatar
mapc committed
108
109
# SUDO-XARGS

mapc's avatar
mapc committed
110
alias sx='"$ROOT" xargs'
111

mapc's avatar
mapc committed
112
113
alias sxy='"$ROOT" xargs "$GREP" -Ri'
alias sxn='"$ROOT" xargs "$GREP" -Riv'
114

mapc's avatar
mapc committed
115
alias sxf.='"$ROOT" xargs find . | "$GREP"'
mapc's avatar
mapc committed
116
117
118
119
120
alias sxf:='"$ROOT" xargs find'

alias sxf='"$ROOT" xargs "$GREP" -li'
alias sxfn='"$ROOT" xargs "$GREP" -lvi'

mapc's avatar
mapc committed
121
122
alias sxw='"$ROOT" xargs echo >'
alias sxa='"$ROOT" xargs echo >>'
mapc's avatar
mapc committed
123

mapc's avatar
mapc committed
124
alias sxc='"$ROOT" xargs cat'
mapc's avatar
mapc committed
125
126
alias sxp='"$ROOT" xargs "$PAGER"'

mapc's avatar
Add Man    
mapc committed
127
128
alias sxm='"$ROOT" xargs man'

mapc's avatar
mapc committed
129
alias sxd='"$ROOT" xargs "$WGET"'
mapc's avatar
mapc committed
130
131
132
133
alias sxu='"$ROOT" xargs "$CURL"'

alias sxw:='"$ROOT" xargs cat >'
alias sxa:='"$ROOT" xargs cat >>'