diff --git a/yi-core/src/Yi/Command.hs b/yi-core/src/Yi/Command.hs index 593adcc0e..2942f18b1 100644 --- a/yi-core/src/Yi/Command.hs +++ b/yi-core/src/Yi/Command.hs @@ -157,6 +157,13 @@ grepFind (Doc filePattern) (Doc searchedRegex) = withOtherWindow $ do withCurrentBuffer $ setMode Compilation.mode return () +-- | Perform a git+grep operation +gitGrep :: String ::: FilePatternTag -> String ::: RegexTag -> YiM () +gitGrep (Doc filePattern) (Doc searchedRegex) = withOtherWindow $ do + void $ startSubprocess "git" ["grep","-Hnie",searchedRegex,filePattern] (const $ return ()) + withCurrentBuffer $ setMode Compilation.mode + return () + ----------------------- -- | stack-build diff --git a/yi-core/src/Yi/Config/Default.hs b/yi-core/src/Yi/Config/Default.hs index f56d759cc..f34ade919 100644 --- a/yi-core/src/Yi/Config/Default.hs +++ b/yi-core/src/Yi/Config/Default.hs @@ -11,7 +11,7 @@ import Paths_yi_core import System.FilePath import Yi.Buffer -import Yi.Command (cabalBuildE, cabalConfigureE, grepFind, +import Yi.Command (cabalBuildE, cabalConfigureE, grepFind, gitGrep, makeBuild, reloadProjectE, searchSources, shell) import Yi.Config @@ -50,6 +50,7 @@ defaultPublishedActions = HM.fromList , ("deleteBlankLinesB" , box deleteBlankLinesB) , ("getSelectRegionB" , box getSelectRegionB) , ("grepFind" , box grepFind) + , ("gitGrep" , box gitGrep) , ("insertB" , box insertB) , ("leftB" , box leftB) , ("linePrefixSelectionB" , box linePrefixSelectionB)