Mercurial > vim
annotate plugins/globalsearch.vim @ 7:34930197e9d4
Updating hg diff tool.
Adding support for global searching
| author | Luka Sitas <lsitas@avatarasoftware.com> |
|---|---|
| date | Thu, 30 Oct 2025 13:45:31 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
| 7 | 1 function! GrepIncludingIgnored(pattern, path = '**/*') |
| 2 if a:pattern =~ '^/.*/[a-z]*$' | |
| 3 let search_pattern = a:pattern | |
| 4 else | |
| 5 let search_pattern = '/' . a:pattern . '/g' | |
| 6 endif | |
| 7 | |
| 8 execute 'vimgrep ' . search_pattern . ' ' . a:path | |
| 9 endfunction | |
| 10 | |
| 11 " Map it to a command for easy use | |
| 12 command! -nargs=+ GlobalSearch call GrepIncludingIgnored(<f-args>) | |
| 13 command! -nargs=+ GS call GrepIncludingIgnored(<f-args>) |
