LoginSignup
0
2

More than 1 year has passed since last update.

2022Windows環境構築メモ

Last updated at Posted at 2022-07-19

2022Windows環境構築メモ

これはなに?

windowsマシンで、自分が最低限やっておきたい開発環境構築メモ
会社のネットワーク下や会社支給端末では認証プロキシ等で躓くケースがあり、金輪際同じ戸惑いをしたくないのでメモにした

具体的には下記のセットアップをする

  • WSL2
  • hyper
  • zsh
  • VSCode
  • Docker

やること

WSL2

WSL2を下記制約の元でインストールしたい

  • Windows Storeが使えない

ダウンロードしてインストールする

AppxBundel実行してエラーになる場合は下記対応をする

  1. AppxBundleをzip展開(AppxBundleはzip形式なので展開できる)
  2. 適切なアーキテクチャの.appxもzip展開
  3. 展開した中に含まれるexe実行

インストール終わったらWSL2にしておく
wsl --set-version Ubuntu 2

%USERPROFILE%\.wslconfigにこれを書く

[wsl2]
memory=3GB
processors=2

hyper

shellのパスはこれを指定する

{
        shell: `C:\\Windows\\System32\\wsl.exe`,
        shellArgs: ['~'],
}

zsh

preztoが便利なのでこれ使う

認証プロキシ対策で.zshprofileにこれかいとく

export PROXY_ENDPOINT='http://ユーザID:パスワード@ホスト:ポート'
export HTTP_PROXY=$PROXY_ENDPOINT
export HTTPS_PROXY=$PROXY_ENDPOINT
export http_proxy=$PROXY_ENDPOINT
export https_proxy=$PROXY_ENDPOINT
export no_proxy=localhost

vimとgitめちゃ使うのでaliasほしい、.zshrcにこれかいとく

alias v=vim
alias g=git

.wgetrcにこれかいとく

check-certificate = off

プロキシ環境下など仕方ないときはこれしないとVSCodeの拡張が内部で呼んでるwgetでエラー出して困る

VSCode

インストールする

拡張は

  • wsl
  • vim

を入れる

setting.jsonを書く

{
    "workbench.colorTheme": "Default Dark+",
    "window.zoomLevel": 2,
    "http.proxy": "見せられないよ!",
    "http.proxyStrictSSL": false,
    "editor.minimap.enabled": false,

    "vim.useSystemClipboard": true,
    "vim.insertModeKeyBindings": [
        {
            "before": ["j", "j"],
            "after": ["<Esc>"]
        }
    ],
    "vim.hlsearch": true
}

keybindings.jsonも書く

[
    {
        "key": "ctrl+p",
        "command": "cursorUp",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+n",
        "command": "cursorDown",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+f",
        "command": "cursorRight",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+b",
        "command": "cursorLeft",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+a",
        "command": "cursorHome",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+e",
        "command": "cursorEnd",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+d",
        "command": "deleteRight",
        "when": "terminalFocus"
    },
]

参考にしたもの:

Docker

Docker Desktop for Windowsは(ライセンス的に)使いづらいのでWSL2に入れる

これに書いてある通りにする

認証プロキシ下では/etc/default/dockerに追記する

export PROXY_ENDPOINT=''
export HTTP_PROXY=$PROXY_ENDPOINT
export HTTPS_PROXY=$PROXY_ENDPOINT
export http_proxy=$PROXY_ENDPOINT
export https_proxy=$PROXY_ENDPOINT
export no_proxy=localhost

以上で最低限の環境が出来上がり

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2