Last active
March 6, 2020 09:39
-
-
Save fand/91f090a41639e65a16bf807631fe24af to your computer and use it in GitHub Desktop.
My Windows Settings
This file contains 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
# Aliases | |
Set-Alias open Invoke-Item | |
Set-Alias g git | |
# Set l and ls alias to use the new Get-ChildItemColor cmdlets | |
Import-Module Get-ChildItemColor | |
Set-Alias l Get-ChildItemColor -Option AllScope | |
Set-Alias ls Get-ChildItemColorFormatWide -Option AllScope | |
# oh-my-posh | |
Import-Module -Name posh-git | |
Import-Module -Name oh-my-posh | |
Set-Theme agnoster | |
# Helper function to set location to the User Profile directory | |
function cuserprofile { Set-Location ~ } | |
Set-Alias ~ cuserprofile -Option AllScope | |
Set-PSReadlineOption -EditMode Emacs | |
Set-PSReadlineKeyHandler -Key 'Ctrl+p' -Function HistorySearchBackward | |
Set-PSReadlineKeyHandler -Key 'Ctrl+n' -Function HistorySearchForward | |
# Set git log charset | |
Set $Env:LESSCHARSET='utf-8' | |
Set-Item env:LANG -Value ja_JP.UTF-8 | |
function gh () { | |
cd $(ghq list --full-path | peco) | |
} | |
function U { | |
param | |
( | |
[int] $Code | |
) | |
if ((0 -le $Code) -and ($Code -le 0xFFFF)) | |
{ | |
return [char] $Code | |
} | |
if ((0x10000 -le $Code) -and ($Code -le 0x10FFFF)) | |
{ | |
return [char]::ConvertFromUtf32($Code) | |
} | |
throw "Invalid character code $Code" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment