LoginSignup
1
0

More than 1 year has passed since last update.

PowershellでGitを使う

Last updated at Posted at 2022-11-20

Oh My Posh

Oh My Poshのインストール

  1. wingetでインストールする
    winget install JanDeDobbeleer.OhMyPosh -s winget
    
  2. ターミナルを再起動する

フォントのインストール

  1. ターミナルを 管理者権限 で起動する
  2. フォントをインストールする
    oh-my-posh font install
    
  3. ターミナルを再起動する

フォントの設定

Windows Termainal

  1. [設定(Ctrl+,)]→[JSON ファイルを開く]
    もしくは
    Json ファイルを開く(Ctrl+Shift+,)
  2. フォントを設定する
    {
        "profiles":
        {
            "defaults":
            {
                "font":
                {
                    "face": "MesloLGM NF",
                    "size": 10
                }
            }
        }
    }
    

VS Code

  1. [設定(Ctrl+,)]→[Terminal > Integrated: Font Family(terminal.integrated.fontFamily)]
  2. フォントを設定する
    "MesloLGM NF"

プロファイルにOh My Poshを追加

  1. プロファイルを開く
    notepad $PROFILE
    
  2. oh-my-poshの設定を追記する
    oh-my-posh init pwsh | Invoke-Expression
    
  3. プロファイルを再読み込みする
    . $PROFILE
    

カスタマイズ(オプション)

テーマ

  1. テーマを確認する
    Get-PoshThemes
    
  2. テーマファイル名を確認する
    %LOCALAPPDATA%\Programs\oh-my-posh\themes
    $env:LOCALAPPDATA\Programs\oh-my-posh\themes
    
  3. プロファイルの設定を変更する
    $ThemePath = $env:LOCALAPPDATA + '\Programs\oh-my-posh\themes\powerlevel10k_rainbow.omp.json'
    oh-my-posh init pwsh --config $ThemePath | Invoke-Expression
    

Posh-Git

Posh-Gitのインストール

```powershell
Install-Module posh-git -Scope CurrentUser -Force
```

プロファイルにPosh-Gitを追加

  1. プロファイルを開く
    notepad $PROFILE
    
  2. oh-my-poshの設定を追記する
    Import-Module posh-git
    
  3. プロファイルを再読み込みする
    . $PROFILE
    
1
0
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
1
0