Skip to content

Instantly share code, notes, and snippets.

@jabas06
Last active February 3, 2024 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabas06/0cec2111be39f084383ce91b93cf9202 to your computer and use it in GitHub Desktop.
Save jabas06/0cec2111be39f084383ce91b93cf9202 to your computer and use it in GitHub Desktop.
My zsh setup (macOS)

Display hidden files on Finder

defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder

Command dev tools

xcode-select --install

iTerm2

brew install --cask iterm2

zsh (not needed on recent versions of macOS)

brew install zsh

Oh My Zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Oh My Zsh - Plugins

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
    ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions \
    ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Powerlevel10k Theme for ZSH

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Fuzzy Finder

brew install fzf

# To install useful key bindings and fuzzy completion (type [y] for all questions):
$(brew --prefix)/opt/fzf/install --all

Edit .zshrc

sed -i '' 's/ZSH_THEME=.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc
sed -i '' 's/\(^plugins=([^)]*\)/\1 git nvm zsh-autosuggestions zsh-syntax-highlighting/' ~/.zshrc

Open iTerm

Initial p10k theme configuration

  • If Powerlevel10k configuration wizard is not strated automatically, run:
p10k configure
  • Answer propmts

  • Select Lean color style

  • Select Unicode character set

  • Select 256 colors

  • Edit terminal prompt elements in .p10k.zsh

POWERLEVEL9K_LEFT_PROMPT_ELEMENTS: Append context # user@hostname

POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS: Comment context element line

Restart iTerm

iTerm configuration

Theme

Enhanced scrolling

  • Go iTerm2 > Preferences > Advanced
  • Turn on: Mouse > Scroll wheel sends arrow keys in alternate screen mode.

Enable natural text editing

This will allow to jump between words and start/end of lines with keys opt + (left/right)-arrow and cmd + (left/right)-arrow accordingly.

  • Go iTerm2 > Preferences > Profiles > Keys > Key Mappings
  • Select Presets... > Natural Text Editing
  • Select Keep

VSCode settings

"terminal.integrated.fontFamily": "Hack Nerd Font"
---------------------
"terminal.integrated.fontFamily": "MesloLGS NF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment