1

I used list and listchars in vimrc file to display hidden characters but I get this error:

E474: Invalid argument: listchars=tab:> 

after tab:> there is also a space. Below I have the complete entries

set list
set listchars=tab:> ,trail:-,space:·

I checked the arguments one by one, and the problem is caused when I also include the tab argument. I saw that in many cases specifying encoding to utf-8 solves the problem, so at the top of the file I inserted the lines

set encoding=utf-8
scriptencoding utf-8

but the problem remains. Currently the tab character is displayed as ^I.

I run vim version 8.2 in Debian 11.6

How can I solve the tab character problem?

I want to include it in my specifications.

1 Answer 1

1

The set command doesn't accept space in the left hand side (space is used to separate right hand sides). You have to escape the spaces:

set list
set listchars=tab:>\ ,trail:-,space:·
2
  • Thank you @Vivian De Smedt, now it works perfectly. Commented Feb 26, 2023 at 20:08
  • Welcome to Vim :-) You are welcome! Thanks for the feedback. Commented Feb 26, 2023 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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