daton's mac
  • Introduction
  • Hackintosh
    • Requirements
    • Prepare USB Drive
    • Install OSX
    • Post installation
    • WiFi and Bluetooth PCI device
    • System Updates
    • Keyboard Mapping
    • Troubleshooting
  • Windows with WSL
    • Setup for Node.js
    • LinuxBrew
    • Powershell
    • WSL bash and zsh
  • Xcode
  • Homebrew
  • iTerm2
    • Plugins
  • Gifox
  • Node.js
    • Webpack
  • VS Code
  • SSH
  • Git
  • GitKraken
  • Docker
    • Remove Docker things
    • Env vars
    • Frequently used commands
  • Docker on Windows
  • MongoDB
  • Postgres
  • Sentry
  • Redis
  • Ghostscript and Imagemagick
  • Codeanywhere
  • Terraform
  • Kubernetes
    • Helm
    • Docker Desktop for Mac
    • Kubernetes on DigitalOcean
    • K8S with Traefik as IC
    • Kubernetes managed by StackPointCloud
    • Use Docker Images from Private Registry
    • Use a minikube locally
  • Web Apps
  • IoT
  • NVIDIA
Powered by GitBook
On this page
  • zsh-autosuggestions
  • Installing with Oh My Zsh
  • Syntax highlighting
  • Installing with Oh My Zsh
  • Enable natural text selection
  • How to Customize Your Command Prompt
  • List of useful plugin for development
  • NVM auto switch node version
  • Android env variables
  • Others: ruby rvn and NPM_TOKEN
  1. iTerm2

Plugins

PreviousiTerm2NextGifox

Last updated 6 years ago

Now is time to setup some useful plugins for iTerm.

zsh-autosuggestions

-like fast/unobtrusive autosuggestions for zsh.

It suggests commands as you type, based on command history. This is my favourite plugin, it will save you a lot of time spent in typing commands in our terminal.

Installing with Oh My Zsh

  1. Clone repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

    git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  2. Add the plugin to the list of plugins for Oh My Zsh to load (open ~/.zshrc):

    plugins=(zsh-autosuggestions)
  3. Start a new terminal session.

Syntax highlighting

This package provides syntax highlighting for the shell zsh. It enables highlighting of commands whilst they are typed at a zsh prompt into an interactive terminal. This helps in reviewing commands before running them, particularly in catching syntax errors.

Installing with Oh My Zsh

  1. Clone this repository in oh-my-zsh's plugins directory:

     git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
  2. Activate the plugin in ~/.zshrc:

     plugins=( [plugins...] zsh-syntax-highlighting)
  3. Source ~/.zshrc to take changes into account:

     source ~/.zshrc

Enable natural text selection

By default, word jumps (option + → or option + ←) and word deletions (option + backspace) do not work.

To enable these, go to "iTerm => Preferences => Profiles => Keys => Load Preset... => Natural Text Editing"

How to Customize Your Command Prompt

List of useful plugin for development

# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
  git
  git-flow
  colored-man-pages
  colorize
  github
  jira
  node
  nvm
  nvm-auto
  vagrant
  virtualenv
  pip
  python
  brew
  osx
  zsh-autosuggestions
  zsh-nvm
  zsh-syntax-highlighting
)

NVM auto switch node version

export NVM_DIR="/Users/tony/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

nvm_auto_switch
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"

Android env variables

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator

Others: ruby rvn and NPM_TOKEN

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export PATH="/usr/local/opt/mariadb@10.2/bin:$PATH"

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export NPM_TOKEN="YOUR NPM TOKEN"

For other types of installation go .

For further customisation of your prompt, you can follow a great guide here:

here
https://code.tutsplus.com/tutorials/how-to-customize-your-command-prompt--net-24083
Fish
this