Home > Back-end >  Why doesn't Neovim highlight the entire syntax?
Why doesn't Neovim highlight the entire syntax?

Time:11-06

Neovim does not highlight functions and methods.

In Neovim:

Neovim

In Vscode:

Vscode

CodePudding user response:

By default, Neovim uses syntax highlighting based on regular expressions. The default syntax file for Python does not include rules to highlight methods and functions.

If you want to add such functionality, you have a few options:

  1. Extend the built-in syntax highlight for Python. You can add new syntax rules in your configuration file (see enter image description here
  2. Another option is to use LSP semantic syntax highlighting. I'm not sure if there are any LSP servers for Python which supports this feature, but there is a plugin that implements that for C . Therefore, you can also consider this option if you encounter a similar problem in other languages.
  • Related