Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reduce line length in search results?

Is there a way to tell Visual Studio to only show the file name in the search results instead of the full path? By default it shows the full file path followed by the actual line.

If it did, I could make the results window take less space on the screen and wouldn't have to bother with scrolling to see the actual line (yes, the full paths are quite long).

like image 565
Luchian Grigore Avatar asked Jun 17 '13 13:06

Luchian Grigore


1 Answers

Yes, it's possible, although involves registry hack:

  • go to HKCU\Software\Microsoft\VisualStudio\10.0\Find
  • create a new string Find result format with value $f$e($l,$c):$t\r\n
  • enjoy

Here are the values you can use in the string:

Files

  • $p path
  • $f filename
  • $v drive/unc share
  • $d dir
  • $n name
  • $e .ext

Location

  • $l line
  • $c col
  • $x end col if on first line, else end of first line
  • $L span end line
  • $C span end col

Text

  • $0 matched text
  • $t text of first line
  • $s summary of hit
  • $T text of spanned lines

Char

  • \n newline
  • \s space
  • \t tab
  • \\ slash
  • \$ $
like image 111
andreister Avatar answered Nov 14 '22 06:11

andreister