Closed it6 closed 7 years ago
rg-command-line-flags
is a global variable so it's suited for flags you want in every search.
It's customizable by doing M-x
customize-group
RET rg
RET and adding flags under the Rg Command Line Flags setting.
If you want to add a flag for a single search you can use the prefix argument C-u
to the rg
command. That will let you edit the full command line before it's executed.
I see a \
being added to the -w
flag when I try to add flag without using C-u
this is causing the search to fail is there anyway we can enable this feature without pressing C-u
This throws an error as mentioned above
rg --color always --colors match:fg:red --type less --no-heading --type-add 'gn:*.gn' --type-add 'gn:*.gni' --type-add 'gyp:*.gyp' --type-add 'gyp:*.gypi' -i -w\ onboarding
This works as expected
rg --color always --colors match:fg:red --type less --no-heading --type-add 'gn:*.gn' --type-add 'gn:*.gni' --type-add 'gyp:*.gyp' --type-add 'gyp:*.gypi' -i -w onboarding
Spaces are escaped to allow for search terms with spaces in them. This comes from emacs builtin read input functions.
If you don't want to use type C-u
every time you can define your own wrapper:
(defun my-rg ()
(interactive)
(let ((current-prefix-arg '(4)))
(call-interactively #'rg)))
Additional arguments doesn't work when passing additional arguments. Can you please add this to readme too.
I am passing in
-w SEARCH_PATTERN
here is the command and error I seeNow I see you have
rg-command-line-flags
how can I pass flags to this variable? I need the ability to pass random flags to different searches.