.cl file type?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

.cl file type?

Barry Gold
What does vim think an extension of ".cl" means?

I've been writing a program that will take a list of input HTML files
(some written using an editor like vim, some generated by MS Word) and
convert them to legal (and reasonably clean) XHTML. The program is
written in PHP, and I've been following the convention of putting each
class in a separate file. So I have one top-level file (an "executable"
using the #! convention), a few "include" files with the extension
".inc", and my classes in files with the extension ".cl".

But when I try editing the .cl files with vim, auto-formatting doesn't
work. I have autoindent set, but every new line starts in column 1,
regardless of the indention of the previous line. Also linewrapping  
doesn't work (set fo+=tcroqj)

I had various ideas of what was wrong, and I think I have eliminated all
the others. But as far as I can see, vim does what I expect *unless* the
extension is ".cl". In a file named *.cl, autoformatting just doesn't
work. Period.

What's up with the .cl extension? Is there a way to get .vim to treat it
like .php? Or should I just live with it and change my naming convention
to match whatever assumptions are built into .vim?

Btw, this occurs in the vim that is downloaded with cygwin
VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)

and also when I right click on a file and choose "Edit with Vim".

Here is my .vimrc file, FWIW:
~ % cat .vimrc
set autoindent
set nohls
syntax off
set tw=72
set ws
set ic
set ts=8
set sw=4
map  :n
map  :w
map
:e # :w
map v k$hjl
map q F r
map g f r
map = 3k$h3jl
map @ k$hjl
map gx ,
unmap gx
set background=light
set ff=unix
let loaded_matchparen=1
set fo+=tcroqj

--
On Beta, we'd have earrings for that. You could buy them in any jewelry store.
http://www.conchord.org/xeno/bdgsig.html

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: .cl file type?

Christian Brabandt

On So, 27 Aug 2017, Barry Gold wrote:

> What does vim think an extension of ".cl" means?
>
> I've been writing a program that will take a list of input HTML files (some
> written using an editor like vim, some generated by MS Word) and convert
> them to legal (and reasonably clean) XHTML. The program is written in PHP,
> and I've been following the convention of putting each class in a separate
> file. So I have one top-level file (an "executable" using the #!
> convention), a few "include" files with the extension ".inc", and my classes
> in files with the extension ".cl".
>
> But when I try editing the .cl files with vim, auto-formatting doesn't work.
> I have autoindent set, but every new line starts in column 1, regardless of
> the indention of the previous line. Also linewrapping  doesn't work (set
> fo+=tcroqj)
>
> I had various ideas of what was wrong, and I think I have eliminated all the
> others. But as far as I can see, vim does what I expect *unless* the
> extension is ".cl". In a file named *.cl, autoformatting just doesn't work.
> Period.
>
> What's up with the .cl extension? Is there a way to get .vim to treat it
> like .php? Or should I just live with it and change my naming convention to
> match whatever assumptions are built into .vim?
>
> Btw, this occurs in the vim that is downloaded with cygwin
> VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)
>
> and also when I right click on a file and choose "Edit with Vim".

Your php files have probably special settings in the corresponding
filetype plugins. And possibly, if you enabled indent plugins, there
exists special logic there as well. If you want to have your .cl files
be handled like php files, check e.g. the faq:
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26
(there are several questions in the 26 block, that might be of interest
to you). And follow the links to the documentation in Vim.

Also, if .cl is kind of a official extensions for Vim, we might need to
extend our logic to detect php like files.

Best,
Christian
--
Es ist komisch, daß kein Mensch mit Esprit ein Glück möchte, das auf
Dummheit gegründet ist, und doch ist es klar, daß man dabei einen
guten Tausch machen würde.
                -- François Marie Voltaire

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: .cl file type?

Barry Gold
On Sunday, August 27, 2017 at 11:59:54 PM UTC-7, Christian Brabandt wrote:

> On So, 27 Aug 2017, Barry Gold wrote:
>
> > What does vim think an extension of ".cl" means?
> >
> > I've been writing a program that will take a list of input HTML files (some
> > written using an editor like vim, some generated by MS Word) and convert
> > them to legal (and reasonably clean) XHTML. The program is written in PHP,
> > and I've been following the convention of putting each class in a separate
> > file. So I have one top-level file (an "executable" using the #!
> > convention), a few "include" files with the extension ".inc", and my classes
> > in files with the extension ".cl".
> >
> > But when I try editing the .cl files with vim, auto-formatting doesn't work.
> > I have autoindent set, but every new line starts in column 1, regardless of
> > the indention of the previous line. Also linewrapping  doesn't work (set
> > fo+=tcroqj)
> >
> > I had various ideas of what was wrong, and I think I have eliminated all the
> > others. But as far as I can see, vim does what I expect *unless* the
> > extension is ".cl". In a file named *.cl, autoformatting just doesn't work.
> > Period.
> >
> > What's up with the .cl extension? Is there a way to get .vim to treat it
> > like .php? Or should I just live with it and change my naming convention to
> > match whatever assumptions are built into .vim?
> >
> > Btw, this occurs in the vim that is downloaded with cygwin
> > VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jan 27 2017 13:34:58)
> >
> > and also when I right click on a file and choose "Edit with Vim".
>
> Your php files have probably special settings in the corresponding
> filetype plugins. And possibly, if you enabled indent plugins, there
> exists special logic there as well. If you want to have your .cl files
> be handled like php files, check e.g. the faq:
> https://vimhelp.appspot.com/vim_faq.txt.html#faq-26
> (there are several questions in the 26 block, that might be of interest
> to you). And follow the links to the documentation in Vim.
>
> Also, if .cl is kind of a official extensions for Vim, we might need to
> extend our logic to detect php like files.
>
> Best,
> Christian
I have set noloadplugins, but I'm still getting the same strange behavior. I guess I should just use a different extension.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: .cl file type?

Christian Brabandt

On Mo, 28 Aug 2017, Barry Gold wrote:

> I have set noloadplugins, but I'm still getting the same strange
> behavior. I guess I should just use a different extension.

I am not sure what you are trying to say here and you didn't really go
into any of the suggested solutions.

Best,
Christian
--
Mittlerweise besteht das Internet zu 90% aus Homepage-Inhabern, die
andere Homepage-Inhaber besuchen, um beruhigt festzustellen, daß die
anderen auch keine Ahnung haben.
                -- Lindemann, [hidden email] in de.comm.internet.software

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.