Sunday, December 25, 2011

Re: why is Vim coloring text in txt files?

Thanks Dominique.

:verbose set filetype?
filetype=conf
Last set from C:\Program Files (x86)\Vim\vim73\filetype.vim

But filetype.vim does not contain a variable named "filetype".

I added the following line to my vimrc file, which makes the text all
black,
au BufRead *.txt syntax off

There is some relevant information on the following links.

Vim sets the ft (and consequently syn) to "conf" if the file includes
a line starting with #
http://vim.1045645.n5.nabble.com/How-do-you-disable-syntax-highlighting-for-a-specific-file-type-td3380112.html

http://www.cyberciti.biz/faq/turn-on-or-off-color-syntax-highlighting-in-vi-or-vim/

On Dec 25, 4:25 am, Dominique Pellé <dominique.pe...@gmail.com> wrote:
> Wolfram Volpi wrote:
> > Sometimes Vim displays my .txt files in various colors.
>
> > The coloring of the text depends on the position of "#" (line 4 in the
> > examples below).  You can see the colors in the attached png file.
>
> > Is that normal behavior for Vim?  If not, where could this colors be
> > coming from?
>
> > I don't think the colors are coming from my vimrc file, but I attached
> > it in case you want to take a look.
>
> > I just want black text and maybe colors for Markdown headings.
>
> > Thank you,
> > wolfv
> > --
>
> > temp2.txt:
> > After reopening file in Vim,
> > if first line starting with hash (#) starts after column 1
> > then
> >  #hash is black
> >  'single quote is black'
> >  "double quote is black"
>
> > temp3.txt:
> > After reopening file in Vim,
> > if first line starting with hash (#) starts in column 1
> > then
> > #hash is blue
> >  'single quote is pink'
> >  "double quote is pink"
>
> I don't see those colors.
>
> What does the following Ex command say when you
> edit a *.txt file with the unexpected colors?
>
>   :verbose set filetype?
>
> If the filetype is set somewhere, it should indicate where
> it comes from.  It might come from one of your installed plugins.
>
> Regards
> -- Dominique

--
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: