Search code examples
vimnetrw

How do I change the vertical bar in netrw?


I just want to know if there is a way for replacing the | glyph with │ (notice that the second one is taller) in order to make a continuous vertical line in netrw...

I successfully replaced it in vim's split lines but I haven't found the way to do it in netrw.

Below an image is shown with what I got (green rect) and what I want (purple rect) in replace.

current situation


Solution

  • Unfortunately it's not configurable via an option like set fillchars or a variable.

    However, you can change it directly on netrw.vim. Just edit $VIMRUNTIME/autoload/netrw.vim and change s:treedepthstring.

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

    From the code we can also see that if gui is enabled, it automatically uses the taller one.

    Before:

    Default

    After:

    After changing