def get_comment_format():
 commentstring = vim.eval('&commentstring')
 if commentstring.endswith('%s'):
  c = commentstring[:(-2)]
  return (c, c, c, '')
 comments = _parse_comments(vim.eval('&comments'))
 for c in comments:
  if (c[0] == 'SINGLE_CHAR'):
   return c[1:]
 return comments[0][1:]

def get_comment_format ( ) : commentstring = vim . eval ( '&commentstring' ) if commentstring . endswith ( '%s' ) : c = commentstring [ : ( - 2 ) ] return ( c , c , c , '' ) comments = _parse_comments ( vim . eval ( '&comments' ) ) for c in comments : if ( c [ 0 ] == 'SINGLE_CHAR' ) : return c [ 1 : ] return comments [ 0 ] [ 1 : ]
returns a 4-element tuple representing the comment format for the current file .