Saturday, December 31, 2011

Re: why is Vim coloring text in txt files?

On 31/12/11 21:44, wolfv wrote:
> On Dec 31, 11:59 am, Tony Mechelynck<antoine.mechely...@gmail.com>
> wrote:
>> add a file $HOME/vimfiles/after/ftplugin/text.vim (for Windows)
>> In that file, either the following commands:
>>
>> setlocal wm=0
>> let&l:tw =&columns
>
> Tony I tried both " setlocal wm=0" and "let&l:tw =&columns" (one at
> a time) in $HOME/vimfiles/after/ftplugin/text.vim, but neither line
> worked.
>
> Now that I look at the problem more closely, I don't think text is
> wrapping, but a carriage return is being inserted automatically. I
> made hidden characters visible:
> :set invlist
> A blue "$" (carriage return) is visible at end of each line.
>
> The lines wrap at column 100 as they should.
> However, when the cursor crosses column 80 while I am typing, the
> first whitespace left of column 80 is automatically replaced by a blue
> "$" (carriage return).

Try
:verbose setlocal tw? wm? fo?
:echo $HOME
:scriptnames

while editing a text file. Then check the help for these options (and
|fo-table| for the latter one).

The 2nd and 3rd ex-commands above are to make sure that you put the
text.vim script at some location where Vim looked for it.

>
> I don't get the auto-carriage return when I comment this line in
> filetype.vim:
> au BufRead,BufNewFile *.txt,README*,LISEZMOI*,LIESMICH*,LEESMIJ*
> setf text
> Is the auto-carriage return a text-file feature?
> How to turn it off?

I don't know yet, but maybe the answer to the question above will help
us debug the problem.

>
> Thank you for all your help. I didn't think it would take so long.
>

Best regards,
Tony.
--
A truly wise man never plays leapfrog with a unicorn.

--
You received this message from the "vim_use" 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

No comments:

Post a Comment