syntax.txt 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. PYTHON *python.vim* *ft-python-syntax*
  2. There are two commands to enable or disable an option for python.vim
  3. Enable option: >
  4. :let option_name = 1
  5. <
  6. Disable option: >
  7. :let option_name = 0
  8. <
  9. For example to enable all syntax highlighting features you can place the
  10. following command in your `~/.vimrc` script: >
  11. let python_highlight_all = 1
  12. <
  13. Option and commands to select Python version: >
  14. :let python_version_2 = 1
  15. <
  16. Enable highlighting for Python 2 (Python 3 highlighting is enabled by
  17. default). Also can be set as a local to buffer `b:python_version_2`
  18. variable.
  19. The following local to buffer commands can be used to switch between two
  20. highlighting modes:
  21. Switch to Python 2 highlighting mode >
  22. :Python2Syntax
  23. <
  24. Switch to Python 3 highlighting mode >
  25. :Python3Syntax
  26. <
  27. Options used by the script
  28. Highlight builtin functions and objects >
  29. :let python_highlight_builtins = 1
  30. < Highlight builtin objects only >
  31. :let python_highlight_builtin_objs = 1
  32. < Highlight builtin functions only >
  33. :let python_highlight_builtin_funcs = 1
  34. < Highlight standard exceptions >
  35. :let python_highlight_exceptions = 1
  36. < Highlight `%` string formatting >
  37. :let python_highlight_string_formatting = 1
  38. < Highlight syntax of `str.format` syntax >
  39. :let python_highlight_string_format = 1
  40. < Highlight syntax of `string.Template` >
  41. :let python_highlight_string_templates = 1
  42. < Highlight indentation errors >
  43. :let python_highlight_indent_errors = 1
  44. < Highlight trailing spaces >
  45. :let python_highlight_space_errors = 1
  46. < Highlight doc-tests >
  47. :let python_highlight_doctests = 1
  48. < Highlight `print` statement as function for Python 2 >
  49. :let python_print_as_function = 1
  50. < Highlight shebang and coding headers as comments >
  51. :let python_highlight_file_headers_as_comments = 1
  52. < Enable all the options above. NOTE: This option don't override any
  53. previously set options >
  54. :let python_highlight_all = 1
  55. < Can be set to 0 for slow machines >
  56. :let python_slow_sync = 1
  57. <
  58. vim:tw=78:sw=4:ts=8:ft=help:norl: