配置shell
效果展示:
特点
- Shell: oh-my-zsh
- 主题: powerlevel10k
- 插件: 命令自动补全建议zsh-autosuggestions, 命令语法高亮zsh-syntax-highlighting
安装
-
安装 Meslo Nerd 字体
下载以下四个字体文件:
若直接点击上述链接无法下载,可使用如下链接:https://cloud.jinli.cyou/s/ZbX2XocirqcATPe。
双击各文件并点击
安装
按钮,然后电脑上包括命令行终端在内的的各个软件就可以使用MesloLGS NF
字体了。请参考p10k Font来为Windows Power Shell、macOS Terminal等命令行终端工具配置
MesloLGS NF
字体。 -
更新
apt
源1
sudo apt update
-
安装依赖的工具库 (git, wget, python3, pip3)
1
sudo apt install wget git python3-dev python3-pip python3-setuptools
-
-
Ubuntu, Debian 及Debian系衍生系统
1
sudo apt install zsh
-
Arch Linux 或 Manjaro
1
sudo pacman -S zsh
-
macOS已自带zsh
-
-
通过wget安装 oh-my-zsh
1
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
-
安装插件和工具
- 命令自动补全建议zsh-autosuggestions
1
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
- 命令语法高亮zsh-syntax-highlighting
1
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
- 命令自动补全建议zsh-autosuggestions
-
下载配置文件,并链接到用户根目录下
- 从GitHub下载 ShellConfig
1 2 3
mkdir -p ~/Documents/GitHub cd ~/Documents/GitHub git clone https://github.com/jin-li/ShellConfig.git
- 备份旧配置文件
1 2
mv ~/.bashrc ~/.bashrc_bak mv ~/.zshrc ~/.zshrc_bak
- 将配置文件链接到 home 目录
1 2 3
ln ~/Documents/GitHub/ShellConfig/.bashrc ~/.bashrc ln ~/Documents/GitHub/ShellConfig/.zshrc ~/.zshrc ln ~/Documents/GitHub/ShellConfig/.p10k.zsh ~/.p10k.zsh
- 从GitHub下载 ShellConfig
-
重启命令行终端
配置Vim
特点
- 使用Vundle作为插件管理工具
- 主题: vim-airline
- 插件: 自动补全工具YouCompleteMe, 主题vim-airline, TeX插件vimtex
前提
Debian系统默认的vim版本是不支持插件功能的vim-tiny。运行如下命令可核对你的vim版本:
|
|
若命令输出显示"Small version without GUI",则意味着你电脑上的 vim 是 vim-tiny。你可以使用如下命令安装正常完整版本的vim:
|
|
配置
-
安装 Vundle
1
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
-
链接配置文件到 home 目录
1
ln ~/Documents/GitHub/ShellConfig/.vimrc ~/.vimrc
-
在vim内安装插件。在vim命令模式下运行下面的命令:
1
:PluginInstall
由于在配置文件中已经声明了这些插件,所以输入上述命令并敲击回车键后这些插件会自动开始安装,可能需要数秒到数分钟来完成安装。
-
也可以通过 Vundle 安装其他插件。