itchyny / vim-cursorword

Underlines the word under the cursor
http://www.vim.org/scripts/script.php?script_id=5100
MIT License
611 stars 36 forks source link

Syntax groups inclusion/exclusion #14

Closed ivangreene closed 6 years ago

ivangreene commented 6 years ago

I've added two options to allow configuration of a whitelist and/or blacklist of syntax groups to highlight. One might use a configuration such as this:

" Only match these syntax groups
let g:cursorword_match_groups = ['Identifier', 'String', 'Number', '']
" Including an empty string will generally match unstyled identifiers in highlighting schemes like Python or JavaScript

" Don't match these syntax groups
let g:cursorword_exclude_groups = ['Statement', 'Keyword']

I saw that a similar pull request was rejected in order to keep the plugin simple and performant. However, I find this a necessity for my own use of the plugin. Highlighting language keywords is distracting, and I haven't noticed a performance drop. Please let me know what you think and if you'd like any changes or feel free to reject if you feel it doesn't meet the project goals.

itchyny commented 6 years ago

This plugin is created from the complaints of the poor performance of the existing plugin (see the help). I remember the heaviest part due to the :profile command was the code retrieving the syntax name under the cursor. I'm sorry but I'm satisfied with the current behavior of the plugin, minimal code can provide most people including me good features with good performance, and I will not accept patches for new features.

ivangreene commented 6 years ago

Understandable; have a great day