终端配置
安装 zsh 以及其他软件
sudo dnf install -y zsh curl git fzf
更换为 zsh
chsh -s $(which zsh)
重新登录终端后应用 zsh ,提示进行配置
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
--- Type one of the keys in parentheses ---
选择 (1) Continue to the main menu.
Please pick one of the following options:
(1) Configure settings for history, i.e. command lines remembered
and saved by the shell. (Recommended.)
(2) Configure the new completion system. (Recommended.)
(3) Configure how keys behave when editing command lines. (Recommended.)
(4) Pick some of the more common shell options. These are simple "on"
or "off" switches controlling the shell's features.
(0) Exit, creating a blank ~/.zshrc file.
(a) Abort all settings and start from scratch. Note this will overwrite
any settings from zsh-newuser-install already in the startup file.
It will not alter any of your other settings, however.
(q) Quit and do nothing else. The function will be run again next time.
--- Type one of the keys in parentheses ---
选择 (0) Exit, creating a blank ~/.zshrc file.
The function will not be run in future, but you can run
it yourself as follows:
autoload -Uz zsh-newuser-install
zsh-newuser-install -f
The code added to ~/.zshrc is marked by the lines
# Lines configured by zsh-newuser-install
# End of lines configured by zsh-newuser-install
You should not edit anything between these lines if you intend to
run zsh-newuser-install again. You may, however, edit any other part
of the file.
[r1pple@localhost]~%
得到一个空白的 .zshrc
zimfw 框架
安装
Home | Zim Framework: Modular, customizable, and blazing fast Zsh framework
安装脚本
# with curl
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
# with wget
wget -nv -O - https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
[r1pple@localhost]~% curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
,_____________ ,___________
|__, | | , , | | ,__| | | |
/ /| | | | |()| |__| | | |
/ / |-| | | | | ,_|| | | |
/ /__| | | | |()| | | | | |
;____|_|_|_|_| |_| |_____|
) Using Zsh version 5.9
) Zsh is your default shell.
) ZIM_HOME not set, using the default ~/.zim
) Downloaded Zim Framework script to ~/.zim/zimfw.zsh
) Backed up existing file to ~/.zshrc.pre-zim
) Prepended Zim Framework template to ~/.zshrc
) Installed modules.
All done. Enjoy your Zsh IMproved! Restart your terminal for changes to take effect.
生成 .zshrc 和 .zimrc
重新登录终端即可生效
配置
配置完成后执行 zimfw install 生效
49c49,50
< zmodule zsh-users/zsh-syntax-highlighting
---
> # zmodule zsh-users/zsh-syntax-highlighting
> zmodule zdharma-continuum/fast-syntax-highlighting
55a57,60
>
> zmodule bira
> zmodule pabloariasal/zfm
> zmodule Aloxaf/fzf-tab
bira 主题
zmodule bira
语法高亮插件
# 注释掉原来的插件
# zmodule zsh-users/zsh-syntax-highlighting
# 添加新的插件
zmodule zdharma-continuum/fast-syntax-highlighting
fzf-tab
tab自动补全时用 fzf 进行搜索
zmodule Aloxaf/fzf-tab
# 输出配置文件
fzf --zsh > ~/.config/zsh/completions/_fzf
应用
echo "zmodule ~/.config/zsh/completions --fpath ." >> .zimrc
书签管理器
zmodule pabloariasal/zfm