Vim :set ignorecase command do not affect "f" and "t" motion commands in my vim config.

Is there any option or hack that makes this commands to ignore case?

link|improve this question

40% accept rate
feedback

2 Answers

I would suggest something like:

function! ForwardLookup()
    " get next key pressed
    let c = nr2char(getchar())
    let old_search_pattern = @/
    " Use of \V enables very-nonmagic pattern
    exec 'normal /\c\V' . escape(c, '\/') . nr2char(0x0d)
    let @/ = old_search_pattern
endfunction
nnoremap f :call ForwardLookup()<CR>
link|improve this answer
Not strong enough: don't support numeric prefix, goes over line break, no visual mode support. – Bogdan Gusiev Jun 29 '11 at 19:47
feedback

I don't think you can make it ignore case on all commands. However, for your purposes, remapping the keys would get the desired result. You can do this by adding the following to your .vimrc file:

"remap the f and t keys to be case insensitive in visual, command, and normal mode.
map F f
map T t
link|improve this answer
1  
this is not what was asked for. OP wants 'fi' to go to next i or I. – Benoit Jul 29 '11 at 13:45
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.