6

The default file explorer inside Vim is NetRW. It can be invoked, for example, by using :e .. In its tree view, it prefixes the directory name with pipe characters (|).

For example:

joe/
| Desktop/
| Documents/
| Downloads/

How can I replace the pipe character with something else in the tree display of NetRW?

I have looked at the monster netrw.vim file and cannot seem to find this pipe character in it.

Ashwin Nanjappa
  • 76,204
  • 83
  • 211
  • 292

1 Answers1

3

You didn't look hard enough:

if has("gui_running") && (&enc == 'utf-8' || &enc == 'utf-16' || &enc == 'ucs-4')
 let s:treedepthstring= "│ "
else
 let s:treedepthstring= "| "
endif

Line 439 of $VIMRUNTIME/autoload/netrw.vim (in version 151, at least).

romainl
  • 186,200
  • 21
  • 280
  • 313
  • This doesn't actually answer the question of how to change it. I'm not a vim scripts expert, but it looks like the answer is that you can't? – yshavit Jun 16 '21 at 15:15
  • 1
    If the question is "can it be done?", then the answer is "yes". If the question is "how can I do it?", then the answer is "get an up-to-date version of Netrw and make whatever change you want in the snippet above". If the question is "is there an option for that", the the answer is "no". – romainl Jun 16 '21 at 15:24