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. Commented Nov 29, 2020 at 13:19
  • I use autocmd Syntax * syntax match Function "\v<%(\h|\$)%(\w|\$)*>\ze\_s*\(\_.{-}\)" containedin=CONTAINED 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. 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. Commented Nov 30, 2020 at 10:41

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.