Function calls wrong color in Python
bernharl opened this issue ยท 4 comments
Hi @bernharl. Thanks for taking the time to help improve the colorscheme ๐ . I've added a rule to highlight the function call the same way Sublime Text does (light blue). You can see the changes I made in this commit: 6e23360
To get the update, just pull the latest changes using your package manager. If you use Plug the command is :PlugUpdate
.
Please let me know if you find any other glaring differences, I don't write that much Python so I'm happy to take suggestions. Thanks again!
Also, for me, using the standard python syntax file in neovim, Python functions are identified by the syntax group as pythonBuiltin
. The change I made updated this group to light blue.
For reference, if you want to know which highlight group is being used for a piece of syntax, you can use the following snippet. I keep this in my .vimrc to help me identify named syntax groups.
" If you don't know what the name of a particular hightlight is, you can use
" `What`. It will print out the syntax group that the cursor is currently above.
" from https://www.reddit.com/r/vim/comments/6z4aau/how_to_stop_vim_from_autohighlighting_italics_in/
command! What echo synIDattr(synID(line('.'), col('.'), 1), 'name')
Thanks for the quick reply! It seems that the syntax package I use has different names for function calls. For it to work for me I would need the color to be defined for pythonFunctionCall
and pythonBuiltinFunc
. Thank you for that command by the way, very useful.
Cool, I checked vim-polyglot and it uses vim-python. I added the plugin and checked the named groups and I got the same names as you suggested. I've added the new rules and pushed the update ๐.
One of the differences between python syntax highlighting in Sublime vs the vim-monokai-tasty version is the def
keyword. Unfortunately, the vim python syntax file lumps the def
keyword in the same group as the return
keyword. So if def
is highlighted as italic light blue, then that makes return
italic light blue too. So I've opted to leave them both magenta.
Try it out and lemme know how it goes ๐
example comparison: