PageRenderTime 110ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/powershell/Microsoft.PowerShell_profile.ps1

https://github.com/shurane/dotfiles
Powershell | 29 lines | 20 code | 7 blank | 2 comment | 4 complexity | 445e4c8814a91831899ab0fae36c6463 MD5 | raw file
  1. Import-Module ZLocation
  2. Import-Module PSReadLine
  3. Set-PSReadlineOption -EditMode Emacs
  4. # http://joonro.github.io/blog/posts/powershell-customizations.html
  5. Set-PSReadLineOption -HistoryNoDuplicates
  6. Set-PSReadLineOption -HistorySearchCursorMovesToEnd
  7. Set-PSReadLineOption -HistorySaveStyle SaveIncrementally
  8. Set-PSReadLineOption -MaximumHistoryCount 100000
  9. Set-PSReadLineOption -BellStyle None
  10. # https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#how-do-i-create-an-alias-for-ripgrep-on-windows
  11. function rgl {
  12. $count = @($input).Count
  13. $input.Reset()
  14. if ($count) { $input | rg.exe -i -p -M 500 $args }
  15. else { rg.exe -i $args }
  16. }
  17. function rgf {
  18. $count = @($input).Count
  19. $input.Reset()
  20. if ($count) { $input | rg.exe --files | rg.exe -i -p -M 500 $args }
  21. else { rg.exe --files | rg.exe -i $args }
  22. }