On Thu, Jan 14, 2010 at 6:41 PM, George Ryan wrote:
> The buf_T struct has a field called b_p_ft, which holds the filetype
> of the buffer. I would like to try and use this in determining valid
> operations for the file, rather than relying first (or solely) on the
> file extension. Is this the right approach? If so, is there a standard
> formatting/naming scheme for the strings that I would find there?
b_p_ft is the name of the buffer-local 'filetype' option. You could
in theory find any string at all there, since the user could put
whatever they wanted there. In practice, though, it will probably be
a filetype for which syntax highlighting exists, so this should give
you a reasonable list:
:echo map(split(globpath(&rtp, 'syntax/*.vim'), "\n"),
'substitute(v:val, ''.*/\(.*\).vim'', ''\1'', "")')
The above should be all one line, so you'll have to rejoin it if it
gets wrapped.
~Matt
--
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php