Here, I'm using a mapping from this post. Edited it to my liking like so:
nnoremap <F3> :execute 'help' expand('<cWORD>')<CR>
that works. Problem is, i wanted to add
| only so that the help window become the only visible opened window.
I tried this in Ex mode:
:execute "h "expand("<cWORD>")"| only"
This works as intended.
Now when i try to do it in a mapping:
nnoremap <F3> :execute "h "expand("<cWORD>")"| only"<CR>
Doesn't seem to work.
I think it might be due to the position of the quotes, but after some experiments, i couldn't fix it myself.
How come the mapping doesn't work, when the Ex command does?