Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround certain words being reserved in Vim #1

Merged
merged 1 commit into from
Feb 17, 2014

Conversation

cursork
Copy link
Contributor

@cursork cursork commented Feb 17, 2014

The following is illegal in Vim:

syntax keyword clojureFunc foo contains baz

It causes "E395: contains argument not accepted here". It seems that other plugins have worked around the issue using contain[s]. So that is what I've done here.

Note that this is an issue for anyone using Midje in tests (which is how I hit it in a project):

(:require [midje.sweet :refer :all])

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Of particular note is 'contains' as anything that does a
`(:require [midje.sweet :refer :all])` will end up with contains being
referred into the namespace.
guns added a commit that referenced this pull request Feb 17, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Workaround certain words being reserved in Vim
@guns guns merged commit 51ad8ab into guns:master Feb 17, 2014
@guns
Copy link
Owner

guns commented Feb 17, 2014

Ah, nice workaround. There is another problem with syntax keyword: it does not seem possible to have a | character in a keyword.

This can all be avoided by using syntax match; I'm currently evaluating whether this is fast enough for vim-clojure-static, which matches hundreds of vars. A syntax keyword match is a fast table lookup, while match goes through the syntax engine.

Anyway, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants