Ashwin Nanjappa
Ashwin Nanjappa

Reputation: 78468

How to change directory character in NetRW of Vim?

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.

Upvotes: 6

Views: 900

Answers (1)

romainl
romainl

Reputation: 196456

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).

Upvotes: 3

Related Questions