From 5f177f1df845fb7d4c5a14df00be0df2c8a38f38 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Mon, 23 Oct 2017 15:52:48 +0200 Subject: [PATCH] zsh: add alias, increase hist size, add bbgrep --- .zsh/00_basic.zsh | 4 ++-- .zsh/30_alias.zsh | 4 +++- .zsh/40_function.zsh | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.zsh/00_basic.zsh b/.zsh/00_basic.zsh index d09ebfa..91a3644 100644 --- a/.zsh/00_basic.zsh +++ b/.zsh/00_basic.zsh @@ -2,8 +2,8 @@ #man zshcontrib # Lines configured by zsh-newuser-install HISTFILE=~/.histfile -HISTSIZE=10000 -SAVEHIST=10000 +HISTSIZE=100000 +SAVEHIST=100000 export HISTTIMEFORMAT="%h/%d - %H:%M:%S " #export HISTCONTROL=ignoredups export HISTCONTROL=erasedups diff --git a/.zsh/30_alias.zsh b/.zsh/30_alias.zsh index db7cfd9..3811b69 100644 --- a/.zsh/30_alias.zsh +++ b/.zsh/30_alias.zsh @@ -23,6 +23,7 @@ alias minicom='minicom -c on' alias vims='vim --servername vimserver' alias vimo='vim --servername vimserver --remote-tab' alias agrep='grep --exclude=.git --exclude-dir=out --exclude-dir=prebuilts --exclude-dir=docs --exclude=tags --exclude=cscope.out' +alias beep='mpv /usr/share/sounds/freedesktop/stereo/complete.oga &> /dev/null &' #sound in package sound-theme-freedesktop #Extension Alias alias -s html=$BROWSER @@ -40,10 +41,11 @@ alias -s bz2=tar -xjvf alias -s java=$EDITOR alias -s txt=$EDITOR alias -s PKGBUILD=$EDITOR +alias -s pdf=evince # command L equivalent to command |less -alias -g L='|less -R' +alias -g L='|less -R' # command S equivalent to command &> /dev/null & alias -g S='&> /dev/null &' diff --git a/.zsh/40_function.zsh b/.zsh/40_function.zsh index e3dd657..55c10e4 100755 --- a/.zsh/40_function.zsh +++ b/.zsh/40_function.zsh @@ -94,6 +94,10 @@ mgrep () { find . -name .repo -prune -o -name .git -prune -o -path ./out -prune -o -regextype posix-egrep -iregex '(.*\/Makefile|.*\/Makefile\..*|.*\.make|.*\.mak|.*\.mk)' -type f -print0 | xargs -0 grep --color -n "$@" } +bbgrep () { + find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.bb' -o -name '*.bbclass' -o -name '*.bbappend' \) -print0 | xargs -0 grep --color -n "$@" +} + cgrep () { find . -name .repo -prune -o -name .git -prune -o -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.h' -o -name '*.hpp' \) -print0 | xargs -0 grep --color -n "$@" }