Windows 環境建置

Windows 環境建置的細節紀錄

-6 min read

1. 安裝基本軟體

軟體説明備註
NVM切換 NodeJS 版本用選取 nvm-setup.zip 下載安裝包後進行安裝
YarnNodeJS 套件相依管理工具

2. 初始化 bash

2-1. Cygwin

  • 安裝中途選項
    • Install from Internet (如果不行 可以先 download 然後再 Install from Local)
    • Direct Connection 如果一直跳掉就選擇 自訂 proxy
    • Source 選 ftp://ftp.yzu.edu.tw / port 21
    • 選版本 → 勾選
  • 可安裝的套件
    項目說明備註
    git
    vim編輯器
    zshshell
    fzf-zsh模糊比對搜尋
    makeMakefile 的執行cli
  • mintty
    • 虛擬終端機
    • 切記是開一般的 terminal 執行以下
    • C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -

2-2. 安裝字體

  1. 先到 https://github.com/powerline/fonts
  2. 按 Download Zip 下載到本機解壓縮
  3. 用 win鍵 + X 進到 Powershell (管理員身分開啟)
  4. 開啟 fonts-master 資料夾
$ cd ${HOME}\\Downloads\\fonts-master\\fonts-master
  1. 執行 .\\install.ps1 安裝字體
  2. 設定參數
Set-ExecutionPolicy Default   // 暫時關閉防護
Set-ExecutionPolicy Restricted // 防護開回來
  1. 選取下載字體
    • 12pt Sauce Code Pro Nerd Font Complete
  2. 安裝字體
    • 左邊:開啟 C:\Windows\Fonts
    • 右邊:nerd-fonts 資料夾
    • 從右邊拖曳字型進左邊即可

2-3. 安裝 apt-cyg

教學: 安裝 apt-cyg

$ wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg -O /usr/local/bin/apt-cyg
$ chmod +x /usr/local/bin/apt-cyg

2-4. 專案換行變成 CRLF

教學:設定eslintrc.js

  • 調整 eslintrc.js
      rules: {
        'linebreak-style': ['error', 'unix'],  // changes the file to LF
      }
    
  • eol 改成 \\n

3. 設定 dotvim

4. 設定 VSCode 附加元件

.vscode/extensions.json

{
  "recommendations": [
    "dsznajder.es7-react-js-snippets",
    "gamunu.vscode-yarn",
    "jasonnutter.search-node-modules",
    "mrmlnc.vscode-scss",
    "syler.sass-indented",
    "christian-kohler.npm-intellisense",
    "xabikos.javascriptsnippets",
    "zignd.html-css-class-completion",
    "esbenp.prettier-vscode",
    "dbaeumer.vscode-eslint",
    "eamodio.gitlens",
    "kisstkondoros.vscode-codemetrics",
    "quicktype.quicktype",
    "streetsidesoftware.code-spell-checker",
    "editorconfig.editorconfig",
    "usernamehw.errorlens",
    "aaron-bond.better-comments",
    "formulahendry.auto-close-tag",
    "formulahendry.auto-rename-tag",
    "yzhang.markdown-all-in-one",
    "chakrounanas.turbo-console-log",
    "planbcoding.vscode-react-refactor",
  ]
}