[xmonad] XMonad.Promp.Shell matching function
Adam Sjøgren
asjo at koldfront.dk
Sun Jun 12 21:37:42 UTC 2016
I would like shellPrompt to match anywhere in the command, not only from
the beginning.
E.g. if I have a command called "run_icesocial", I would like that to
appear if I type "icesoc", rather than having to type "run_" first.
It looks like XMonad.Prompt.Shell.commandCompletionFunction is the
function to modify:
commandCompletionFunction :: [String] -> String -> [String]
commandCompletionFunction cmds str | '/' `elem` str = []
| otherwise = filter (isPrefixOf str) cmds
Changing isPrefixOf to isInfixOf I would guess - does that sound right?
Is there an easy way to "override" that function from my xmonad.hs?
If not, would it be reasonable to make it configurable, so e.g. you
could put in a fuzzy matching function, or something even weirder? (I'll
give that a go, if so.)
Best regards,
Adam
--
"Sunday morning when the rain begins to fall Adam Sjøgren
I've got the cure for it all" asjo at koldfront.dk
More information about the xmonad
mailing list