On Jun 14, 2011, at 9:52 AM, Tim Gray wrote: > On Jun 11, 2011 at 04:19 PM -0400, Eric Weir wrote: >> As I understand it, I could create a "txt" filetype. While I'm not clear at >> this point how to do that, would there be any reason to prefer one method >> over the other, i.e., your suggestion or creating a new filetype? > > Yes, you could. I'm not sure if that is the right way to go though for 'txt' > files. The '.txt' extension is used for a lot of different kind of files; it > might be a be bit too generic to assign it a filetype.... The reality of it > is that if you are only setting one setting for '.txt' files, it's less > typing in your .vimrc to just attach the settings to the file extension, > bypassing the creation of a new file type.
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? > Here's an alternate suggestion. I seem to recall you are working in Markdown > or MultiMarkdown, or some other light weight markup language. If that's the > case, here's what I do: I downloaded one of the Markdown vim plugin which > gave me nice syntax coloring and defined a Markdown filetype for me. Then > all you have to do is use the extensions defined in the plugin, '.md' in the > case of Markdown (of course, you can add your own as well which I did). 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. > Finally, for specific filetype settings, create a file in > `~/.vim/after/ftplugin/filetype.vim`, replacing 'filetype' with the filetype > you want to define settings for - I used 'markdown.vim'. Inside that file, > put whatever vim commands you want, like enabling spell checking, turning on > or off line numbers, etc. I'd use the 'setlocal' variant of set. Then, > every time you open up a file ending in '.md', vim sets the filetype to > 'markdown' and runs the settings you want. I have a file for a plugin in ~/.vim/after/plugin. I wouldn't want to replace it. Could I simply add another? And could I add "txt" to the extents associated with the filetype for the plugin? Thanks again, especially for your patience with my naiveté, ------------------------------------------------------------------------------------------ Eric Weir Decatur, GA USA [email protected] -- 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
