Update the path function to a generic one and redefine the grep key binding.