Use vim to edit a sudoers file that has hyphenated username in it, such as www-data (the apache username on Ubuntu 24.04 LTS).
Note that the hyphenated usernames are not colored. This would also occur with usernames containing digits.
Ubuntu has NAME_REGEX setting of "^[a-z][-a-z0-9_]*$?$", so a trailing "$" is also allowed.
I expect "www-data" to be highlighted the same as any non-hyphenated username.
I achieved this locally by changing vim91/syntax/sudoers.vim to have \l[a-z0-9-]* instead of \l\+ in all syn match statements that had UserName, Group, or UserNetgroup in the name. Note that doesn't allow the trailing dollar sign.
vim 9.1, patches 1-16, 647, 678, 697
Ubuntu 24.04 LTS
Windows Terminal
xterm-256color
bash
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@e-kwsm please
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()