Is it possible to shorten paths in grep results buffer? By default each line of grep results in Emacs looks like this:
/home/pawel/tmp/avro-src-1.5.4-fixed/lang/c/src/datum.c:107:int avro_string_set(avro_datum_t datum, const char *p)
which takes a lot of space and looks messy and not very readable, especially if there is another window beside.
I’d like to see just filenames or partial paths – as long as they are unique in grep buffer, e.g:
datum.c:107:int avro_string_set(avro_datum_t datum, const char *p)
or
/home/(...)/src/datum.c:107:int avro_string_set(avro_datum_t datum, const char *p)
I guess emacs needs to know full paths internally, so it’s about displaying grep results only rather than playing with ‘grep’ parameters. How to do this? Would hide-show mode definitions for grep buffer do the trick, or is there an easier way of doing this?
Thanks.
I made one for you: scf-mode. It works as a minor-mode, so the original file-name can be restored when you turn it off.
For installation instructions see the file header.