cd ~ && git clone https://github.com/sisrfeng/dot_file.git && cd ~/dot_file ; bash auto_install.sh
分割线-----------------------------------------------
~/.antigen/bundles/sorin-ionescu/prezto/modules/utility/init.zsh
prezto用上以后,发现这个文件搞得zsh有点乱七八糟的,有空具体看看prezto这个文件夹有啥
zshrc的内容,顺序很重要,如果遇到哪个插件不行了,挪到靠前或者最后的位置试一试
摘抄:
传统 shell 的补全在 zsh 面前基本都可以下班了:
tab进入补全选择后,CTRL+G 表示退出。
“cd -”命令:
加tab会有提醒
一般是 z + 最后一级目录名,比如:
$ z vim # -> /home/skywind/software/vim
$ z tmp # -> /home/skywind/tmp
$ z local # -> /home/skywind/.local
当没有按照你要求跳转的时候,你可以再补充一下再上一级目录的一些信息,比如 z vim/src 或者 z v src 都可以,
别名
zsh 不仅支持普通 alias,还支持针对文件类型的 alias。我配置的文件类型 alias 如下:
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'
alias -s php=vi
alias -s py=vi
alias -s html=vi
配置完毕之后,在 zsh 下直接输入xxx.py,将自动用 vi 打开
直接输入xxx.tgz,将直接按照tar -xzvf解压。
以后再也不用天天敲ls了:
底下这个没换目录也ls:
autoload -U add-zsh-hook
add-zsh-hook -Uz chpwd (){ ls -1GhtrFB; }
auto cd开着 还能自动ls:
cd() { builtin cd $1 && ls -1GhtrFB; }
底下这个没换目录也ls:
autoload -U add-zsh-hook
add-zsh-hook -Uz chpwd (){ ls -1GhtrFB; }
跳转
输入d,将列出当前 session访问过的所有目录,再按提示的数字即可进入相应目录。
用了autojump(还是 插件z?),..不是返回上一级,而是到了home,所以有人说的下面这个就不行了
~
> d
0~
1~/Applications
2~/.proxychains
3/opt/homebrew-cask/Caskroom
~
> 1
~/Applications
关于antigen、prezto和zsh的关系:
看这个目录就知道层次了 .antigen/bundles/sorin-ionescu/prezto
sorin-ionescu是人名
Zsh has several system-wide and user-local configuration files.
Prezto has one user-local configuration file.
System-wide configuration files are installation-dependent but are installed
in */etc* by default.
User-local configuration files have the same name as their global counterparts
but are prefixed with a dot (hidden). Zsh looks for these files in the path
stored in the `$ZDOTDIR` environment variable. However, if said variable is
not defined, Zsh will use the user's home directory.
File Descriptions
-----------------
The configuration files are read in the following order:
01. /etc/zshenv
02. ~/.zshenv
03. /etc/zprofile
04. ~/.zprofile
05. /etc/zshrc
06. ~/.zshrc
07. ~/.zpreztorc
08. /etc/zlogin
09. ~/.zlogin
10. ~/.zlogout
11. /etc/zlogout
### zshenv
This file is sourced by all instances of Zsh, and thus, it should be kept as
small as possible and should only define environment variables.
### zprofile
This file is similar to zlogin, but it is sourced before zshrc. It was added