tpope/vim-commentary — Issue #8: Setting commentstring using syntax?
Author: dewarrn1
Created: 2012-01-11 20:50:29+00:00
State: open

This isn't an issue with *commentary* per se, but I'm wondering how to assign the commentstring variable for files without explicit FileTypes. For example, I edit R files in Vim and would love to use *commentary* with them, but adapting

```autocmd FileType apache set commentstring=#\ %s```

to what seems appropriate

```autocmd FileType r set commentstring=#\ %s```

has no effect because R doesn't have a Vim filetype. R does have a syntax file ("r.vim"), but the seemingly reasonable

```autocmd Syntax r set commentstring=#\ %s```

doesn't work. Any help would be most welcome!