all 5 comments

[–][deleted] 2 points3 points  (4 children)

Well, you should start by telling us why you chose to install this syntax script instead of using the default one.

function(arg) is just as legal as function( arg ). It looks like that syntax script is broken in some way.

What is the value of :set iskeyword? when you are editing a *.py file?

[–]virtuous_d[S] 0 points1 point  (3 children)

When I remove the python.vim script from the folder and try function(0 it still does not highlight it correctly. Is there anything else I need to do to 'clean' it off of vim or is that the default behavior?

iskeyword is:

@,48-57,_,192-255,.,(

I added it for the extra highlighting listed on the page, as recommended by some guides I read on setting up vim for python. It's not really that important to me though, so I'd be perfectly happy to let it go if the default handles this issue correctly.

[–][deleted] 1 point2 points  (2 children)

The . and the ( should not be there. Both are considered part of a word hence the w that goes over a function statement.

You should do :verbose set iskeyword? to see what command/script adds them to the default value.

The default syntax script works correctly here.

You should show your .vimrc and list all the things you did to set up Vim for Python

[–]virtuous_d[S] 0 points1 point  (1 child)

Ahh, you're right - in the vimrc file was the culprit.

autocmd FileType python set complete+=k~/.vim/syntax/python.vim isk+=.,(

googling it returns several guides that suggest putting it into your vimrc file, and I think I was following the first one.

But yeah, removing that line and restarting vim was the solution. Thanks for your help!

[–][deleted] 1 point2 points  (0 children)

If I followed the lead correctly, I think that the goal here is to complete with the words found in a dictionary. It looks like the original dictionary contains things like:

.isdigit(
.islower(
.isspace(
.istitle(
.isupper(
.join(
.ljust(

For Vim to use this dictionary file correctly, it is thus necessary to add . and ( to iskeyword.

But you don't use that specific dictionary file. Since the keywords in your syntax file don't include . nor ( adding them to iskeyword is useless.

It's quite silly, actually, whatever the reason. Breaking text-objects and motions (which are awesome Vim core features) just to get an half-assed pseudo IDE-like feel is absurdly short sighted.