On Jun 15, 2011 at 10:53 AM -0400, Eric Weir wrote:
Thanks, Tim. More questions, of course. The latter suggestion sounds good. Being Vim-naive, I sorta thought that's what creation of a filetype did. Again, not so simple I take it. By attach the settings, I take it you mean to turn on spell for files with the extension. How is that done?

I showed you how to turn on spelling for certain file types already.

    au BufRead,BufNewFile *.txt :setlocal spell spelllang=en

Personally, this is pretty close to putting spell check on for everything, especially since you say you aren't a programmer. Enough random content can be found in .txt files that you might have the spell checker on when you don't want it to be. And you'll probably never open up a python, C, or Fortran file, so who cares if spelling is on for those files? If *all* you ever type in is documents with prose, and they might have different extensions depending on your mood, you might be better served with:

    set spell spelllang=en

It's MultiMarkdown that I'm interested in, because it enhances MarkDown without complicating the markup, most importantly by providing for conversation to LaTeX, which is why it interests me. The Vim plugin would only be useful to me for the syntax highlighting, since it does not provide for conversion to LaTeX. And since the syntax is so simple and readable I'm not sure how helpful that would be.

I don't know what the MultiMarkdown vim plugin is capable of. I personally find syntax highlighting very useful. The vim plugin might provide other capabilities as well. I also don't know what extensions it expects or what the filetype in vim is called.

I have a file for a plugin in ~/.vim/after/plugin. I wouldn't want to replace it. Could I simply add another?

Assuming that the MultiMarkdown filetype is called 'multimarkdown', you would create a vim file called ~/.vim/after/ftplugin/multimarkdown.vim. Inside that file, you would write: setlocal spell spelllang=en

along with any other commands or settings you want for MultiMarkdown files.

If you are only interested in turning on spelling for that file type and nothing else, it might be simpler to just define the following in your .vimrc:

    au FileType multimarkdown setlocal spell spelllang=en

As far as I know, these methods are essentially equivalent. For single settings, it might be easier to do the latter. For more complicated setups, the after/ftplugin makes more sense to me.

And could I add "txt" to the extents associated with the filetype for the plugin?

If you really want to add a new extension (not extents) to an already defined file type, in your .vimrc, add a line like the following:

    au BufRead,BufNewFile *.{ext} :set ft=yourfiletype

Replace 'ext' with your extension and 'yourfiletype' with the filetype. The filetype *must* be already defined.

Sorry if this is all a lot to take in and I am too verbose. I think it would probably help if you read up on vim filetypes and how they differ from file extensions and names. Sometimes they represent the same thing, sometimes not.

--
You received this message from the "vim_mac" 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

Reply via email to