+++++++++++++++++
I really wish I could remember where in the PATH my foobar file is.
Code: Select all
ls =foobar
Code: Select all
ls /**/foobar
Code: Select all
ls /**/foobar*
ls /**/foobar* | wc -l
Code: Select all
ls =foobar
Code: Select all
ls /**/foobar
Code: Select all
ls /**/foobar*
ls /**/foobar* | wc -l
Code: Select all
ls -ldt **/*(m-1)
Code: Select all
ls -ldt **/*(.m-1)
Code: Select all
# crun -- compile and run .c program
crun() {
local cprog=$1; shift
local n=$@[(i)--]
gcc -o ${cprog%.*} $cprog $@[1,n-1] && ./${cprog%.*} $@[n+1,-1]
}
Code: Select all
# tracing
tracing() {
local f=$1; shift
functions -t $f
$f "$@"
functions +t $f
}
Code: Select all
ls -l *.(rar|zip|pdf)
Code: Select all
# F6 for ls -l
bindkey -s "^[[17~" "ls -l\n"
Code: Select all
# F7 for ansi-colors script
bindkey -s "^[[18~" "ansi-colors\n"
I wouldn't be so hard on oh-my-zsh. It does have it's perks, particular portability between distros/platforms. The grml configs tend to be very Debian-centric. Oh-my-Zsh has got some great ruby plugins, and also Homebrew support for OS X users (ZSH-Lovers only does the old MacPorts and Fink). It's also (probably) easier to adapt to for newcomers.machinebacon wrote:Yes, the Q used grml's zshrc and recently ohmyzsh for a change (for all interested, it is in ~/bin), but we will revert to grml again, it's way more powerful than the 'other' (which actually only shines because of its theme, and nothing else) IMO
Code: Select all
ls -ld **/*(/^F)
Code: Select all
widthcheck() {
echo ${(l:79::-:)}
}
Code: Select all
autoload -U colors && colors
RPROMPT="[%{$fg_no_bold[red]%}%?%{$reset_color%}]"
PROMPT="%{$fg[blue]%}╭─[%T%{$fg[red]%} %D%{$fg[blue]%}] %{$fg[green]%}%~ \
%{$fg[blue]%}
╰─%B$%b %{$reset_color%}"
Code: Select all
Looks like this:
╭─[17:29 13-11-27] ~
╰─$ [0]
Code: Select all
git_prompt () {
autoload -Uz vcs_info
zstyle ':vcs_info:*' stagedstr '%F{28}●'
zstyle ':vcs_info:*' unstagedstr '%F{11}●'
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{11}%r'
zstyle ':vcs_info:*' enable git svn
precmd () {
if [[ -z $(git ls-files --other --exclude-standard 2> /dev/null) ]] {
zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{blue}]'
} else {
zstyle ':vcs_info:*' formats ' [%F{green}%b%c%u%F{red}●%F{blue}]'
}
vcs_info
}
setopt prompt_subst
RPROMPT='%F{blue}%n@%m %c${vcs_info_msg_0_}%F{blue} %(?/%F{blue}/%F{red})%% %{$reset_color%}'
}