In my vimrc I had a mapping to find all line with TODO in them and put them in the quickfix window:
nnoremap <leader>f :vimgrep /TODO/j % \| :cw<CR>
I now want to add the alternative pattern FIXME in the same way. So I tried
nnoremap <leader>f :vimgrep /TODO\|FIXME/j % \| :cw<CR>
and
nnoremap <leader>f :vimgrep /TODO<bar>FIXME/j % \| :cw<CR>
but neither return any results.
vimgrep /TODO|FIXME/j %
works at the : prompt when typed manually. So far my work-around is this:
function! FindFixme()
vimgrep /TODO\|FIXME/j %
cw
endfunction
nnoremap <leader>f :call FindFixme()<CR>
But I don't really understand why I can't get it to work as a single map command.
Thanks.