Update dotfiles/.config/powershell/user_profile.ps1
This commit is contained in:
parent
d1b68da2b7
commit
494ff3e6a0
1 changed files with 16 additions and 8 deletions
|
@ -1,14 +1,21 @@
|
|||
# set PowerShell to UTF-8
|
||||
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
|
||||
Install-Module posh-git -Scope CurrentUser
|
||||
Install-Module oh-my-posh -Scope CurrentUser
|
||||
Install-Module -Name PSReadLine -AllowPrerelease -Scope CurrentUser -Force -SkipPublisherCheck
|
||||
Set-Prompt
|
||||
|
||||
Import-Module posh-git
|
||||
Import-Module oh-my-posh
|
||||
$omp_config = Join-Path $PSScriptRoot ".\takuya.omp.json"
|
||||
oh-my-posh --init --shell pwsh --config $omp_config | Invoke-Expression
|
||||
Set-Theme Paradox
|
||||
|
||||
Import-Module -Name Terminal-Icons
|
||||
|
||||
# PSReadLine
|
||||
Set-PSReadLineOption -EditMode Emacs
|
||||
Set-PSReadLineOption -EditMode Vim
|
||||
Set-PSReadLineOption -BellStyle None
|
||||
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
|
||||
Set-PSReadLineOption -PredictionSource History
|
||||
|
@ -17,18 +24,19 @@ Set-PSReadLineOption -PredictionSource History
|
|||
Import-Module PSFzf
|
||||
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r'
|
||||
|
||||
### zoxide
|
||||
Invoke-Expression (& {
|
||||
$hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
|
||||
(zoxide init --hook $hook powershell | Out-String)
|
||||
})
|
||||
|
||||
# Env
|
||||
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe"
|
||||
|
||||
# Alias
|
||||
Set-Alias -Name vim -Value nvim
|
||||
Set-Alias ll ls
|
||||
Set-Alias g git
|
||||
### Aliases
|
||||
Set-Alias grep findstr
|
||||
Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe'
|
||||
Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
|
||||
|
||||
# Utilities
|
||||
### Utilities
|
||||
function which ($command) {
|
||||
Get-Command -Name $command -ErrorAction SilentlyContinue |
|
||||
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
|
||||
|
|
Loading…
Reference in a new issue