I use python and in python, three quotation marks in a row
"""
or
'''
signify a block-comment, and a normal comment is just a hashtag. (#) I want comments to be colored grey and strings to be colored orange. I am using the colorscheme murphy. I made a murphy-mine.vim file and I added this to it
hi Comment term=bold ctermfg=Grey guifg=Grey
hi String term=bold ctermfg=LightRed guifg=Orange
But gvim sees """
and '''
as a string in python syntax rather than treating it as a comment (block comment). Is there a way for me to tell gvim to see """
and '''
as a comment / block comment rather than a string?
You can put the following into ~/.vim/after/syntax/python.vim
(taken from here:
" Highlight docstrings as comments, not string.
syn region pythonDocstring start=+^\s*[uU]\?[rR]\?"""+ end=+"""+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError
syn region pythonDocstring start=+^\s*[uU]\?[rR]\?'''+ end=+'''+ keepend excludenl contains=pythonEscape,@Spell,pythonDoctest,pythonDocTest2,pythonSpaceError
hi def link pythonDocstring pythonComment
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다