This page looks best with JavaScript enabled

Terminal & Shell Setup (st & zsh)

 ·   ·  โ˜• 2 min read · ๐Ÿ‘€... views

My terminal emulator is st (simple terminal) from LukeSmith1, and my shell is zsh (with ohmyzsh2).

Dependencies

  • dmenu
  • fzf3
  • pywal4

ohmyzsh

1
2
# . start-proxy 1081 socks5h
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Then config or restore5 your ~/.zshrc file.

1
dotfiles checkout ~/.zshrc

colors and themes

p10k

I use powerlevel10k6 as my zsh theme.

  1. clone the repository:
    1
    2
    3
    
    git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    # for chinese users, recommend:
    # git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
    
  2. set ZSH_THEME="powerlevel10k/powerlevel10k" in ~/.zshrc.
  3. configure with p10k

Xresources and pywal

you can define your color scheme in ~/.Xresources file, and load it with xrdb ~/.Xresources.

Or you can let pywal generates and sets a colorscheme for you:

1
2
3
4
5
6
7
8
9
#!/bin/sh

# We grab the wallpaper location from wal's cache so
# that this works even when a directory is passed.
image_path="${1:-"$(< "${HOME}/.cache/wal/wal")"}"

# -n tells =wal= to skip setting the wallpaper.
wal -n -i "$image_path"
feh --no-fehbg --bg-fill "$image_path"

This is a script7 to set my wallpaper and color scheme from an image: wal-feh wallpaper.png.

And I put exec --no-startup-id ~/bin/wal-feh in my ~/.config/i3/config to autostart it.

fzf

Install fzf, then put this in your ~/.zshrc:

1
2
source /usr/share/fzf/key-bindings.zsh
source /usr/share/fzf/completion.zsh

zsh-autosuggestions

Fish-like fast/unobtrusive autosuggestions for zsh.

  1. clone the repository:

    1
    
    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
    
  2. add the plugin to the plugins list inside the ~/.zshrc file.

    1
    2
    3
    4
    
    plugins=(
        # other plugins...
        zsh-autosuggestions
    )
    

keybindings

  • alt-l: follow urls
  • alt-y: copy urls
  • alt-o: copy output of a command
  • alt-j/k/d/u: scroll down/up/faster-down/faster-up
  • alt-c/v: copy/paste
  • Ctrl+t: list files+folders in current directory (e.g., type git add, press Ctrl+t, select a few files using Tab, finally Enter)
  • Ctrl+r: search history commands
  • ESC+c: fuzzy change directory

  1. st from Luke Smith ↩︎

  2. Oh My Zsh is a delightful, open source, community-driven framework for managing your Zsh configuration ↩︎

  3. fzf is a general-purpose command-line fuzzy finder ↩︎

  4. Pywal is a tool that generates a color palette from the dominant colors in an image. ↩︎

  5. use a bare git repository stow to manage my dotfiles↩︎

  6. Powerlevel10k is a theme for Zsh. It emphasizes speed, flexibility and out-of-the-box experience. ↩︎

  7. my wal-feh script to set wallpaper and color scheme ↩︎

Share on