diff --git a/builtin/grep.c b/builtin/grep.c index 133c4583b7..63b00f8fab 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -1083,6 +1083,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (len > 4 && is_dir_sep(pager[len - 5])) pager += len - 4; + if (!strcmp("less", pager)) + string_list_append(&path_list, "-i"); + if (!strcmp("less", pager) || !strcmp("vi", pager)) { struct strbuf buf = STRBUF_INIT; strbuf_addf(&buf, "+/%s%s",