[vim/vim] Why does vim not highlight bash function names that start with the letters "do"? (#4033)

13 views
Skip to first unread message

Ben Burrill

unread,
Feb 22, 2019, 1:54:46 AM2/22/19
to vim/vim, Subscribed

If you write your bash functions using the function syntax, function names that start with do don't get highlighted, so for example:

function download_something {
    :
}

(in Vim, download_something doesn't get highlighted, but if you change it to something that doesn't start with "do" it does)

Initially I thought this was some weird conflict with highlighting for the do keyword, but looking at syntax/sh.vim, it looks like this is very intentionally done, and only for the function syntax (not the function_name() {} syntax).

But why? The shell I'm using (bash 4.4) doesn't have any problem with function names starting with do. And the shFunctionTwo region responsible for this is set in a if exists("b:is_bash") block, so I wouldn't think it has anything to do with any other shells. Did old versions of bash not like such function names or something?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

dkearns

unread,
Mar 25, 2026, 3:22:50 AM (yesterday) Mar 25
to vim/vim, Subscribed
dkearns left a comment (vim/vim#4033)

Fixed by 955c02d


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/4033/4124336755@github.com>

dkearns

unread,
Mar 25, 2026, 3:22:52 AM (yesterday) Mar 25
to vim/vim, Subscribed

Closed #4033 as completed.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/4033/issue_event/23879610969@github.com>

Reply all
Reply to author
Forward
0 new messages