Shell Configuration
Here’s how it looks like:
Features
- Shell: oh-my-zsh
- Theme: powerlevel10k
- Plugins: zsh-autosuggestions, zsh-syntax-highlighting, thefuck
Install
-
Install Meslo Nerd Font
Download these four ttf files:
Double-click on each file and click “Install”. This will make
MesloLGS NF
font available to all applications on your system.For setting up the font in the preference of the terminals, please refer to p10k Font.
-
Update
apt
sources1
sudo apt update
-
Install prerequisite tools (git, wget, python3, pip3)
1
sudo apt install wget git python3-dev python3-pip python3-setuptools
-
-
Ubuntu, Debian & derivatives
1
sudo apt install zsh
-
Arch Linux or Manjaro
1
sudo pacman -S zsh
-
macOS has zsh pre-installed
-
-
Install oh-my-zsh via wget
1
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
-
Install powerlevel10k
1
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
-
Install plugins and tools
- 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
-
Download configuration files and link to home directory
- Download ShellConfig from GitHub
1 2 3
mkdir -p ~/Documents/GitHub cd ~/Documents/GitHub git clone https://github.com/jin-li/ShellConfig.git
- Backup old configuration files
1 2
mv ~/.bashrc ~/.bashrc_bak mv ~/.zshrc ~/.zshrc_bak
- Link configuration files to home directory
1 2 3
ln ~/Documents/GitHub/ShellConfig/.bashrc ~/.bashrc ln ~/Documents/GitHub/ShellConfig/.zshrc ~/.zshrc ln ~/Documents/GitHub/ShellConfig/.p10k.zsh ~/.p10k.zsh
- Download ShellConfig from GitHub
-
Restart terminal
Vim Configuration
Features
- Plugin management: Vundle
- Theme: vim-airline
- Plugins: YouCompleteMe, vim-airline, vimtex
Prerequisite
The default vim in Debian OS is vim-tiny, which does not support the plugins. Use following command to check your vim version first before using this configuration.
|
|
If there is “Small version without GUI” in the output, it means your vim is vim-tiny. You can remove it and install the full version vim using following command:
|
|
Configuration
-
Install Vundle
1
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
-
Link configuration file to home directory
1
ln ~/Documents/GitHub/ShellConfig/.vimrc ~/.vimrc
-
Install plugins in Vim, type following command in Vim
1
:PluginInstall
Plugins will be installed automatically, wait until the install completed.
-
Other plugins can be installed easily via Vundle