I got annoyed enough about the above answers from 2013 not quit working reliably in the situations I cared about, and wrote slightly-more-robust functions to handle them. For gF specifically (i.e. including the "goto linenumber" functionality), as an example:
function! gfriend#goto_cWORD(winmotion)
let cword = expand("<cWORD>")
let st = match(cword, '\v\f+:\d+')
let end = matchend(cword, '\v\f+:\d+')
if end !=# -1
let cword = cword[st:end - 1]
endif
let bits = split(cword, ':')
let starting_window = nvim_win_get_number(0)
" If there's no previous window, create a new one
wincmd p
if nvim_win_get_number(0) ==# starting_window
execute(a:winmotion." ".bits[0])
else
execute("e ".bits[0])
endif
if bits[1]
execute(bits[1])
endif
endfunction
Usage is something like:
nmap <silent> <Leader>gF \
:<C-u>call gfriend#goto_cWORD(winwidth(0) >=# 180 ? 'vsp' : 'sp')<CR>
I've posted the (tiny) thing to GitHub, from whence you can install it as a plugin if you like:
Plug 'ELLIOTTCABLE/vim-gfriend'