zsh: add alias, increase hist size, add bbgrep

This commit is contained in:
Mathieu Maret 2017-10-23 15:52:48 +02:00
parent 6b1b098945
commit 5f177f1df8
3 changed files with 9 additions and 3 deletions

View File

@ -2,8 +2,8 @@
#man zshcontrib #man zshcontrib
# Lines configured by zsh-newuser-install # Lines configured by zsh-newuser-install
HISTFILE=~/.histfile HISTFILE=~/.histfile
HISTSIZE=10000 HISTSIZE=100000
SAVEHIST=10000 SAVEHIST=100000
export HISTTIMEFORMAT="%h/%d - %H:%M:%S " export HISTTIMEFORMAT="%h/%d - %H:%M:%S "
#export HISTCONTROL=ignoredups #export HISTCONTROL=ignoredups
export HISTCONTROL=erasedups export HISTCONTROL=erasedups

View File

@ -23,6 +23,7 @@ alias minicom='minicom -c on'
alias vims='vim --servername vimserver' alias vims='vim --servername vimserver'
alias vimo='vim --servername vimserver --remote-tab' 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 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 #Extension Alias
alias -s html=$BROWSER alias -s html=$BROWSER
@ -40,10 +41,11 @@ alias -s bz2=tar -xjvf
alias -s java=$EDITOR alias -s java=$EDITOR
alias -s txt=$EDITOR alias -s txt=$EDITOR
alias -s PKGBUILD=$EDITOR alias -s PKGBUILD=$EDITOR
alias -s pdf=evince
# command L equivalent to command |less # command L equivalent to command |less
alias -g L='|less -R' alias -g L='|less -R'
# command S equivalent to command &> /dev/null & # command S equivalent to command &> /dev/null &
alias -g S='&> /dev/null &' alias -g S='&> /dev/null &'

View File

@ -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 "$@" 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 () { 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 "$@" 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 "$@"
} }