r/vim•
phantom94

[neovim] Set nolist on terminal windows?

Hi!

I have my vimrc configured with:

set listchars=trail:·,tab:▸\ ,eol:¬
set list

To show white space in my files, but this also means that if I have a terminal open in neovim, it also displays it.

Is there a way to configure my vimrc to set nolist, but only if the window is a terminal window?

Thanks!

Edit: Solution found

Posted Feb 3, 2016, 8:31 AM UTC · edited

25
sylvain_soliman•

I usually use an autocommand :

au TermOpen * setlocal listchars=
3
phantom94OP:q!•

Exactly what I was looking for! Thanks!

1
dhruvasagar•

Something like this :

if (&termencoding ==# 'utf-8' || &encoding ==# 'utf-8') && version >= 700
  set listchars=tab:›\ 
else
  set listchars=tab:\ \ 
endif

Edit: You could opt to disable it in terminal but some terminals support it so I prefer to use them in that scenario.

1
nhooyr•

there is a subreddit for neovim. https://www.reddit.com/r/neovim/

0
phantom94OP:q!•

I know, it is not very active though. But I already got my question answered here.

2