Merge branch 'master' of gitee.com:klesh/dotfiles
This commit is contained in:
commit
30dd648dba
|
@ -1,6 +1,10 @@
|
||||||
# Install-Module -Name PowerShellGet -Force -AllowPrerelease
|
# curl: https://curl.se/windows/
|
||||||
# Install-Module -Name posh-git
|
# ag: https://github.com/k-takata/the_silver_searcher-win32/releases
|
||||||
# Install-Module -Name oh-my-posh
|
# fzf: https://github.com/junegunn/fzf/releases/latest
|
||||||
|
Install-Module -Name PowerShellGet -Force -AllowPrerelease
|
||||||
|
Install-Module -Name posh-git
|
||||||
|
Install-Module -Name oh-my-posh
|
||||||
|
Install-Module -Name psfzf
|
||||||
|
|
||||||
$dotfiles=(Get-Item $PSScriptRoot).Parent.FullName
|
$dotfiles=(Get-Item $PSScriptRoot).Parent.FullName
|
||||||
New-Item -ItemType SymbolicLink -Target $dotfiles\win\profile.ps1 -Path $profile -Force
|
New-Item -ItemType SymbolicLink -Target $dotfiles\win\profile.ps1 -Path $profile -Force
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
Set-PSReadLineOption -EditMode Emacs
|
Set-PSReadLineOption -EditMode Emacs
|
||||||
Set-PSReadLineOption -PredictionSource History
|
Set-PSReadLineOption -PredictionSource History
|
||||||
|
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
|
||||||
|
|
||||||
|
|
||||||
$Env:Path += ";$PSScriptRoot\bin"
|
$Env:Path += ";$PSScriptRoot\bin"
|
||||||
$Env:KUBE_EDITOR = 'nvim'
|
$Env:KUBE_EDITOR = 'nvim'
|
||||||
|
@ -80,3 +82,21 @@ function ssh-copy-id {
|
||||||
|
|
||||||
Get-Content $IdentityFile | ssh $UserHost "umask 077; mkdir -p .ssh ; cat >> .ssh/authorized_keys"
|
Get-Content $IdentityFile | ssh $UserHost "umask 077; mkdir -p .ssh ; cat >> .ssh/authorized_keys"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pass-edit {
|
||||||
|
param (
|
||||||
|
[Parameter()]
|
||||||
|
[String]
|
||||||
|
$Path
|
||||||
|
)
|
||||||
|
|
||||||
|
$tmpfile = New-TemporaryFile
|
||||||
|
gpg --decrypt $Path > $tmpfile.FullName
|
||||||
|
nvim $tmpfile.FullName
|
||||||
|
if ($? && ((gpg --list-secret-keys | findstr uid) -match '<(.*?)>')) {
|
||||||
|
$uid=$matches[1]
|
||||||
|
gpg -r $uid -o "${tmpfile.FullName}.gpg" --encrypt $tmpfile.FullName
|
||||||
|
Move-Item -Path "${tmpfile.FullName}.gpg" -Destination "$Path" -Force
|
||||||
|
Remove-Item $tmpfile.FullName -Force
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user