Sunday, August 27, 2017

.cl file type?

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 vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: