68 lines
1.6 KiB
Markdown
68 lines
1.6 KiB
Markdown
---
|
|
tags:
|
|
- IT/Tools/termux
|
|
- IT/Tools/Shell
|
|
---
|
|
|
|
|
|
## Installation
|
|
|
|
To set up Oh My Zsh in Termux, follow these steps:
|
|
|
|
Install required packages:
|
|
```shell
|
|
pkg install zsh git curl wget
|
|
```
|
|
|
|
Install Oh My Zsh using the official installer:
|
|
```shell
|
|
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
|
```
|
|
|
|
Set Zsh as the default shell:
|
|
```shell
|
|
chsh -s zsh
|
|
```
|
|
|
|
Restart Termux for changes to take effect.
|
|
Recommended Enhancements:
|
|
Use a modern theme like Powerlevel10k:
|
|
```shell
|
|
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
|
|
```
|
|
|
|
|
|
Then, in ~/.zshrc, set:
|
|
```shell
|
|
ZSH_THEME="powerlevel10k/powerlevel10k"
|
|
```
|
|
|
|
|
|
Install Powerline fonts for proper icons (optional but recommended):
|
|
```shell
|
|
pkg install fontconfig
|
|
mkdir -p ~/.termux/font
|
|
cd ~/.termux/font
|
|
curl -sSLO https://github.com/powerline/fonts/raw/master/SourceCodePro/Source%20Code%20Pro%20for%20Powerline.otf
|
|
cd -
|
|
termux-reload-settings
|
|
```
|
|
|
|
Enable useful plugins (e.g., zsh-autosuggestions, zsh-syntax-highlighting):
|
|
```shell
|
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
|
```
|
|
|
|
|
|
Add plugins to ~/.zshrc:
|
|
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
|
|
|
|
Reload configuration:
|
|
```shell
|
|
source ~/.zshrc
|
|
```
|
|
|
|
|
|
For a complete setup, consider using scripts like adi1090x/termux-omz or Sohil876/Termux-zsh for automated installation of Zsh, Oh My Zsh, Powerlevel10k, and additional tools.
|