tomy_125: Note

tomy_125 の個人的なメモ

Mac Book Air の設定メモ

今後の買換えた時などのためにメモしておきたい。

目次

隠しファイルの表示

$ defaults write com.apple.finder AppleShowAllFiles TRUE
## 確認
$ defaults read com.apple.finder AppleShowAllFiles
TRUE

Macで隠しファイルを表示する方法 - Qiita

terminal 環境変数ファイル

~ % ls -lda .z*
-rw-r--r--   1 hiroshi  staff    45  1 20 23:16 .zprofile
-rw-------   1 hiroshi  staff  2433  1 22 01:20 .zsh_history
drwx------  28 hiroshi  staff   896  1 22 01:24 .zsh_sessions
-rw-r--r--   1 hiroshi  staff    36  1 20 22:27 .zshrc
  • .zprofile
if [ -f ~/.zshrc ]; then
    . ~/.zshrc
fi
  • .zshrc
alias ll="ls -l"
alias rm="rm -i"

MacOS Catalinaはデフォルトのログインシェルがbashではないらしい。

hosts の設定

Linuxでいうところの/etc/hosts の編集に相当することは以下で実施できる様です。

sudo vi /private/etc/hosts

terminalのログ取得設定

script ~/99_terminallog/terminal_`openssl rand -hex 2`_`date +%Y_%m_%d_%H%M%S`.log

f:id:tomy_125:20220124171859p:plain

Homebrew

macOS(またはLinux)用パッケージマネージャー — Homebrew

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
...
...
...
==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/hiroshi/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"
- Run brew help to get started
- Further documentation:
    https://docs.brew.sh
hiroshi@hiroshinoMacBook-Air ~ %  echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/hiroshi/.zprofile
hiroshi@hiroshinoMacBook-Air ~ % cat ~/.zprofile 

if [ -f ~/.zshrc ]; then
    . ~/.zshrc
fi

eval "$(/opt/homebrew/bin/brew shellenv)"
hiroshi@hiroshinoMacBook-Air ~ % eval "$(/opt/homebrew/bin/brew shellenv)"
hiroshi@hiroshinoMacBook-Air ~ % 
hiroshi@hiroshinoMacBook-Air ~ % which brew
/opt/homebrew/bin/brew

visual-studio-code

hiroshi@hiroshinoMacBook-Air ~ % brew search visual-studio-code
==> Casks
homebrew/cask-versions/visual-studio-code-insiders
hiroshi@hiroshinoMacBook-Air ~ % brew install visual-studio-code --cask
==> Tapping homebrew/cask
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'...
remote: Enumerating objects: 618333, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 618333 (delta 6), reused 11 (delta 2), pack-reused 618317
Receiving objects: 100% (618333/618333), 282.63 MiB | 10.49 MiB/s, done.
Resolving deltas: 100% (437277/437277), done.
Tapped 3957 casks (4,028 files, 302.4MB).
==> Downloading https://update.code.visualstudio.com/1.63.2/darwin-arm64/stable
==> Downloading from https://az764295.vo.msecnd.net/stable/899d46d82c4c95423fb7e10e68eba52050e30ba3/VSCode-darwin-arm64.
######################################################################## 100.0%
==> Installing Cask visual-studio-code
==> Moving App 'Visual Studio Code.app' to '/Applications/Visual Studio Code.app'
==> Linking Binary 'code' to '/opt/homebrew/bin/code'
🍺  visual-studio-code was successfully installed!

vimエミュレーター

VSCode Neovim - Visual Studio Marketplace

brew install neovim

vimのキー移動で長押しの有効化

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false

f:id:tomy_125:20220124213954p:plain

VSCodeでキーボードの長押しができなくなったときの対処方法 | book-reviews.blog

Docker上の開発環境

これをやりたい。

M1 Mac で Python環境 (Docker + VSCode編)

DockerをHomebrewでMac OSに導入する方法 - Qiita

brew install --cask docker