From 39f96642511ba81e35cae67b5115cbabf048197c Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Tue, 29 Nov 2011 14:40:31 +0100 Subject: [PATCH] zshrc: Remove zg() Signed-off-by: Frank Terbeck --- doc/grmlzshrc.t2t | 6 ---- etc/zsh/zshrc | 100 ------------------------------------------------------ 2 files changed, 106 deletions(-) diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index 3d50a91..a8839ee 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -728,12 +728,6 @@ arguments for details. : **xunfunction()** Removes the functions salias, xcat, xsource, xunfunction and zrcautoload. -: **zg()** -Search for patterns in grml's zshrc using perl. zg takes no or exactly one -option plus a non empty pattern. Run zg without any arguments for a listing -of available command line switches. For a zshrc not in /etc/zsh, set the -GRML_ZSHRC environment variable. - : **zrcautoload()** Wrapper around the autoload builtin. Loads the definitions of functions from the file given as argument. Searches $fpath for the file. See also diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 3ab328b..2300908 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -2318,61 +2318,6 @@ bk() { cp -a "$1" "${1}_$(date --iso-8601=seconds)" } -#f1# grep for patterns in grml's zsh setup -zg() { - LANG=C perl -e ' - -sub usage { - print "usage: zg -[anr] \n"; - print " Search for patterns in grml'\''s zshrc.\n"; - print " zg takes no or exactly one option plus a non empty pattern.\n\n"; - print " options:\n"; - print " -- no options (use if your pattern starts in with a dash.\n"; - print " -a search for the pattern in all code regions\n"; - print " -n search for the pattern in non-root code only\n"; - print " -r search in code for everyone (also root) only\n\n"; - print " The default is -a for non-root users and -r for root.\n\n"; - print " If you installed the zshrc to a non-default locations (ie *NOT*\n"; - print " in /etc/zsh/zshrc) do: export GRML_ZSHRC=\$HOME/.zshrc\n"; - print " ...in case you copied the file to that location.\n\n"; - exit 1; -} - -if ($ENV{GRML_ZSHRC} ne "") { - $RC = $ENV{GRML_ZSHRC}; -} else { - $RC = "/etc/zsh/zshrc"; -} - -usage if ($#ARGV < 0 || $#ARGV > 1); -if ($> == 0) { $mode = "allonly"; } -else { $mode = "all"; } - -$opt = $ARGV[0]; -if ($opt eq "--") { shift; } -elsif ($opt eq "-a") { $mode = "all"; shift; } -elsif ($opt eq "-n") { $mode = "nonroot"; shift; } -elsif ($opt eq "-r" ) { $mode = "allonly"; shift; } -elsif ($opt =~ m/^-/ || $#ARGV > 0) { usage(); } - -$pattern = $ARGV[0]; -usage() if ($pattern eq ""); - -open FH, "<$RC" or die "zg: Could not open $RC: $!\n"; -while ($line = ) { - chomp $line; - if ($line =~ m/^#:grep:marker:for:mika:/) { $markerfound = 1; next; } - next if ($mode eq "nonroot" && markerfound == 0); - break if ($mode eq "allonly" && markerfound == 1); - print $line, "\n" if ($line =~ /$pattern/); -} -close FH; -exit 0; - - ' -- "$@" - return $? -} - ssl_hashes=( sha512 sha256 sha1 md5 ) for sh in ${ssl_hashes}; do @@ -2420,7 +2365,6 @@ fi # load the lookup subsystem if it's available on the system zrcautoload lookupinit && lookupinit -#:grep:marker:for:mika: :-) ### non-root (EUID != 0) code below ### @@ -3046,50 +2990,6 @@ if check_com -c hg ; then fi # end of check whether we have the 'hg'-executable -# some useful commands often hard to remember - let's grep for them -# actually use our zg() function now. :) - -# Work around ion/xterm resize bug. -#if [[ "$SHLVL" -eq 1 ]]; then -# if check_com -c resize ; then -# eval `resize Packages.gz -# dpkg-scansources . | gzip > Sources.gz -# grep-dctrl --field Maintainer $* /var/lib/apt/lists/* - -# other stuff: -# convert -geometry 200x200 -interlace LINE -verbose -# ldapsearch -x -b "OU=Bedienstete,O=tug" -h ldap.tugraz.at sn=$1 -# ps -ao user,pcpu,start,command -# gpg --keyserver blackhole.pca.dfn.de --recv-keys -# xterm -bg black -fg yellow -fn -misc-fixed-medium-r-normal--14-140-75-75-c-90-iso8859-15 -ah -# nc -vz $1 1-1024 # portscan via netcat -# wget --mirror --no-parent --convert-links -# pal -d `date +%d` -# autoload -U tetris; zle -N tetris; bindkey '...' ; echo "press ... for playing tennis" -# -# modify console cursor -# see http://www.tldp.org/HOWTO/Framebuffer-HOWTO-5.html -# print $'\e[?96;0;64c' - # grml-small cleanups # The following is used to remove zsh-config-items that do not work -- 2.1.4