I have following mapping
imap jj :execute 'tabnew'<cfile><CR>
instead of opening the under the cursor it just puts the string in place.
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
You should use instead of
imap jj <C-\><C-O> :tabnew <cfile><CR>