1

I have set up some syntax highlights for some patterns, for example: sc.nextInt() nextInt will be highlighted as a Function... Then I have included :set iskeyword+=(,.,) in order for autocompletion to offer completions with brackets and dots in popups, but these settings disable any set highlights around the newly set keywords. (nextInt() will no be highlighted anymore etc.) I was wondering if there is a better solution or a way to go around this.

4
  • 1
    Use :syntax match instead of :syntax keyword if you’re concerned about iskeyword affecting the syntax-keywords.
    – D. Ben Knoble
    Commented Nov 29, 2020 at 13:19
  • I use autocmd Syntax * syntax match Function "\v<%(\h|\$)%(\w|\$)*>\ze\_s*\(\_.{-}\)" containedin=CONTAINED
    – Something
    Commented Nov 29, 2020 at 13:50
  • This is the little trouble. The big one is that it changes the behaviour of w,b and so on.
    – eyal karni
    Commented Nov 29, 2020 at 20:48
  • I have managed to make it work by adding the defined highlight groups to syn iskeyword. I just have to figure out if this is a valid solution.
    – Something
    Commented Nov 30, 2020 at 10:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.