Skip to content

Instantly share code, notes, and snippets.

@ckdanny
Last active May 18, 2024 04:23
Show Gist options
  • Save ckdanny/e0c0eb48430839c380980e83f2150ba6 to your computer and use it in GitHub Desktop.
Save ckdanny/e0c0eb48430839c380980e83f2150ba6 to your computer and use it in GitHub Desktop.
zsh configuration

Zsh

iterm2 theme: https://github.com/sindresorhus/iterm2-snazzy?tab=readme-ov-file

brew install zsh
# Set zsh as default shell
sudo sh -c "echo $(which zsh) >> /etc/shells" && chsh -s $(which zsh)

Install the Font for development

# https://github.com/tonsky/FiraCode/wiki/Installing
brew tap homebrew/cask-fonts
brew install --cask font-fira-code

brew tap homebrew/cask-fonts
brew install font-hack-nerd-font

❗ Remember to update the font setting in iTerm2 and VScode terminal

# Remember to setup the font to use Fira
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

vi ~/.zshrc

Zsh theme: https://github.com/romkatv/powerlevel10k?tab=readme-ov-file#oh-my-zsh

ZSH_THEME="powerlevel10k/powerlevel10k"
RICH_THEME="monokai"

Remember to include the content of ~/.bash_profile

To configure auto suggestion:

cd $ZSH_CUSTOM/plugins
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
echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc
code ~/.zshrc


plugins=(
    git
    # other plugins...
    zsh-autosuggestions
)


```

For mac,

```sh
$ xcode-select --install
$ brew install rich
# command
$ rich -n -g -a heavy -d 3 ansible.cfg --pager
```


---

Also, configure the vim setting: `~/.vimrc`

```

set tabstop=4
set shiftwidth=4
set expandtab
set nu
set ai
syntax on

```

---

Pyenv configuration

```

# Python

export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"
# To enable auto-activation add to your profile:
# if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi

VScode configuration

  1. Download font from https://github.com/lxbrtsch/Menlo-for-Powerline/blob/master/Menlo%20for%20Powerline.ttf
  2. mv /Users//Library/Fonts/
  3. Update the configuration in VSCode
{
  "terminal.integrated.fontFamily": "Hack Nerd Font",
  "terminal.external.osxExec": "iTerm.app",
  "terminal.integrated.lineHeight": 1.1,
  // "terminal.integrated.fontFamily": "Menlo for Powerline",
  "terminal.integrated.profiles.osx": {
    "zsh": {
      "path": "zsh",
      "args": ["-l"]
    },
    "bash": {
      "path": "bash",
      "args": ["-l"],
      "icon": "terminal-bash"
    },
    "fish": {
      "path": "fish",
      "args": ["-l"]
    },
    "tmux": {
      "path": "tmux",
      "icon": "terminal-tmux"
    },
    "pwsh": {
      "path": "pwsh",
      "icon": "terminal-powershell"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment