All Projects → hdima → Python Syntax

hdima / Python Syntax

Licence: mit
Python syntax highlighting script for Vim

Labels

Projects that are alternatives of or similar to Python Syntax

Investigate.vim
A Vim plugin for looking up documentation
Stars: ✭ 282 (-20.34%)
Mutual labels:  viml
Molokai
Molokai color scheme for Vim
Stars: ✭ 3,349 (+846.05%)
Mutual labels:  viml
Vim Misc
Miscellaneous auto-load Vim scripts
Stars: ✭ 334 (-5.65%)
Mutual labels:  viml
Rust.vim
Vim support for Rust file detection and syntax highlighting.
Stars: ✭ 288 (-18.64%)
Mutual labels:  viml
Vim Config
my vim config to share amongst my machines
Stars: ✭ 312 (-11.86%)
Mutual labels:  viml
Taskpaper.vim
This package contains a syntax file and a file-type plugin for the simple format used by the TaskPaper application.
Stars: ✭ 325 (-8.19%)
Mutual labels:  viml
Vim Powerline
Moved to powerline/powerline.
Stars: ✭ 2,880 (+713.56%)
Mutual labels:  viml
Vim Two Firewatch
A blend between duotone light and firewatch for atom
Stars: ✭ 345 (-2.54%)
Mutual labels:  viml
Vim Dadbod Ui
Simple UI for https://github.com/tpope/vim-dadbod
Stars: ✭ 315 (-11.02%)
Mutual labels:  viml
Vim2hs
vim2hs :: Vim -> Haskell
Stars: ✭ 332 (-6.21%)
Mutual labels:  viml
Blamer.nvim
A git blame plugin for neovim inspired by VS Code's GitLens plugin
Stars: ✭ 283 (-20.06%)
Mutual labels:  viml
Vim Buffet
IDE-like Vim tabline
Stars: ✭ 304 (-14.12%)
Mutual labels:  viml
Pear Tree
A Vim auto-pair plugin that supports multi-character pairs, intelligent matching, and more
Stars: ✭ 327 (-7.63%)
Mutual labels:  viml
Elm.vim
Vim plugin for the Elm programming language
Stars: ✭ 286 (-19.21%)
Mutual labels:  viml
Vimroom
Simulating a vaguely WriteRoom-like environment in Vim.
Stars: ✭ 338 (-4.52%)
Mutual labels:  viml
Vim Stylus
Syntax Highlighting for Stylus
Stars: ✭ 277 (-21.75%)
Mutual labels:  viml
Vim Textobj Rubyblock
A custom text object for selecting ruby blocks.
Stars: ✭ 321 (-9.32%)
Mutual labels:  viml
Winresizer
very simple vim plugin for easy resizing of your vim windows
Stars: ✭ 353 (-0.28%)
Mutual labels:  viml
Xterm Color Table.vim
All 256 xterm colors with their RGB equivalents, right in Vim!
Stars: ✭ 344 (-2.82%)
Mutual labels:  viml
Lavalamp
A text editor theme that visually differentiates languages.
Stars: ✭ 328 (-7.34%)
Mutual labels:  viml

Python syntax highlighting script for Vim

.. contents::

About

Enhanced version of the original Python syntax highlighting script. Based on python.vim from Vim 6.1 distribution by Neil Schemenauer (nas at python dot ca). Check also python.vim page on vim.org <http://www.vim.org/scripts/script.php?script_id=790>_.

Please use the following channels for reporting bugs, offering suggestions or feedback:

Features

Changes from the original python.vim are:

  • Added support for Python 3 syntax highlighting

  • Added :Python2Syntax and :Python3Syntax commands which allow to switch between Python 2 and Python 3 syntaxes respectively without reloads/restarts

  • Updated strings highlighting

  • Enhanced special symbols highlighting inside strings

  • Enhanced highlighting of numeric constants

  • Added optional highlighting for %-formatting inside strings

  • Added highlighting for magic comments: source code encoding and #! (executable) strings

  • Added highlighting for new exceptions and builtins

  • Added highlighting for doctests

  • Added highlighting for new @decorator syntax introduced in Python 2.4a2

  • Added highlighting for the following errors:

    • invalid symbols in source file
    • mixing spaces and tabs
    • invalid numeric constants
    • invalid %-formatting inside strings
    • invalid variable names
    • trailing spaces (triggered by the python_highlight_space_errors option)

Some of these features was later backported into the original python.vim.

How to install

The easiest installation method is to place syntax/python.vim <https://github.com/hdima/python-syntax/blob/master/syntax/python.vim>_ script into your ~/.vim/syntax/ directory.

You can also use Pathogen <https://github.com/tpope/vim-pathogen>_ or Vundle <https://github.com/gmarik/vundle>_ plugin managers in which case you can install the whole python.vim repository <https://github.com/hdima/python-syntax>_ into the corresponding plugins directory.

Script options

There are two commands to enable or disable an option:

:let OPTION_NAME = 1 Enable option :let OPTION_NAME = 0 Disable option

For example to enable all syntax highlighting features you can place the following command in your ~/.vimrc script::

let python_highlight_all = 1

Option and commands to select Python version


``python_version_2``
  Enable highlighting for Python 2 (Python 3 highlighting is enabled by
  default). Also can be set as a local to buffer ``b:python_version_2``
  variable.

The following local to buffer commands can be used to switch between two
highlighting modes:

``:Python2Syntax``
  Switch to Python 2 highlighting mode
``:Python3Syntax``
  Switch to Python 3 highlighting mode

Options used by the script
~~~~~~~~~~~~~~~~~~~~~~~~~~

``python_highlight_builtins``
  Highlight builtin functions and objects
``python_highlight_builtin_objs``
  Highlight builtin objects only
``python_highlight_builtin_funcs``
  Highlight builtin functions only
``python_highlight_exceptions``
  Highlight standard exceptions
``python_highlight_string_formatting``
  Highlight ``%`` string formatting
``python_highlight_string_format``
  Highlight syntax of ``str.format`` syntax
``python_highlight_string_templates``
  Highlight syntax of ``string.Template``
``python_highlight_indent_errors``
  Highlight indentation errors
``python_highlight_space_errors``
  Highlight trailing spaces
``python_highlight_doctests``
  Highlight doc-tests
``python_print_as_function``
  Highlight ``print`` statement as function for Python 2
``python_highlight_file_headers_as_comments``
  Highlight shebang and coding headers as comments
``python_highlight_all``
  Enable all the options above. *NOTE: This option don't override any
  previously set options*
``python_slow_sync``
  Can be set to 0 for slow machines

Contributors
------------

List of the contributors in alphabetical order:

- `Andrea Riciputi <https://github.com/mrrech>`_
- Anton Butanaev
- `Antony Lee <https://github.com/anntzer>`_
- Caleb Adamantine
- `David Briscoe <https://github.com/idbrii>`_
- `Elizabeth Myers <https://github.com/Elizafox>`_
- `Ihor Gorobets <https://github.com/iho>`_
- `Jeroen Ruigrok van der Werven <https://github.com/ashemedai>`_
- `John Eikenberry <https://github.com/eikenb>`_
- `Joongi Kim <https://github.com/achimnol>`_
- `Marc Weber <https://github.com/MarcWeber>`_
- `Pedro Algarvio <https://github.com/s0undt3ch>`_
- `Victor Salgado <https://github.com/mcsalgado>`_
- `Will Gray <https://github.com/graywh>`_
- `Yuri Habrusiev <https://github.com/yuriihabrusiev>`_
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].