Skip to content

Instantly share code, notes, and snippets.

@devlights
Last active February 8, 2022 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devlights/37cb3c2ed2e1887c115edab85f45cb4c to your computer and use it in GitHub Desktop.
Save devlights/37cb3c2ed2e1887c115edab85f45cb4c to your computer and use it in GitHub Desktop.
PowerShell Profile
# ---------------------------------------------------
# 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