I have following mapping
imap jj :execute 'tabnew'<cfile><CR>
instead of opening the under the cursor it just puts the string in place.
You should use instead of
imap jj <C-\><C-O> :tabnew <cfile><CR>
I figured the issue out.
imap is actually doing exactly as it's told to do. It is going and pressing keys I typed there. So what I was missing to make it press before the command
imap jj <ESC> :tabnew <cfile> <CR> works perfectly