1 " Simplified version of http://www.vim.org/scripts/script.php?script_id=2184
2 " that does not replace current window
5 let names = matchlist(bufname("%"), '\(.\{-1,}\):\%(\(\d\+\)\%(:\(\d*\):\?\)\?\)\?$')
6 if empty(names) | return | endif
7 let file_name = names[1]
8 let line_num = names[2] == "" ? "0" : names[2]
9 let col_num = names[3] == "" ? "0" : names[3]
10 if !filereadable(file_name) | return | endif
11 exec "keepalt edit +" . line_num . " " . file_name
12 exec "normal! " . col_num . "|"
15 autocmd! BufNewFile *:* nested call s:gotoline()
16 autocmd! BufRead *:* nested call s:gotoline()