Get Free Auto Feerporn

20 Getfreeauto Da Soft23948 Get Free Auto Yangxiaoyong's Blog

20 Getfreeauto Da Soft23948 Get Free Auto

Getfreeauto Soft23948 Getfreeauto Soft23948 Getfreeauto Linux ,
Getfreeauto search Getfreeauto ot2 Soft23948 9 Getfreeauto 8 Getfreeauto Soft23948 G Soft23948 tresearchut Getfreeauto

ZSH

发表评论 作者 on 2011-04-21

ZSH 学习使用

Z 是字母最后一位,所以他是终极 Shell.

为什么要选 ZSHELL?

现有的 BASH 自动补全的功能不够用,至少不够我用。


如果有一个路径 [[/home/yxy/project/]] 可以把这个路径命名为 ~project

hash -d project=/home/yxy/project

计算器

zsh 可以当作计算器使用

#载入数学函数模块 可以进行一些比较高级的运算
#(也可以将此句写在配置文件中)
$ zmodload zsh/mathfunc
#$((数学表达式)) 进行运算,使用 echo 显示结果
$ echo $(( sin(1/4.0)**2 + cos(1/4.0)**2 - 1 ))
 -1.1102230246251565e-16
$ echo $(( pi = 4.0 * atan(1.0) ))
 3.1415926535897931
$ echo $(( f = sin(0.3) ))
 0.29552020666133955
$ print $((1e12 * rand48()))
 847909677310.23413
$ print $(( rand48(seed) ))
 0.01043488334700271

命令替换

# bash 中使用这种形式
$ emacs `find . -name "*.html"`
# zsh 同样支持,并可以使用以下形式
$ emacs $(ls **/*.html)

# zsh 还可以将命令结果生成临时文件,并返回文件名
#支持更复杂的输出和过滤。例如,比较 new/ 和 old/ 两个文件夹的内容
$ diff =(ls new/) =(ls old/)
#查看生成的临时文件
ls =()

把我的 zshrc 配置贴上来。

# emacs mode
bindkey -e
autoload -U compinit
compinit

# 命令纠错
setopt correctall

#自动补全功能 {}={}'
#错误校正
zstyle ':completion:*' completer _complete _match _approximate
zstyle ':completion:*:match:*' original only
zstyle ':completion:*:approximate:*' max-errors 1 numeric

#彩色补全菜单
eval $(dircolors -b)
export ZLSCOLORS="${}"
zmodload zsh/complist
zstyle ':completion:*' list-colors ${}
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'

#kill 命令补全
compdef pkill=kill
compdef pkill=killall
zstyle ':completion:*:*:kill:*' menu yes select
zstyle ':completion:*:*:*:*:processes' force-list always
zstyle ':completion:*:processes' command 'ps -au$USER'

#补全类型提示分组
zstyle ':completion:*:matches' group 'yes'
zstyle ':completion:*' group-name ''
zstyle ':completion:*:options' description 'yes'
zstyle ':completion:*:options' auto-description '%d'
zstyle ':completion:*:descriptions' format $'\e[01;33m -- %d --\e[0m'
zstyle ':completion:*:messages' format $'\e[01;35m -- %d --\e[0m'
zstyle ':completion:*:warnings' format $'\e[01;31m -- No Matches Found --\e[0m'
#}}}

##行编辑高亮模式 {}}}

# History
export HISTSIZE=2000
export HISTFILE="$HOME/.history"
#以附加的方式写入历史纪录
setopt INC_APPEND_HISTORY

# 如果没有以下命令,历史记录不会被存储)
export SAVEHIST=$HISTSIZE
setopt hist_ignore_all_dups

# 自动 cd
setopt autocd
#启用 cd 命令的历史纪录,cd -[TAB]进入历史路径
setopt AUTO_PUSHD
#相同的历史路径只保留一个
setopt PUSHD_IGNORE_DUPS

# 设置扩展的文件名替换, 类似正则表达式
# 可以使用扩展的文件名替换查询,例如:cp ^*.(tar|bz2|gz)
setopt extendedglob

# 开启高级命令提示符功能
autoload -U promptinit
promptinit

#彩色补全菜单
eval $(dircolors -b)
export ZLSCOLORS="${}"
zmodload zsh/complist
zstyle ':completion:*' list-colors ${}
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31'

# 改进补全风格
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches for: %d%b'

# 纠正一处错误
zstyle ':completion:*:approximate:*' max-errors 1 numeric

# alias ls="ls --color"
alias ls='ls --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# alias Directories
# hash -d dir_name="dir_path"
hash -d project="home/yxy/projects"
hash -d code="home/yxy/code"

# ##
# PS1

function precmd {} - 1 ))

###
# Truncate the path if it's too long.

PR_FILLBAR=""
PR_PWDLEN=""

local promptsize=${}}
local pwdsize=${}}

if [[ "$promptsize + $pwdsize" -gt $TERMWIDTH ]]; then
((PR_PWDLEN=$TERMWIDTH - $promptsize))
else
PR_FILLBAR="\${}.)}"
fi

###
# Get APM info.

#if which ibam > /dev/null; then
#PR_APM_RESULT=`ibam --percentbattery`
#elif which apm > /dev/null; then
#PR_APM_RESULT=`apm`
#fi
}

setopt extended_glob
preexec () {}
echo -n "\ek$CMD\e\\"
fi
}

setprompt () {}]%}'
eval PR_LIGHT_$color='%{}]%}'
(( count = $count + 1 ))
done
PR_NO_COLOUR="%{}"

###
# See if we can use extended characters to look nicer.

typeset -A altchar
set -A altchar ${}
PR_SET_CHARSET="%{}"
PR_SHIFT_IN="%{}"
PR_SHIFT_OUT="%{}"
PR_HBAR=${}
#PR_HBAR=" "
PR_ULCORNER=${}
PR_LLCORNER=${}
PR_LRCORNER=${}
PR_URCORNER=${}

###
# Decide if we need to set titlebar text.

case $TERM in
xterm*)
PR_TITLEBAR=$'%{}x${} | %y\a%}'
;;
screen)
PR_TITLEBAR=$'%{}x${} | %y\e\\%}'
;;
*)
PR_TITLEBAR=''
;;
esac

###
# Decide whether to set a screen title
if [[ "$TERM" == "screen" ]]; then
PR_STITLE=$'%{}'
else
PR_STITLE=''
fi

###
# APM detection

#if which ibam > /dev/null; then
#PR_APM='$PR_RED${}[(w)-2]}%%(${}[(w)-1]})$PR_LIGHT_BLUE:'
#elif which apm > /dev/null; then
#PR_APM='$PR_RED${}$PR_LIGHT_BLUE:'
#else
PR_APM=''
#fi

###
# Finally, the prompt.

PROMPT='$PR_SET_CHARSET$PR_STITLE${}\
$PR_CYAN$PR_SHIFT_IN$PR_ULCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_GREEN%(!.%SROOT%s.%n)$PR_GREEN@%m:%l\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_HBAR${}$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
$PR_MAGENTA%$PR_PWDLEN<...<%~%<<\
$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_URCORNER$PR_SHIFT_OUT\

$PR_CYAN$PR_SHIFT_IN$PR_LLCORNER$PR_BLUE$PR_HBAR$PR_SHIFT_OUT(\
%(?..$PR_LIGHT_RED%?$PR_BLUE:)\
${}$PR_LIGHT_BLUE%D{}\
$PR_LIGHT_BLUE:%(!.$PR_RED.$PR_WHITE)%#$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_NO_COLOUR '

# ${}$PR_YELLOW%D{}\

RPROMPT=' $PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_BLUE$PR_HBAR$PR_SHIFT_OUT\
($PR_LIGHT_BLUE%D{}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'
# ($PR_YELLOW%D{}$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_CYAN$PR_LRCORNER$PR_SHIFT_OUT$PR_NO_COLOUR'

PS2='$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_BLUE$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT(\
$PR_LIGHT_GREEN%_$PR_BLUE)$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT\
$PR_CYAN$PR_SHIFT_IN$PR_HBAR$PR_SHIFT_OUT$PR_NO_COLOUR '
}

setprompt

# 补全类型
compctl -g '*.tar.gz *.gz*.tgz' + -g '*(-/)' tar zxvf
compctl -g '*.tar.bz2 *.tar.gz *.bz2 *.gz *.jar *.rar *.tar *.tbz2 *.tgz *.zip *.Z' + -g '*(-/)' extract

extract() {} in
 *.tar.bz2) tar -jxvf $1 ;;
 *.tar.gz)  tar -zxvf $1 ;;
 *.bz2)  bunzip2 $1  ;;
 *.gz)  gunzip $1  ;;
 *.jar)  unzip $1  ;;
 *.rar)  unrar x $1  ;;
 *.tar)  tar -xvf $1  ;;
 *.tbz2) tar -jxvf $1 ;;
 *.tgz)  tar -zxvf $1 ;;
 *.zip)  unzip $1  ;;
 *.Z) uncompress $1 ;;
 *)  echo "Unable to extract '$1' :: Unknown extension"
  esac
  else
  echo "File ('$1') does not exist!"
  fi
}

# rdsk
rdsk() {}

ssht() {}

#自动补全选项
zstyle ':completion:*' verbose yes
zstyle ':completion:*' menu select
zstyle ':completion:*:*:default' force-list always
zstyle ':completion:*' select-prompt '%SSelect: lines: %L matches: %M [%p]'

zstyle ':completion:*:match:*' original only
zstyle ':completion::prefix-1:*' completer _complete
zstyle ':completion:predict:*' completer _complete
zstyle ':completion:incremental:*' completer _complete _correct
zstyle ':completion:*' completer _complete _prefix _correct _prefix _match _approximate

#{} g.cn \
  192.168.{}.{},}
#}}}
#
EDITOR="usr/bin/vim"

## END OF FILE #################################################################
# vim:filetype=zsh foldmethod=marker autoindent expandtab shiftwidth=4
Linux ,

19 April, 2011 21:20

发表评论 作者 on 2011-04-19

突然很有出国的愿望,嗯,想出国学习,想出国玩玩,见见异国风情,想出国结识一些朋友

出国目前也出现在我的目标计划内,
可能是美国,也有可能是欧洲某个国家

未分类

gzlug 小聚会

发表评论 作者 n20 Getfreeauto Da Soft23948 Get Free Auto Yangxiaoyong's Blogq p %BC%AB%C6%B7%C0%CB%C5%AE%D3%B0%D4%BA 1 f20 Getfreeauto Da Soft23948 Get Free Auto Yangxiaoyong's Blogd j High