Homebrew- Mac essential software management artifact

Brew Install softwareName can be used to install basic software on the market. For example: git, Google-chrmoe…

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy the code

ITerm2 + oh-my-zsh – Terminal command line tool

Again, install ITerm2 via Brew

# ITerm2
$ brew install homebrew/cask/iterm2
Copy the code

Once installed, let’s configure the terminal command line tool to make it cool.

1. iTerm2 -> Make iTerm2 Default Term

⌘ to +. 2. Open preference, click Keys, check the Hotkey Show/hide iTerm2 with a system-wide Hotkey, set the Hotkey to ⌘+. So that you can ⌘+. Global hotkeys to open or close the iTerm2 window, very handy

3. Color scheme, select Solarized, download and decompress, then open preference under iTerm2, click the Colors option under Profiles, click the Color Presets option in the lower right corner, and select Import. Import solarized Dark. Itermcolors from the extracted solarized file

4. Oh – my – ZSH installation

#  oh-my-zsh
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
Copy the code

5. Configure the theme

ZSHRC ZSH_THEME=”agnoster” to change the ZSH theme to “agnoster”. 2. Use a special font to support the “agnoster” theme. Using the Meslo font, ITerm2 -> Profiles -> Preferences -> Text -> Change Font) Reopen the iTerm2 window (or open a new iTerm2 window) to see the font effect

The PowerLevel9k theme is recommended

“Shades of purple-iterm2” theme used for some time, very comfortable, the corresponding also provides a lot of software with the same color, here recommended to everyone 👊

$ git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
Copy the code

Then edit your ~ /. ZSHRC, set the theme ZSH_THEME = “powerlevel9k/powerlevel9k”

6. Automatic prompt and command completion

1. Clone the repository to the ~/. Oh-my-zsh /custom/plugins directory

$ git clone https://github.com/zsh-users/zsh-autosuggestions  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Copy the code

Use vim to edit the.zshrc file and find the plugins=(git) setup command. The default is plugins=(git).

PS: When you open the terminal again, you may not see the change, maybe your font color is too light, let’s make it lighter:

  • cd ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
  • withvimThe editorzsh-autosuggestions.zshFile, modifyZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=10'

7. Syntax highlighting

$ brew install zsh-syntax-highlighting
Copy the code

Add the following paragraph to the end of the.zshrc file:

source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
Copy the code

Then, load the.zshrc configuration

$ source ~/.zshrc
Copy the code
  1. I’m going to use thetaPowerlevel9k theme, so my first line prompt is modified like this, in.zshrcAdd the following line to the end of the file:
# Powerlevel9k Theme config
POWERLEVEL9K_CONTEXT_TEMPLATE="%n"
Copy the code

Or, for all themes, configure it in a.zshrc file:

  ZSH_THEME="powerlevel9k/powerlevel9k"
# Hide user name (user@hostname)
  DEFAULT_USER=`id -un`
# font with icon, if your font has icon
POWERLEVEL9K_MODE='nerdfont-complete'
# command line left prompt content (folder path, folder read/write status, version control information)
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir dir_writable vcs) # <= left prompt set "dir"
# command line right prompt content (status, time)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time)
Copy the code

Detailed configuration

Finally display results:

Visual Studio Code terminal configuration

Font:

  • for Source Code Pro: “terminal.integrated.fontFamily”: “Source Code Pro for Powerline”
  • for Meslo: “terminal.integrated.fontFamily”: “Meslo LG M for Powerline”
  • the fontsize e.g.: “terminal.integrated.fontSize”: 14

Recommended textbook 1 English Recommended textbook 2 Chinese

The theme color

  • iterm2-material-design

Recommend theme colors

  • shades-of-purple-iterm2

NVM – Node Version Manager

The curl - o - https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bashCopy the code

If NVM does not find this command after restarting the terminal, add the following source line to your configuration file (~ /.bash_profile, ~ /.zshrc, ~ /.profile, or ~ /.bashrc)

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
Copy the code

Install the Node

# install
$ nvm install 8
# use
$ nvm use default

$ node -v

$ npm -v
Copy the code

NRM — NPM registry manager

Global installation # $NPM install - g NRM # check the NPM source list $NRM ls # # source $NRM use taobao taobao see if NPM source change $NPM config the getCopy the code