Does the ".cl" extension have any special meaning to vim?

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

Does the ".cl" extension have any special meaning to vim?

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: Does the ".cl" extension have any special meaning to vim?

Christian Brabandt

On Mo, 28 Aug 2017, Barry Gold wrote:

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

:verbose set filetype?

according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
common lisp files. So Vim sets the lisp filetype.

Now you didn't answer the question in the other thread you created, so
let me ask you again, is .cl a common php file extensions? If yes, we
might need to tweak filetype.vim to detect this, if not, please go with
the suggestions from the mentioned faq articles.

Best,
Christian
--
Liegt der Bauer unterm Tisch, war das Essen nimmer frisch.

--
--
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: Does the ".cl" extension have any special meaning to vim?

Barry Gold

On 8/28/2017 11:40 PM, Christian Brabandt wrote:
On Mo, 28 Aug 2017, Barry Gold wrote:

What does vim think an extension of ".cl" means?
:verbose set filetype?

according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest 
common lisp files. So Vim sets the lisp filetype.

Now you didn't answer the question in the other thread you created, so 
let me ask you again, is .cl a common php file extensions? If yes, we 
might need to tweak filetype.vim to detect this, if not, please go with 
the suggestions from the mentioned faq articles.

I went to the faq articles, which is why I added noloadplugins to my .vimrc file.


-- 
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: Does the ".cl" extension have any special meaning to vim?

Christian Brabandt

On Di, 29 Aug 2017, Barry Gold wrote:

>
> On 8/28/2017 11:40 PM, Christian Brabandt wrote:
> >On Mo, 28 Aug 2017, Barry Gold wrote:
> >
> >>What does vim think an extension of ".cl" means?
> >:verbose set filetype?
> >
> >according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> >common lisp files. So Vim sets the lisp filetype.
> >
> >Now you didn't answer the question in the other thread you created, so
> >let me ask you again, is .cl a common php file extensions? If yes, we
> >might need to tweak filetype.vim to detect this, if not, please go with
> >the suggestions from the mentioned faq articles.
>
> I went to the faq articles, which is why I added noloadplugins to my .vimrc
> file.

But you don't want to disable loading plugins altogether, but rather
apply settings to a particular filetype/extension, right?
So you should rather go with those articles:
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26.6
https://vimhelp.appspot.com/vim_faq.txt.html#faq-26.8

Please also check the links to the documentation in Vim.

Best,
Christian
--
Hundert graue Pferde machen nicht einen einzigen Schimmel.
                -- Goethe, Maximen und Reflektionen, Nr. 1019

--
--
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: Does the ".cl" extension have any special meaning to vim?

Barry Gold
In reply to this post by Christian Brabandt
On 8/28/2017 11:40 PM, Christian Brabandt wrote:

> On Mo, 28 Aug 2017, Barry Gold wrote:
>
>> What does vim think an extension of ".cl" means?
> :verbose set filetype?
>
> according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> common lisp files. So Vim sets the lisp filetype.
>
> Now you didn't answer the question in the other thread you created, so
> let me ask you again, is .cl a common php file extensions?

I've seen ".cl" used a few times for PHP classes, but I'm not sure how
common it is outside the place I worked in the 2000s.

Let's try a different approach.

Is there something I can set that tells vim "forget 'improved', just
behave like the 4.2bsd version of vi" (or any other "classic" vi).

Not that I'm against the improvements, I'm especially fond of the fact
that when you edit a file you've edited before, it starts at the current
line from the last time, even if a long time ago. I also like the fact
that vim will detect if you previously edited this file and the session
ended without closing the vi (e.g., power failure or system crash) and
gives you options to "restore" "edit anyway" "read only" etc.

But if I can just use it as a simple text editor without getting lost in
its guesses about my file type, I'm willing to give that up and just use
it like plain old vi that I've used since 1976.

--
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: Does the ".cl" extension have any special meaning to vim?

Christian Brabandt

On Di, 29 Aug 2017, Barry Gold wrote:

> On 8/28/2017 11:40 PM, Christian Brabandt wrote:
> >On Mo, 28 Aug 2017, Barry Gold wrote:
> >
> >>What does vim think an extension of ".cl" means?
> >:verbose set filetype?
> >
> >according to $VIMRUNTIME/filetype.vim .cl extensions seems to suggest
> >common lisp files. So Vim sets the lisp filetype.
> >
> >Now you didn't answer the question in the other thread you created, so
> >let me ask you again, is .cl a common php file extensions?
>
> I've seen ".cl" used a few times for PHP classes, but I'm not sure how
> common it is outside the place I worked in the 2000s.
>
> Let's try a different approach.
>
> Is there something I can set that tells vim "forget 'improved', just behave
> like the 4.2bsd version of vi" (or any other "classic" vi).
>
> Not that I'm against the improvements, I'm especially fond of the fact that
> when you edit a file you've edited before, it starts at the current line
> from the last time, even if a long time ago. I also like the fact that vim
> will detect if you previously edited this file and the session ended without
> closing the vi (e.g., power failure or system crash) and gives you options
> to "restore" "edit anyway" "read only" etc.
>
> But if I can just use it as a simple text editor without getting lost in its
> guesses about my file type, I'm willing to give that up and just use it like
> plain old vi that I've used since 1976.

Try using putting explicitly `:filetype off` into your .vimrc and see if
that helps.

Other than that, you can of course run vim as a vi compatible version
using `vim -u NONE`  or running it as `vi` should usually also get you a
close enough approximation of the original vi.

Best,
Christian
--
Sagt eine Dame 'Nein', so bedeutet das 'Vielleicht'; sagt sie
'Vielleicht', dann denkt sie dabei 'Ja', sagt sie 'Ja' - ist sie keine
Dame.
                -- Charles Maurice de Talleyrand

--
--
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: Does the ".cl" extension have any special meaning to vim?

Barry Gold
On 8/29/2017 11:45 PM, Christian Brabandt wrote:
> Try using putting explicitly `:filetype off` into your .vimrc and see if
> that helps.
>
> Other than that, you can of course run vim as a vi compatible version
> using `vim -u NONE`  or running it as `vi` should usually also get you a
> close enough approximation of the original vi.

Thanks, that did it!

--
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: Does the ".cl" extension have any special meaning to vim?

Shawn H Corey
In reply to this post by Barry Gold
On Tue, 29 Aug 2017 18:17:16 -0700
Barry Gold <[hidden email]> wrote:

> I've seen ".cl" used a few times for PHP classes, but I'm not sure
> how common it is outside the place I worked in the 2000s.

.cl would be Common Lisp https://en.wikipedia.org/wiki/Common_Lisp


--
Don't stop where the ink does.

        Shawn H Corey

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