home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 February / OpenLinux 2.3 CD.iso / live / usr / share / vim / syntax / python.vim < prev    next >
Encoding:
Text File  |  1999-08-10  |  1.6 KB  |  48 lines

  1. " Vim syntax file
  2. " Language:    Python
  3. " Maintainer:    Neil Schemenauer <nascheme@acs.ucalgary.ca>
  4. " Last change:    1998 July 17
  5.  
  6. " Remove any old syntax stuff hanging around
  7. syn clear
  8.  
  9. syn keyword pythonStatement        break continue del
  10. syn keyword pythonStatement        except exec finally
  11. syn keyword pythonStatement        pass print raise
  12. syn keyword pythonStatement        return try
  13. syn keyword pythonStatement        global assert
  14. syn keyword pythonRepeat        for while
  15. syn keyword pythonConditional        if elif else then
  16. syn keyword pythonOperator        and in is not or
  17. syn region  pythonString        start=+'+  end=+'+ skip=+\\\\\|\\'+
  18. syn region  pythonString        start=+"+  end=+"+ skip=+\\\\\|\\"+
  19. syn region  pythonString        start=+"""+  end=+"""+
  20. syn region  pythonString        start=+'''+  end=+'''+
  21. syn keyword pythonFunction        def class lambda
  22. syn keyword pythonPreCondit        import from
  23. syn match   pythonComment        "#.*$" contains=pythonTodo
  24. syn keyword pythonTodo            contained TODO FIXME XXX
  25.  
  26. " triple quoted strings make syncronizing difficult
  27. "syn sync match pythonSync1 grouphere NONE +\("""$\)\|\('''$\)+
  28. syn sync match pythonSync grouphere NONE "):$"
  29. syn sync maxlines=100
  30.  
  31. if !exists("did_python_syntax_inits")
  32.   let did_python_syntax_inits = 1
  33.   " The default methods for highlighting.  Can be overridden later
  34.   hi link pythonStatement        Statement
  35.   hi link pythonConditional        Conditional
  36.   hi link pythonRepeat            Repeat
  37.   hi link pythonString            String
  38.   hi link pythonOperator        Operator
  39.   hi link pythonFunction        Function
  40.   hi link pythonPreCondit        PreCondit
  41.   hi link pythonComment            Comment
  42.   hi link pythonTodo            Todo
  43. endif
  44.  
  45. let b:current_syntax = "python"
  46.  
  47. " vim: ts=8
  48.