Last active
February 8, 2022 04:52
-
-
Save devlights/37cb3c2ed2e1887c115edab85f45cb4c to your computer and use it in GitHub Desktop.
PowerShell Profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------- | |
# Set encodings | |
# --------------------------------------------------- | |
[System.Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding("utf-8") | |
[System.Console]::InputEncoding = [System.Text.Encoding]::GetEncoding("utf-8") | |
$env:LESSCHARSET = "utf-8" | |
# --------------------------------------------------- | |
# Import plugins | |
# - Enabling it slows down the startup time, so I've disabled it for now. | |
# --------------------------------------------------- | |
#Import-Module oh-my-posh | |
#Import-Module posh-git | |
#Import-Module Terminal-Icons | |
#Set-PoshPrompt -Theme ys | |
# --------------------------------------------------- | |
# PSReadLine settings | |
# --------------------------------------------------- | |
if ($host.Name -eq 'ConsoleHost') | |
{ | |
# PSReadLineモジュールを有効に | |
Import-Module PSReadLine | |
# キーバインドをEmacsスタイル(Linuxのシェルのデフォルトと同じ) に | |
Set-PSReadLineOption -EditMode Emacs | |
# 予測Intellisenseを有効に | |
Set-PSReadLineOption -PredictionSource History | |
# Ctrl+i で Linux のシェルのように補完が出来るように | |
Set-PSReadLineKeyHandler -Key Ctrl+i -Function Complete | |
# Ctrl+f で 1単語すすめるように(予測Intellisenseを確定させる際に使える) | |
Set-PSReadLineKeyHandler -Key Ctrl+f -Function ForwardWord | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment