Kakoune: Highlight TODO automatically in comment regions.

Created on 31 May 2020  路  1Comment  路  Source: mawww/kakoune

Is it possible to add support for automatically highlighting TODO, ToDo in comment regions? Right now it must be defined in each filetype separately (or am I missing something)?

feature request

Most helpful comment

It's technically possible to edit all the language support scripts that define a "comment" region, and highlight some keywords within them.

But some scripts highlight comments as a simple regex, so it would be extra work to make those target comment lines specifically.

And not everyone would want arbitrary words to be highlighted anyway (and how should they be highlighted by default?).

It's easier to just use the following in your user configuration (taken from my own):

# highlight keywords
add-highlighter global/ regex \b(TODO|FIXME|XXX|NOTE)\b 0:+rb

>All comments

It's technically possible to edit all the language support scripts that define a "comment" region, and highlight some keywords within them.

But some scripts highlight comments as a simple regex, so it would be extra work to make those target comment lines specifically.

And not everyone would want arbitrary words to be highlighted anyway (and how should they be highlighted by default?).

It's easier to just use the following in your user configuration (taken from my own):

# highlight keywords
add-highlighter global/ regex \b(TODO|FIXME|XXX|NOTE)\b 0:+rb
Was this page helpful?
0 / 5 - 0 ratings

Related issues

vbauerster picture vbauerster  路  3Comments

fennewald picture fennewald  路  3Comments

lenormf picture lenormf  路  3Comments

alexherbo2 picture alexherbo2  路  3Comments

notramo picture notramo  路  3Comments