How can I modify rg (ripgrep) to perform case sensitive search only when the given PATTERN has any uppercase char? #1594
-
Some comands like How can I achieve this? I tried to add this code as an alias but it didn't worked as expected:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You don't need to implement this yourself. ripgrep already has a flag for this:
If you want this enabled by default, then you can either use a function (like you were trying), an alias (i.e., Also, in the future, don't just say something "didn't work as expected." Please be sure to provide an example input along with its output and the output you expected. Otherwise, people have to guess what it is that you meant by "expected." |
Beta Was this translation helpful? Give feedback.
You don't need to implement this yourself. ripgrep already has a flag for this:
-s/--smart-case
:If you want this enabled by default, then you can either use a function (like you were trying), an alias (i.e.,
alias rg="rg -S"
) or create a configuration file and put it there.Also, in the future, don't just say something "didn't work as expected." Please be sure to provide an example input along with its output and the output you expected. Otherwise, people have to guess what it is that you meant by "expected."