Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change directory character in NetRW of Vim?

Tags:

vim

netrw

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.

like image 913
Ashwin Nanjappa Avatar asked Sep 29 '22 20:09

Ashwin Nanjappa


1 Answers

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

like image 121
romainl Avatar answered Oct 07 '22 20:10

romainl