Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> But perhaps it's a bug in Vim since it works when I run * on the lowercase variant.

Per the help it's a feature, and it's infuriating! (From :help star)

> 'ignorecase' is used, 'smartcase' is not.

Here's your workaround:

    " By default, * and # respect 'ignorecase'. This mapping forces these commands
    " to search case sensitively, which is usually what you want when searching
    " code with * or #. May be less good for prose.
    nnoremap <silent> * /\C\<<C-R>=expand('<cword>')<CR>\><CR>
    nnoremap <silent> # ?\C\<<C-R>=expand('<cword>')<CR>\><CR>


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: