2

In nerdcommenter, the default comment is /* */.

I tried to change it to # for plain text as:

"NerdCommenter {{{
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" Use compact syntax for prettified multi-line comments
let g:NERDCompactSexyComs = 1
let g:NERDCustomDelimiters = { 'text': { 'left': '#','right': '' } }
"}}}

But this is still using default /* */ style.

In linux, the file output is:

 file POSCAR
POSCAR: ASCII text

So, how I can change comment for such text file to #?

2
  • 2
    A more interesting output would be from Vim: :set filetype?
    – grodzik
    May 17, 2017 at 12:10
  • you are right...:set filetype is empty. I tried to change the empty filetype to text using: :autocmd BufNewFile * if &filetype == "" | set filetype=text | endif But this is not working
    – BaRud
    May 20, 2017 at 9:12

1 Answer 1

1

Had the same issue. Was incorrectly putting the custom delimiter option in my ~/.gvimrc. Worked when I put the custom delimiter setting in ~/.vimrc instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.