It's not straight-forward, but it's possible to do this with
:h map-<expr> and some script:
autocmd CompleteDone,InsertLeave *
\ if exists('s:ignorecase') |
\ let &ignorecase = s:ignorecase |
\ unlet! s:ignorecase |
function! s:before_complete(key) abort
let s:ignorecase = &ignorecase
for s:key in ["\<c-n>", "\<c-p>", "\<c-x>"]
execute 'inoremap <expr> '.s:key.' <sid>before_complete("'.s:key.'")'
Note: The double quotes and slashes are significant.
<c-x> are mapped to an expression that returns the final keys to be interpreted by Vim. In this case all you're doing is using
s:before_complete() as a passthrough to set
ignorecase, the autocmd
CompleteDone is used. If a menu isn't displayed when pressing any of those keys,
CompleteDone should still be triggered.
InsertLeave is included since it's the ultimate indication that you're not doing anything with completions. Sanity is always a good thing :>