Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions yi-core/src/Yi/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion yi-core/src/Yi/Config/Default.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down