commenting with Stata files

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

commenting with Stata files

Dimitriy V. Masterov
I am having trouble getting vim to allow me to use Stata-specific
comments with a shortcut. I tried using a plugin called
FeralToggleCommentify, which is available at
http://vim.sourceforge.net/scripts/script.php?script_id=665 .

Stata files have extensions like *.ado,*.class,*.do,*.imata, and
*.mata. I tried to include these file types by adding things like this
to the plugin:

elseif fileType == 'ado' || fileType =='do'
let commentSymbol_L = '/* '
let commentSymbol_R = ' */'

I could not get it to work. It still gives me an error message that
the file type is not recognized. I also tried hacking some of the
other commenting plugins, but with no luck. I also tried contacting
the guy who wrote the script, but the e-mail bounced.

Has anyone gotten something like this to work? I am using vim 7.3.

Dimitriy

--
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
Reply | Threaded
Open this post in threaded view
|

Re: commenting with Stata files

Nikolay Aleksandrovich Pavlov
Reply to message «commenting with Stata files»,
sent 21:45:12 24 October 2010, Sunday
by Dimitriy V. Masterov:

> Stata files have extensions like *.ado,*.class,*.do,*.imata, and
> *.mata. I tried to include these file types by adding things like this
> to the plugin:
>
> elseif fileType == 'ado' || fileType =='do'
> let commentSymbol_L = '/* '
> let commentSymbol_R = ' */'
<...>
> I could not get it to work. It still gives me an error message that
> the file type is not recognized. I also tried hacking some of the
> other commenting plugins, but with no luck. I also tried contacting
> the guy who wrote the script, but the e-mail bounced.
>
> Has anyone gotten something like this to work? I am using vim 7.3.
Nerdcommenter (http://www.vim.org/scripts/script.php?script_id=1218) relies on
&commentstring for unknown filetypes. I tried
    :set ft=ado
    aa<Esc>,cc
and it left ``/* a */'' in a buffer which was intended. But I do not have ado
filetype plugin, so it probably won't work if your filetype plugin sets
&commentstring to wrong value (`/*%s*/' is a default value for `&commentstring',
but I do not see any reason why ado filetype plugin should alter that). If it
happens, add line ``setlocal commentstring=/*%s*/'' to `~/.vim/ftplugin/ado.vim'
and to `~/.vim/ftplugin/do.vim'.

signature.asc (205 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: commenting with Stata files

Dimitriy V. Masterov
The filetype for all kinds of Stata files is actually stata. Many
thanks to ZyX for helping me figure this out.

DVM

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