Comment delimiters for current filetype

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

Comment delimiters for current filetype

Andre Majorel-7
Is there a variable or register holding the/a comment delimiter
for the current filetype ? http://vim.wikia.com/wiki/Comment_Lin
es_according_to_a_given_filetype suggests there isn't but things
might have changed since then...

Thanks in advance.

--
André Majorel http://www.teaser.fr/~amajorel/
Subliminal message : Vim needs arbitrary tab stops.

--
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: Comment delimiters for current filetype

Gary Johnson-4
On 2012-01-14, Andre Majorel wrote:
> Is there a variable or register holding the/a comment delimiter
> for the current filetype ? http://vim.wikia.com/wiki/Comment_Lin
> es_according_to_a_given_filetype suggests there isn't but things
> might have changed since then...

It depends on what you're trying to do. The author of that wiki page
wanted to be able to comment-out blocks of code in a unified way
without having to know the comment character(s) for the language in
use.  Vim still does not have a built-in solution to that problem.

Vim does know how to recognize the comment characters and styles of
different languages, though, by means of the 'comments' option,
which is often set by a filetype plugin.  See

    :help 'comments'

HTH,
Gary

--
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: Comment delimiters for current filetype

Lech Lorens
On 15 Sty, 00:28, Gary Johnson <[hidden email]> wrote:
> It depends on what you're trying to do. The author of that wiki page
> wanted to be able to comment-out blocks of code in a unified way
> without having to know the comment character(s) for the language in
> use.  Vim still does not have a built-in solution to that problem.

What about 'commentstring'?

Cheers,
Lech

--
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: Comment delimiters for current filetype

Gary Johnson-4
On 2012-01-16, Lech Lorens wrote:
> On 15 Sty, 00:28, Gary Johnson <[hidden email]> wrote:
> > It depends on what you're trying to do. The author of that wiki page
> > wanted to be able to comment-out blocks of code in a unified way
> > without having to know the comment character(s) for the language in
> > use.  Vim still does not have a built-in solution to that problem.
>
> What about 'commentstring'?

That would do it.  Don't know how I missed that.  Thanks.

Regards,
Gary

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