Wednesday, June 22, 2011

Re: Exasperated with folding

Hi Eric!

On Mi, 22 Jun 2011, Eric Weir wrote:

> Second, I am new to Vim and not a programmer. Use of the command above
> was suggested as a way to add an extent to those already recognized by
> the already existing markdown filetype. Before putting the command
> anywhere, I tried to find where the markdown filetype is defined,
> thinking that would provide guidance as to where the command adding
> the new extent should be placed, but I was unable to do so.

You've already told as several times, that you are not a
programmer. That doesn't mean anything. You don't have to be a
programmer to use vim. I myself use vim mainly for writing text
and analyzing csv files.

And to find out how to use the suggested command, I gave you a
hint in the help, where everything is documented. If you had
followed the link, it would have explained how to detect the
extension as a different filetype. Because that's what it is for
vim, a new filetype, that will be treated like another filetypes.

Let's see what the help tell's us (this is from an older Vim with
filetype.txt dated from 07/15/2008):

,----
| *new-filetype*
| If a file type that you want to use is not detected yet, there
| are four ways to add it.
`----

Not exactly what we want, but keep on reading…


,----
| 2. Create a file that contains an autocommand to detect the
| file type.
| Example:
|
| au BufRead,BufNewFile *.mine set filetype=mine
|
| Note that there is no "augroup" command, this has already
| been done when sourcing your file. You could also use the
| pattern "*" and then check the contents of the file to
| recognize it.
|
| Write this file as "mine.vim" in the "ftdetect" directory in
| your user runtime directory. For example, for Unix:
|
| :w ~/.vim/ftdetect/mine.vim
`----

I might be missing something, but doesn't that look like what you
want?

> Finally, while I don't know anything, my understanding is that I don't
> need to create a new filetype, just to add one to those already
> recognized by an existing filetype. It seems that I've succeeded in
> doing that by placing the command in my .vimrc.

See above.

> Whether it's the proper or best solution -- as I say, I know
> nothing. Except that it works.

If you know nothing, may I suggest, that you start reading at the
help references that you have been given? Nobody here knows
everything about vim, but it is pretty good documented, so start
using the documentation.

regards,
Christian
--
Du fragst mich Kind, was Liebe ist? Ein Stern in einem Haufen Mist.
-- Heinrich Heine

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