- Notifications
You must be signed in to change notification settings - Fork23
cosmicexplorer/helm-rg
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Search massive codebases extremely fast, usingripgrep andhelm. Inspired byhelm-ag andf3.
Also check outrg.el, which I haven't used much but seems pretty cool.
See theripgrep whirlwind tour for further information on invokingripgrep.
- Invoke the interactive function
helm-rgto start a search withripgrepin the current directory.helmis used to browse the results and update the output as you type.- Each line has the file path, the line number, and the column number of the start of the match, and each part is highlighted differently.
- UseTAB to invoke the helm persistent action, which previews the result and highlights the matched text in the preview.
- UseRET to visit the file containing the result, move point to the start of the match, and recenter.
- The result's buffer is displayed with
helm-rg-display-buffer-normal-method(which defaults toswitch-to-buffer). - Use a prefix argument (C-u RET) to open the buffer with
helm-rg-display-buffer-alternate-method(which defaults topop-to-buffer).
- The result's buffer is displayed with
- The text entered into the minibuffer is interpreted into aPCRE regexp to pass to
ripgrep.helm-rg's pattern syntax is basically PCRE, but single spaces basically act as a more powerful conjunction operator.- For example, the pattern
a bin the minibuffer is transformed intoa.*b|b.*a.- The single space can be used to find lines with any permutation of the regexps on either side of the space.
- Two spaces in a row will search for a literal single space.
ripgrep's--smart-caseoption is used so that case-sensitive search is only on if any of the characters in the pattern are capitalized.- For example,
ab(conceptually) searches[Aa][bB], butAbin the minibuffer will only search for the patternAbwithripgrep, because it has at least one uppercase letter.
- For example,
- For example, the pattern
- UseM-d to select a new directory to search from.
- UseM-g to input a glob pattern to filter files by, e.g.
*.py.- The glob pattern defaults to the value of
helm-rg-default-glob-string, which is an empty string (matches every file) unless you customize it. - PressingM-g again shows the same minibuffer prompt for the glob pattern, with the string that was previously input.
- The glob pattern defaults to the value of
- Use and to go up and down by files in the results.
- and simply go up and down by match result, and there may be many matches for your pattern in a single file, even multiple on a single line (which
ripgrepreports as multiple separate results). - The and keys will move up or down until it lands on a result from a different file than it started on.
- When moving by file,
helm-rgwill cycle around the results list, but it will print a harmless error message instead of looping infinitely if all results are from the same file.
- When moving by file,
- and simply go up and down by match result, and there may be many matches for your pattern in a single file, even multiple on a single line (which
- Use the interactive autoloaded function
helm-rg-display-helpto see the ripgrep command's usage info.
items checked completed here are ready to be added to the docs above
- make a keybinding to drop into an "edit mode" and edit file content inline in results like
helm-ag- currently called "bounce mode" in the alpha stage
- needs to dedup results from the same line
- should also merge the colorations
- this might be easier without using the
--vimgrepflag (!!!)
- can insert markers on either side of each line to find the text added or removed
- can change the filename by editing the file line
- needs to reset all the file data for each entry if the file name is being changed!!!
- can expand the windows of text beyond single lines at a time
- using
helm-rg--expand-match-contextand/orhelm-rg--spread-match-context - and pop into another buffer for a quick view if you want
- can use
helm-rg--visit-current-file-for-bounce
- can use
- can expand up and down from file header lines to add lines from the top or bottom of the file!
- can use newlines in inserted text
- not for file names -- newlines are still removed there
- would need to use text properties to move by match results then, for everything that uses
helm-rg--apply-matches-with-file-for-bouncebasically
- using
- visiting the file should go to the appropriate line of the file!
- should flash a highlight of the matched text when visiting the file!
- color all results in the file in the async action!
- don't recolor when switching to a different result in the same file!
- don't color matches whenever file path matches
helm-rg-shallow-highlight-files-regexp
- use
ripgrepfile types instead of flattening globbing out intohelm-rg-default-glob-string- user defines file types in a
defcustom, and can interactively toggle the accepted file types - user can also set the default set of file types
- as a dir-local variable!!
- user defines file types in a
- add testing
- should be testing all of our interactive functions
- in all configurations (for all permutations of
defcustomvalues)
- in all configurations (for all permutations of
- also everything that's called by helm
- does helm have any frameworks to make integration testing easier?
- should be testing all of our interactive functions
- publish
update-commentary.eland the associated machinery- as an npm package, MELPA package, pandoc writer,???
- make a keybinding for running
helm-rgon dired marked files- then you could do an
f3search, bounce to dired, then immediatelyhelm-rgon just the file paths from thef3search,which would be sick
- then you could do an
- does ripgrep have any options to traverse the fs in (any type of) sorted order?
- if so we'll definitely want a
defcustomon that asap
- if so we'll definitely want a
About
ripgrep is nice
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.
