macOS oh-my-zsh下安裝zsh-autosuggestion和nvm

1. 首先安裝oh-my-zsh

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

2. 安裝zsh-autosuggestions

zsh-autosuggestions是一個命令自動補全插件git

2.1 下載插件

$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions

2.2 配置

編輯~/.zshrc文件github

#打開要編輯的文件
vi ~/.zshrc
# 按i進入--INSERT--編輯模式
# 找到plugins=(git),添加以下內容,插件之間用空格隔空
plugins=(git zsh-autosuggestions)

保存退出
ESC 回到正常模式
:wq保存並退出vimvim

2.3 重啓

方法一:經過關閉終端窗口從新打開的方式更新配置
方法二:經過命令source ./zshrcbash

3. 安裝nvm

由於macOS直接安裝nvm笨重而繁瑣,homebrew安裝的nvm又不能用,curl安裝不只須要Xcode Command支持還須要配.bash_profile還有官網所提示的一系列問題
image.pngcurl

所以使用最簡單的安裝方式,經過安裝zsh的插件zsh-nvm。雖說叫插件可是使用起來是和nvm同樣的。url

3.1 下載插件

$ git clone git://github.com/lukechilds/zsh-nvm.git $ZSH_CUSTOM/plugins/zsh-nvm

3.2 配置

編輯~/.zshrc文件spa

#打開要編輯的文件
vi ~/.zshrc
# 按i進入--INSERT--編輯模式
# 找到plugins=(git),添加以下內容,插件之間用空格隔空
plugins=(git zsh-autosuggestions zsh-nvm)

保存退出
ESC 回到正常模式
:wq保存並退出vim插件

3.3 重啓

方法一:經過關閉終端窗口從新打開的方式更新配置
方法二:經過命令source ./zshrccode

執行source ./zshrc後,會自動下載nvm最新版本blog

$ source ~/.zshrc 
Installing nvm...
Cloning into '~/.nvm'...
remote: Enumerating objects: 16, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (12/12), done.
Receiving objects:   3% (229/7614), 140.01 KiB | 247.00 KiB/sReceiving objects:   4% (305/7614), 140.01 KiB | 247.00 KiB/sReceiving objects:   5% (381/7614), 140.01 KiB | 247.00 KiB/sReceiving objects:   6% (457/7614), 140.01 KiB | 247.00 KiB/sReceiving objects:   6% (488/7614), 140.01 KiB | 247.00 KiB/sReceiving objects:   7% (533/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:   8% (610/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:   9% (686/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:  10% (762/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:  11% (838/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:  12% (914/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:  13% (990/7614), 348.01 KiB | 327.00 KiB/sReceiving objects:  14% (1066/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  15% (1143/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  16% (1219/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  17% (1295/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  18% (1371/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  19% (1447/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  20% (1523/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  21% (1599/7614), 348.01 KiB | 327.00 KiB/Receiving objects:  22% (1676/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  23% (1752/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  24% (1828/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  25% (1904/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  26% (1980/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  27% (2056/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  28% (2132/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  29% (2209/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  30% (2285/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  31% (2361/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  32% (2437/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  33% (2513/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  33% (2584/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  34% (2589/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  35% (2665/7614), 612.01 KiB | 378.00 KiB/Receiving objects:  36% (2742/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  37% (2818/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  38% (2894/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  39% (2970/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  40% (3046/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  41% (3122/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  42% (3198/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  43% (3275/7614), 956.01 KiB | 449.00 KiB/Receiving objects:  44% (3351/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  45% (3427/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  46% (3503/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  47% (3579/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  48% (3655/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  49% (3731/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  50% (3807/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  51% (3884/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  52% (3960/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  53% (4036/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  53% (4071/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  54% (4112/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  55% (4188/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  56% (4264/7614), 1.25 MiB | 484.00 KiB/s Receiving objects:  57% (4340/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  58% (4417/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  59% (4493/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  60% (4569/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  61% (4645/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  62% (4721/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  63% (4797/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  64% (4873/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  65% (4950/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  66% (5026/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  67% (5102/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  68% (5178/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  69% (5254/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  70% (5330/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  71% (5406/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  72% (5483/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  73% (5559/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  74% (5635/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  75% (5711/7614), 1.71 MiB | 556.00 KiB/s Receiving objects:  76% (5787/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  77% (5863/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  78% (5939/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  79% (6016/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  80% (6092/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  81% (6168/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  82% (6244/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  83% (6320/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  84% (6396/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  85% (6472/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  86% (6549/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  87% (6625/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  88% (6701/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  89% (6777/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  90% (6853/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  91% (6929/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  92% (7005/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  93% (7082/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  94% (7158/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  95% (7234/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  96% (7310/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  97% (7386/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  98% (7462/7614), 2.17 MiB | 603.00 KiB/s Receiving objects:  99% (7538/7614), 2.17 MiB | 603.00 KiB/s remote: Total 7614 (delta 6), reused 13 (delta 4), pack-reused 7598
Receiving objects:  99% (7605/7614), 2.17 MiB | 603.00 KiB/s Receiving objects: 100% (7614/7614), 2.17 MiB | 603.00 KiB/s Receiving objects: 100% (7614/7614), 2.57 MiB | 655.00 KiB/s, done.
Resolving deltas: 100% (4812/4812), done.
相關文章
相關標籤/搜索