Add zsh.md
This commit is contained in:
parent
06fd2997a1
commit
69f69d2f2a
1 changed files with 145 additions and 0 deletions
145
zsh.md
Normal file
145
zsh.md
Normal file
|
|
@ -0,0 +1,145 @@
|
||||||
|
# Set Up Zsh with Powerlevel10k
|
||||||
|
|
||||||
|
## 1. Install Everything
|
||||||
|
|
||||||
|
Install Zsh, Powerlevel10k, plugins, and the Meslo Nerd Font:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yay -S zsh zsh-theme-powerlevel10k zsh-autosuggestions zsh-syntax-highlighting ttf-meslo-nerd
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. Change Your Default Shell to Zsh
|
||||||
|
|
||||||
|
```bash
|
||||||
|
chsh -s /bin/zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Important:** Log out of your account and log back in for the change to take effect.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. Configure Konsole Font
|
||||||
|
|
||||||
|
In **Konsole**:
|
||||||
|
|
||||||
|
1. Open **Settings > configure konsole > profiles > new > change command to /usr/bin/zsh**
|
||||||
|
2. Go to **Appearance**
|
||||||
|
3. Change the terminal font: **Choose:**
|
||||||
|
4. Select the installed **MesloLGS Nerd Font**
|
||||||
|
5. Apply the changes
|
||||||
|
6. make your new profile default: Set as Default
|
||||||
|
|
||||||
|
The Nerd Font is required for Powerlevel10k's icons and symbols to display correctly.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Configure `~/.zshrc`
|
||||||
|
|
||||||
|
Open your Zsh configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Paste the following:
|
||||||
|
|
||||||
|
```zsh
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
# Powerlevel10k
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
|
source /usr/share/zsh-theme-powerlevel10k/powerlevel10k.zsh-theme
|
||||||
|
|
||||||
|
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
# Plugins
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
|
# Autosuggestions
|
||||||
|
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
||||||
|
|
||||||
|
# Syntax highlighting
|
||||||
|
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
||||||
|
|
||||||
|
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
# Powerlevel10k configuration
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||||
|
|
||||||
|
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
# Completion
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
|
autoload -Uz compinit
|
||||||
|
compinit
|
||||||
|
|
||||||
|
setopt CORRECT
|
||||||
|
setopt AUTO_CD
|
||||||
|
|
||||||
|
zstyle ':completion:*' completer _complete _approximate
|
||||||
|
zstyle ':completion:*' menu select
|
||||||
|
|
||||||
|
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
# History
|
||||||
|
# ─────────────────────────────────────
|
||||||
|
|
||||||
|
HISTFILE="$HOME/.zsh_history"
|
||||||
|
SAVEHIST=10000
|
||||||
|
|
||||||
|
setopt APPEND_HISTORY
|
||||||
|
setopt SHARE_HISTORY
|
||||||
|
setopt HIST_IGNORE_DUPS
|
||||||
|
setopt HIST_IGNORE_SPACE
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. Configure Powerlevel10k
|
||||||
|
|
||||||
|
Start Zsh:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
This launches the Powerlevel10k configuration wizard.
|
||||||
|
|
||||||
|
You can re-run it at any time with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
p10k configure
|
||||||
|
```
|
||||||
|
|
||||||
|
Your configuration will be saved to:
|
||||||
|
|
||||||
|
```text
|
||||||
|
~/.p10k.zsh
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Useful Commands
|
||||||
|
|
||||||
|
Reconfigure Powerlevel10k:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
p10k configure
|
||||||
|
```
|
||||||
|
|
||||||
|
Reload your Zsh configuration without restarting the shell:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
source ~/.zshrc
|
||||||
|
```
|
||||||
|
|
||||||
|
Start Zsh manually:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
zsh
|
||||||
|
```
|
||||||
Loading…
Reference in a new issue