diff 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
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/globalsearch.vim	Thu Oct 30 13:45:31 2025 -0400
@@ -0,0 +1,13 @@
+function! GrepIncludingIgnored(pattern, path = '**/*')
+   if a:pattern =~ '^/.*/[a-z]*$'
+       let search_pattern = a:pattern
+   else
+       let search_pattern = '/' . a:pattern . '/g'
+   endif
+
+   execute 'vimgrep ' . search_pattern . ' ' . a:path
+endfunction
+
+" Map it to a command for easy use
+command! -nargs=+ GlobalSearch call GrepIncludingIgnored(<f-args>)
+command! -nargs=+ GS call GrepIncludingIgnored(<f-args>)