On Apr 1, 2014 10:35 AM, <vex...@gmail.com> wrote:
>
> On win7 x64 using VIM 7.4, I get an error with gVim upon reading the _vimrc, when Unicode chars are in the listchars section. A simple example to trigger would read:
>
> set listchars=eol:¶
>
> I get an "Error detected...E474 Invalid argument: set listchars=eol:¶" popup error dialog.
>
> (In case it doesn't show, the character after the ':' is the pilcrow (U+00B6) aka the paragraph mark, but any non-Ascii Unicode character yields the error)
>
> I thought this would be ok as help docs say "UTF-8 characters can be used when 'encoding' is "utf-8", otherwise only printable characters are allowed."
>
> _vimrc 'encoding' and 'fileencoding' options are both UTF-8. Running ':set fileencoding' and ':set encoding' with the _vimrc open both yield '[...]=utf-8'. There is no BOM on the file, though a different Windows encoding checker utility also reads the file as UTF-8.
UTF-8 is not the default &encoding. Make sure that you have
scriptencoding utf-8
set encoding=utf-8
before any other command in your vimrc. Remove &encoding setting that is located somewhere else in your vimrc (it is located because utf-8 is not the default).
Generally you just need to make sure you set &encoding before &listchars. But it is better to use stricter rules specified above: make encoding setting always the very first line in the vimrc, make the first line of each script
scriptencoding utf-8
>
> As a result of the error, listchars is set to the default (eol:$). However, if I open and re-source the _vimrc (:so %), the file reads without error, and listchars is set to the appropriate settings, Unicode chars and all, and ':set list' works correctly.
>
> Can anyone replicate this, or is this some conflict with something else in my _vimrc? Or is this expected and I'm misunderstanding the functionality of listchars?
>
> (As an aside, I'd also like to voice my approval for inclusion of the lcs space patch in the next version of Vim; it's easy for eyes to elide over empty space, so making them more visible is useful)
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
I've attached an edited collage of screenshots (and here's the link also) http://i245.photobucket.com/albums/gg79/traycerb/vim_listchars_error_zpsc42a1081.png
In case it's not clear, top to bottom screenshot shows starting Vim from cmdline w/ options, the command-line window (q:), and the output of the 'set listchars?' command. Only the first option in listchars is set. I'm noob to all this, so perhaps I'm missing some obvious step?