Re: why is Vim coloring text in txt files?

2012-01-01 Thread Tony Mechelynck
On 01/01/12 00:33, wolfv wrote: On Dec 31, 2:33 pm, Tony Mechelynckantoine.mechely...@gmail.com wrote: On 31/12/11 21:44, wolfv wrote: Try :verbose setlocal tw? wm? fo? :echo $HOME :scriptnames while editing a text file. Then check the help for these options (and

Re: why is Vim coloring text in txt files?

2012-01-01 Thread wolfv
OK Tony, I changed my vimrc file, so lines 2 3 read: source $VIMRUNTIME/vimrc_example.vim au! vimrcEx FileType text and it works. But what does line 3 do? Thanks, wolfv On Jan 1, 2:08 am, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 01/01/12 00:33, wolfv wrote:

Re: why is Vim coloring text in txt files?

2012-01-01 Thread Tony Mechelynck
On 01/01/12 14:54, wolfv wrote: OK Tony, I changed my vimrc file, so lines 2 3 read: source $VIMRUNTIME/vimrc_example.vim au! vimrcEx FileType text and it works. But what does line 3 do? It removes the FileType autocommands for filetype text in autocommand group vimrcEx. The

Re: why is Vim coloring text in txt files?

2012-01-01 Thread wolfv
Thanks Tony. I couldn't have don't it without you. On Jan 1, 2:08 pm, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 01/01/12 14:54, wolfv wrote: OK Tony, I changed my vimrc file, so lines 2  3 read:      source $VIMRUNTIME/vimrc_example.vim      au! vimrcEx FileType text and

Re: why is Vim coloring text in txt files?

2012-01-01 Thread Tony Mechelynck
On 01/01/12 23:02, wolfv wrote: Thanks Tony. I couldn't have don't it without you. :-) My pleasure. Tony. -- Cleaning your house while your kids are still growing is like shoveling the walk before it stops snowing. -- Phyllis Diller -- You received this message from the

Re: why is Vim coloring text in txt files?

2011-12-31 Thread wolfv
On Dec 27, 12:55 am, Tony Mechelynck antoine.mechely...@gmail.com wrote: /vimfiles/filetype.vim filetype detection script (user customizations) I'll say this once only if exists(did_load_filetypes)         finish endif allow continuation lines let s:cpo = cpo set cpovim augroup

Re: why is Vim coloring text in txt files?

2011-12-31 Thread Tony Mechelynck
On 31/12/11 18:18, wolfv wrote: On Dec 27, 12:55 am, Tony Mechelynckantoine.mechely...@gmail.com wrote: /vimfiles/filetype.vim filetype detection script (user customizations) I'll say this once only if exists(did_load_filetypes) finish endif allow continuation lines let s:cpo

Re: why is Vim coloring text in txt files?

2011-12-31 Thread wolfv
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

Re: why is Vim coloring text in txt files?

2011-12-31 Thread Tony Mechelynck
On 31/12/11 21:44, wolfv wrote: On Dec 31, 11:59 am, Tony Mechelynckantoine.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 letl:tw =columns Tony I tried both setlocal wm=0 and letl:tw

Re: why is Vim coloring text in txt files?

2011-12-31 Thread wolfv
On Dec 31, 2:33 pm, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 31/12/11 21:44, wolfv wrote: 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).

Re: why is Vim coloring text in txt files?

2011-12-29 Thread Tony Mechelynck
On 29/12/11 06:46, wolfv wrote: [...] I created C:\Program Files (x86)\Vim\vimfiles\filetype.vim and copied the code that Tony posted on Dec 27, 12:55 into it. Its not my $HOME, but I am the sole user of this PC, so I guess that's OK. Everything works. It's the default $VIM location for your

Re: why is Vim coloring text in txt files?

2011-12-28 Thread Tony Mechelynck
On 28/12/11 01:53, wolfv wrote: Hi Tony. I didn't get vary far. Here is what I tried. From the Vim EX Line editor I typed::!mkdir $HOME/vimfiles This cmd window popped up: C:\Windows\system32\cmd.exe /c mkdir $HOME/vimfilesThe syntax of the command is incorrect.shell returned 1Hit any key to

Re: why is Vim coloring text in txt files?

2011-12-28 Thread Thilo Six
wolfv wrote the following on 28.12.2011 01:53 Hello wolfv -- snip -- Second, create a filetype.vim in that new subfolder (I assume that you don't yet have one in _that_ directory): :e ~/vimfiles/filetype.vim ,[ ft=text ]--- txt autocmd

Re: why is Vim coloring text in txt files?

2011-12-28 Thread wolfv
On Dec 28, 1:15 am, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 28/12/11 01:53, wolfv wrote: Hi Tony.  I didn't get vary far.  Here is what I tried.  From the Vim EX Line editor I typed::!mkdir $HOME/vimfiles This cmd window popped up: C:\Windows\system32\cmd.exe /c mkdir

Re: why is Vim coloring text in txt files?

2011-12-28 Thread 极品书生
you can use exec !mkdir .expand($HOME).\\vimfiles On Thu, Dec 29, 2011 at 9:00 AM, wolfv wolfvo...@gmail.com wrote: On Dec 28, 1:15 am, Tony Mechelynck antoine.mechely...@gmail.com wrote: On 28/12/11 01:53, wolfv wrote: Hi Tony. I didn't get vary far. Here is what I tried. From the

RE: why is Vim coloring text in txt files?

2011-12-28 Thread John Beckett
wolfv wrote: I tried this from cmd window: C:\Users\wolf cd %HOME% The system cannot find the path specified. It's a long story, some of which is mentioned at: http://vim.wikia.com/wiki/Filetype.vim (search for $HOME). The simplest is to use Vim to find what it thinks: :echo $HOME Then

Re: why is Vim coloring text in txt files?

2011-12-28 Thread wolfv
On Dec 28, 7:29 pm, John Beckett johnb.beck...@gmail.com wrote: wolfv wrote: I tried this from cmd window: C:\Users\wolf cd %HOME% The system cannot find the path specified. It's a long story, some of which is mentioned at:http://vim.wikia.com/wiki/Filetype.vim (search for $HOME).

Re: why is Vim coloring text in txt files?

2011-12-27 Thread Tony Mechelynck
On 27/12/11 10:03, Christian Brabandt wrote: Hi Tony! On Mo, 26 Dez 2011, Tony Mechelynck wrote: I could have used the internal mkdir() function, except that it isn't guaranteed to exist on all platforms. On which plattforms doesn't it exists? The help doesn't say. It just says:

Re: why is Vim coloring text in txt files?

2011-12-27 Thread Christian Brabandt
Hi Tony! On Mo, 26 Dez 2011, Tony Mechelynck wrote: I could have used the internal mkdir() function, except that it isn't guaranteed to exist on all platforms. On which plattforms doesn't it exists? regards, Christian -- Der Satiriker ist ein gekränkter Idealist. -- Kurt

Re: why is Vim coloring text in txt files?

2011-12-27 Thread Christian Brabandt
Hi Tony! On Di, 27 Dez 2011, Tony Mechelynck wrote: On 27/12/11 10:03, Christian Brabandt wrote: Hi Tony! On Mo, 26 Dez 2011, Tony Mechelynck wrote: I could have used the internal mkdir() function, except that it isn't guaranteed to exist on all platforms. On which plattforms doesn't

Re: why is Vim coloring text in txt files?

2011-12-27 Thread wolfv
Hi Tony. I didn't get vary far. Here is what I tried. From the Vim EX Line editor I typed::!mkdir $HOME/vimfiles This cmd window popped up: C:\Windows\system32\cmd.exe /c mkdir $HOME/vimfilesThe syntax of the command is incorrect.shell returned 1Hit any key to close this window... Is there a

Re: why is Vim coloring text in txt files?

2011-12-27 Thread Thilo Six
Tony Mechelynck wrote the following on 26.12.2011 11:38 Hello Tony -- snip -- if exists(did_load_filetypes) finish endif After reading a bit more about this i agree this is the right thing to do. Actually you helped me to understand the concept of the runtimepath much better. Thank

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Thilo Six
Hello -- snip -- ,[ ft=text ]--- txt autocmd BufNewFile,BufRead \ *.txt, \\c*README* \ setl ft=text `- I just figured i probably introduced new cpo-bugs. Wolfv if you use this as is you need

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Tony Mechelynck
On 26/12/11 08:53, Thilo Six wrote: Tony Mechelynck wrote the following on 26.12.2011 04:47 Hello Thanks Thilo. I found the Generic configuration code in my C:\Program Files (x86)\Vim \vim73\filetype.vim Where in the file should the local configuration code (below) be placed? txt

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Tony Mechelynck
On 26/12/11 09:20, Thilo Six wrote: Hello -- snip -- ,[ ft=text ]--- txt autocmd BufNewFile,BufRead \ *.txt, \\c*README* \ setl ft=text `- I just figured i probably introduced new

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Thilo Six
Tony Mechelynck wrote the following on 26.12.2011 10:19 Hello Tony But save-restore as above is more prudent. Personally it would have called it more failsafe, but yes. Best regards, Tony. -- Regards, Thilo 4096R/0xC70B1A8F 721B 1BA0 095C 1ABA 3FC6 7C18 89A4 A2A0 C70B 1A8F -- You

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Thilo Six
Tony Mechelynck wrote the following on 26.12.2011 10:10 Hello Tony, -- snip -- if exists(did_load_filetypes) finish endif Personly i would leave this out as i sometimes deliberately overwrite defaults So what? $VIMRUNTIME/filetype.vim sets its filetypes by :setfiletype, which

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Tony Mechelynck
On 26/12/11 10:32, Thilo Six wrote: Tony Mechelynck wrote the following on 26.12.2011 10:10 Hello Tony, -- snip -- if exists(did_load_filetypes) finish endif Personly i would leave this out as i sometimes deliberately overwrite defaults So what? $VIMRUNTIME/filetype.vim sets its

Re: why is Vim coloring text in txt files?

2011-12-26 Thread wolfv
Thanks Thilo and Tony. I Changed my filetype.vim code so when there is a “#” at the beginning of the first 3 lines, Vim sets generic configuration. i.e. I deleted this line: \ || getline(4) =~ '^#' || getline(5) =~ '^#' My txt files won't have a “#” in the first 3 lines, so that's good

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Tony Mechelynck
On 27/12/11 03:49, wolfv wrote: Thanks Thilo and Tony. I Changed my filetype.vim code so when there is a “#” at the beginning of the first 3 lines, Vim sets generic configuration. i.e. I deleted this line: \ || getline(4) =~ '^#' || getline(5) =~ '^#' My txt files won't have a “#” in

Re: why is Vim coloring text in txt files?

2011-12-26 Thread wolfv
Thanks Tony. I don't know what else to do. Most of this Vim code is over my head. I am using Vim 7.3 on Windows 7. This is what it says in my :h runtimepath: PC, OS/2: $HOME/vimfiles, $VIM/vimfiles,

Re: why is Vim coloring text in txt files?

2011-12-26 Thread Tony Mechelynck
On 27/12/11 05:26, wolfv wrote: Thanks Tony. I don't know what else to do. Most of this Vim code is over my head. I am using Vim 7.3 on Windows 7. This is what it says in my :h runtimepath: PC, OS/2: $HOME/vimfiles,

why is Vim coloring text in txt files?

2011-12-25 Thread Wolfram Volpi
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

Re: why is Vim coloring text in txt files?

2011-12-25 Thread Dominique Pellé
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

Re: why is Vim coloring text in txt files?

2011-12-25 Thread wolfv
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

Re: why is Vim coloring text in txt files?

2011-12-25 Thread Thilo Six
wolfv wrote the following on 25.12.2011 16:50 Hello :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

Re: why is Vim coloring text in txt files?

2011-12-25 Thread wolfv
Thanks Thilo. I found the Generic configuration code in my C:\Program Files (x86)\Vim \vim73\filetype.vim Where in the file should the local configuration code (below) be placed? txt autocmd BufNewFile,BufRead \ *.txt, \*README* \ setl ft=text wolfv On Dec 25, 9:26 am,

Re: why is Vim coloring text in txt files?

2011-12-25 Thread Tony Mechelynck
On 26/12/11 01:28, wolfv wrote: Thanks Thilo. I found the Generic configuration code in my C:\Program Files (x86)\Vim \vim73\filetype.vim Where in the file should the local configuration code (below) be placed? txt autocmd BufNewFile,BufRead \ *.txt, \*README* \ setl

Re: why is Vim coloring text in txt files?

2011-12-25 Thread Thilo Six
Tony Mechelynck wrote the following on 26.12.2011 04:47 Hello Thanks Thilo. I found the Generic configuration code in my C:\Program Files (x86)\Vim \vim73\filetype.vim Where in the file should the local configuration code (below) be placed? txt autocmd BufNewFile,BufRead \