Skip to content

Commit 9bd2fc6

Browse files
author
Ehtesh Choudhury
committed
added powershell profile
1 parent 4391fab commit 9bd2fc6

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Import-Module ZLocation
2+
Import-Module PSReadLine
3+
Set-PSReadlineOption -EditMode Emacs
4+
5+
# http://joonro.github.io/blog/posts/powershell-customizations.html
6+
Set-PSReadLineOption -HistoryNoDuplicates
7+
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
8+
Set-PSReadLineOption -HistorySaveStyle SaveIncrementally
9+
Set-PSReadLineOption -MaximumHistoryCount 100000
10+
Set-PSReadLineOption -BellStyle None
11+
12+
13+
# https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#how-do-i-create-an-alias-for-ripgrep-on-windows
14+
function rgl {
15+
$count = @($input).Count
16+
$input.Reset()
17+
18+
if ($count) { $input | rg.exe -i -p -M 500 $args }
19+
else { rg.exe -i $args }
20+
}
21+
22+
function rgf {
23+
$count = @($input).Count
24+
$input.Reset()
25+
26+
if ($count) { $input | rg.exe --files | rg.exe -i -p -M 500 $args }
27+
else { rg.exe --files | rg.exe -i $args }
28+
}
29+

0 commit comments

Comments
 (0)