2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Mac設定メモ

Last updated at Posted at 2021-04-10

はじめに

・一般的な設定は他人の記事を参考にする
・上記以外で特に重要だと思うことを書く
・これはMac初心者の私の備忘録
・よい方法があれば教えてください

一般的な設定

この記事を参考にした

Mac を買ったら必ずやっておきたい初期設定

隠しフォルダ表示

# 隠しフォルダを表示するコマンド
defaults write com.apple.finder AppleShowAllFiles TRUE

# Finderを再起動
killall Finder

システム設定

CapsLockをOFF

システム環境設定 > キーボード > 装飾

  • CapsLock: アクションなし

Karabinerでバインドを変更する

ここでキーバインドを参考にしたりする
https://ke-complex-modifications.pqrs.org/

ここで項目の設定方法を参考にする

バインドを適用する対象のデバイス

  • KarabinerDeviceからデバイスを選択できる
  • マウスとキーボードのTypeが一致していることを確認する
    • デバイスがマウスなのに、TypeがキーボードだとButtonのバインドができないので注意

ソースの切り替え

  • karabinerでcapslockをcontrolに割り当てる
  • 小指と親指で切り替えが楽

control + space

 キーボード、マウスのキーコードを取得

Karabiner EventViewerで任意のキーやボタンのコードを取得できる

愛用のキーボードバインディング

  • キーボード: Mistel BAROCCO MD770
  • 裏のスイッチがすべてOFFの状態でバインドを設定する
    • Windowsもつかうのでいじると面倒になるので

設定例

left_option -> left_command
left_command -> left_option
right_option -> right_command
caps_lock -> left_control

optionとcommandを入れ替え、CapsLockをControlにする
{
  "title": "MD770 keybord bind for Mac",
  "rules": [
    {
      "description": "cmd<->option caplock->control",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "left_command"
          },
          "to": [
            {
              "key_code": "left_option"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "left_option"
          },
          "to": [
            {
              "key_code": "left_command"
            }
          ]
        },
        {
          "type": "basic",
          "from": {
            "key_code": "caps_lock"
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ]
        }
      ]
    }
  ]
}

バインドの有効範囲

任意のアプリ

アプリをアクティブにしてからKarabiner Eventviewer の FrontMost applicationタブからアプリのidをみれる

Finder内のみ有効にするとき
"conditions": [
            {
              "bundle_identifiers": ["^com\\.apple\\.finder$"],
              "type": "frontmost_application_if"
            }
]

control + hjkl でカーソル移動するバインド

{
  "title": "Left ctrl + hjkl to Arrow Keys Vim",
  "rules": [
    {
      "description": "Left ctrl + hjkl toarrow keys Vim",
      "manipulators": [
        {
          "from": {
            "key_code": "h",
            "modifiers": {
              "mandatory": ["left_control"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "j",
            "modifiers": {
              "mandatory": ["left_control"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "k",
            "modifiers": {
              "mandatory": ["left_control"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "l",
            "modifiers": {
              "mandatory": ["left_control"],
              "optional": ["any"]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            }
          ],
          "type": "basic"
        }
      ]
    }
  ]
}

例外アプリを指定

バインドを適用したくないアプリを指定する

frontmost_application_unlessconditionstypeに記述する

           "conditions": [
                        {
                            "type": "frontmost_application_unless",
                            "bundle_identifiers": [
                                "^com\\.googlecode\\.iterm2"
                            ]
                        }
                    ]

iTerm2

ターミナルをインストール

起動ショートカットを設定

Preferences > keys > Hotkye > create hot key

  • double tap > control

Preferences > General > Window restration policy

ウィンドウの起動の仕方

  • Only Restore Hotkey Window
    • 起動ショートカットするたびにウィンドウが生成されない設定

ウィンドウの透明度

Preferences > Profiles > Window > Windows Apprearance

  • Trancparancy : 3~4割

TextMete

軽量エディタをインストールする

VSCode

Vimの長押し移動ができない問題の対処

defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false # For VS Code
defaults write com.microsoft.VSCodeInsiders ApplePressAndHoldEnabled -bool false # For VS Code Insider

ワークペースのPythonバージョンを固定

ワークスペース名/.vscode/settings.json
{
  "python.pythonPath": "/opt/homebrew/bin/python3" 
}

M1でWine

ビルド済みのWineをgitクローンして、
https://github.com/Gcenx/homebrew-wine

wintrickから日本語を入れる

brew install wget
wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
chmod +x winetricks
./winetricks fonts fakejapanese

Wineアプリショートカット作成

Automator > 新規 > アプリケーション > 左のサイドバー > シェルスクリプトを実行

  • 実行するシェルの種類を選んで、シェルを記述する
  • ファイル > 保存

システム環境設定 > プライバシーとセキュリティー > アクセシビリティ

  • 作成したアプリを追加する

Finder > 作成したアプリ > 右クリック > 情報

  • アイコンに任意の画像をドロップ&ドラッグしてアイコンを変更する
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?