When searching string with notepad++, new window opens and shows find results. I want to use this feature in vim. After googling I found out some suggestions:
The requirement is actually easy. but to get user inputted pattern, you need a function.
function! FindAll()
call inputsave()
let p = input('Enter pattern:')
call inputrestore()
execute 'vimgrep "'.p.'" % |copen'
endfunction
if you want to have a mapping, add this line:
nnoremap :call FindAll()
but as I commented under your question. % may not work for unamed buffer.