0

I've seen

But none of them solved my problem

I'm trying to set my listchars in my vimrc like this:

set listchars=tab:|

But I got the error: E474: Invalid argument: listchars=tab:

I tried escaping the pipe as \| and ^V| and \\| and a bunch of variations, but nothing worked.

The weird thing is that I can do other stuff (like nnoremap \|) with no problems at all. The only problem is for listchars.

1
  • 2
    tab requires either 2 or 3 letters, not only a single letter Sep 9, 2021 at 5:25

1 Answer 1

4

Read :h 'lcs': "Two or three characters to be used to show a tab". First, the first one. Then the second one repeated as many times as needed.

set lcs=tab:\|\|
2
  • I think you didn't understand my question. What I want to know is how to escape a |. \| didn't work for me. Sep 9, 2021 at 4:43
  • 2
    @Siddharth I'm pretty sure you didn't understand my answer. \| works for me and everyone else.
    – Matt
    Sep 9, 2021 at 4:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.