jcfaria/Vim-R-plugin — pull request #83 by glts (2014-02-28 11:54:18+00:00)
Title: Improved ftplugin settings for comments

This pull request addresses two issues with the `comments` and `commentstring` settings.

* The `commentstring` should have a space separating comment character and comment text. In my experience, style guides universally recommend having a space there (see for example Google R style guide):

#bad style
# good style

The `commentstring` setting is used for *producing* comments, thus it currently produces comments in `#bad style`.

* The `comments` settings should not have the `b` flag, since the whitespace following `#` is not required syntactically in R.

Consequences of the current setting are, for example, that it is not possible to reformat

#paragraphs
#in this
#style

with `gq` because they are not recognised by Vim as comments due to the `b` flag.

For reference I'd like to point to the tpope-maintained Ruby ftplugin which has

setlocal comments=:#
setlocal commentstring=#\ %s