0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

zoxide をWindowsのPowerShellに入れる

0
Last updated at Posted at 2025-12-04

zoxide を使うと、過去に訪れたディレクトリへ曖昧検索爆速ジャンプできるようになるらしいです!

Windows (PowerShell) 環境への導入手順をまとめました。

手順

1. インストール

wingetを使用してインストールします。
PowerShellで以下のコマンドを実行してください。

winget install ajeetdsouza.zoxide

※インストール後、ターミナルの再起動が必要な場合があります。

2. プロファイルの編集

インストールしただけでは使えません。
PowerShell 起動時に zoxide を有効化するための設定が必要です。

Microsoft.PowerShell_profile.ps1を開きます。
以下のコマンドで開くこともできます。

VSCodeで開く
code $PROFILE
メモ帳で開く
notepad $PROFILE

ファイルを開いたら、末尾に以下のコマンドを追記して保存します。

Microsoft.PowerShell_profile.ps1
Invoke-Expression (& { (zoxide init powershell | Out-String) })
エラー「このシステムではスクリプトの実行が無効に...」が出る場合

以下のコマンドを実行して、ローカルのスクリプト実行を許可してください。

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.ps1ファイルが見つからない場合

$PROFILE のパスは一般的には以下に作成されます。

C:\Users\[ユーザー名]\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

# OneDriveを使用している場合
C:\Users\[ユーザー名]\OneDrive\ドキュメント\PowerShell\Microsoft.PowerShell_profile.ps1

# Windows PowerShell 5.1
C:\Users\[ユーザー名]\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1

code $PROFILE 等でファイルが見つからないと言われた場合は、ディレクトリ自体が存在していません。
以下のコマンドを実行してファイルを作成してください。

if (!(Test-Path $PROFILE)) {
    New-Item -ItemType File -Path $PROFILE -Force
}

3. 反映

PowerShellを再起動します。

参考

0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?