" Simplified version of http://www.vim.org/scripts/script.php?script_id=2184 " that does not replace current window function! fileline#goto() abort let file = bufname("%") if filereadable(file) | return | endif let names = matchlist(file, '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$') if empty(names) | return | endif let file_name = names[1] let line_num = names[2] == "" ? "0" : names[2] let col_num = names[3] == "" ? "0" : names[3] if !filereadable(file_name) | return | endif let nr = bufnr("%") exec "keepalt edit +" . line_num . " " . file_name exec "normal! " . col_num . "|" exec "bdelete " . nr endfunction